|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








