Web Analytics Made Easy -
StatCounter Selecting branches/nodes in XML documents - CodingForum


No announcement yet.

Selecting branches/nodes in XML documents

  • Filter
  • Time
  • Show
Clear All
new posts

  • Selecting branches/nodes in XML documents


    Im pretty new to XML and was just wondering what is the best way (s) to:

    (1) Select a specific branch/node given a particular XML document?

    (2) Verify that 2 branches from 2 xml documents have the same meaning.

    Any examples of these would be great, im researching XML DOM and X Path stuff but sample code is always the best way for me to pick up on the new concepts.

    I have to build these to functions into a HTML interface.

    Any advice/examples/feedback would be much appreciated.

    many thanks

  • #2
    [removed by moderator]

    Your second question is rather ambiguous, but I think that once you understand the basics (by reading the stickies and the articles/sites linked to within) you will able to answer it for yourself very easily.

    Last edited by Alex Vincent; Feb 19, 2004, 10:09 PM.
    Marcus Tucker / www / blog
    Web Analyst Programmer / Voted SPF "ASP Guru"


    • #3
      I can tell you you're on the right track On your first question, the easiest way via DOM is to give the element (if you are referring to an element) a unique id, and then document.getElementById. XPath is more flexible, and Mozilla even supports an XPath DOM

      To help you solve your problem, why don't you start with some sample XML code, and explain what you want to do exactly, using the XML as a guide for the rest of us?
      "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
      June 30, 2001
      author, ES-Membrane project (Github Pages site)
      author, Verbosio prototype XML Editor
      author, JavaScript Developer's Dictionary