Hi:

When walking the DOM, is there a clever way to determine the association 
between an XML comment and the element it is associated with?

For example, if I'm writing some code to walk the DOM trees of two XML files 
and want to copy certain elements from DOM1 to DOM2, how
do I also copy any optional comment for the specified element in DOM1?

The problem, as I see it, is that the comment could be above or below the 
associated element node.  It could also span multiple lines or consist
of multiple consecutive comment lines.

Another idea (since the XML files I'm dealing with never use TEXT_NODEs) might 
be to use the TEXT_NODE as documentation for a given element:

                                <Foo value="some_attr_value_string">
                                        This TEXT_NODE serves as the 
documentation for the Foo element.
                                        It is always nicely encapsulated by the 
associated element.
                                </Foo>


                Thanks, Steve
---------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to