OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   I need a unique node ID mechanism

[ Lists Home | Date Index | Thread Index ]
  • To: <xml-dev@lists.xml.org>
  • Subject: I need a unique node ID mechanism
  • From: "Mark Delaney" <MARKD@microen.com>
  • Date: Mon, 26 Sep 2005 16:43:58 -0700
  • Thread-index: AcXC9Cqec8smoFdASh2eNxDdwGz7fg==
  • Thread-topic: I need a unique node ID mechanism

I have two cooperating applications. The first (call it source) holds an
XML document. (Validated with a schema of my devising, if it matters.)

<?xml?>
<ROOT>
   <foo/>
   <bar/>
   <baz/>   
</ROOT>

Source occasionally passes nodes to the other app (call it sink) for
processing. Sink keeps a user-friendly representation of the last
several things processed. (viz. "foo", "bar", "baz") The user can select
(in the sink app) one of those recent entries. When they do, sink needs
to tell source that a particular node was chosen. Complicating this
slightly, nodes can be added and deleted at arbitrary locations in the
document between invocations of sink. The nodes passed are
MSXML2::IXMLDOMNode* using COM on Windows XP to be technology specific,
but I hope that doesn't change the answer I get very much.

So, in the sink app I need to extract a unique identifier from an
XMLDOMNode that will retain its association to its node of origin in the
face of future XML tree manipulation.

I am intermediate in XML expertise. I peruse the eight+ XML references
and tutorials on my bookshelf. There are a multitude of mechanisms I
could reach for. Should I add an ID attribute to each node with a
sequentially greater value when I load the file, and add ID attributes
to each node added thereafter? And of course add an optional ID
attribute to my schema. Or is there a way to get an XPath or Xpointer
description of a node starting with an XMLDOMNode? Does XLink hold
goodness I should know about, or is it a snake pit? XSLT has some node
id functionality. Is it somehow applicable? I am pretty confident that
the dynamic state of the document renders caching child sequence
fragment identifiers (e.g. #/1/1/4/2) untenable.

I am not sure where in this embarassment of riches I should turn first.
I can't be the first person with this need. A quick orientation to the
terrain I am standing on would be truly welcome. Thank you!


Best regards,

Mark Delaney



The opinions expressed herein are personal.  Micro Encoder Inc. is not
responsible for the content.




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS