Jump to content

tag names.


zaheer
 Share

Recommended Posts

That's actually one of the most difficult questions to answer. What you have there are not orginary names. They are names in a namespace. The part before the ":" is the namespace prefix. Somewhere in the document, there should be an attribute named "xmlns:module" (for example), the value of which will specify what is known as a "namespace URI".Whether you can parse namespace documents or not depends entirely on the environment.IE's JScript implementation doesn't, I think, support namespaces over XML documents, despire its XML parser actually supporting namespaces. With it, you can usedocument.getElementsByTagName('date')to get all 'date' elements regardless of their namespace, and there's no real way of limiting the selecion over 'date' elements in a specified namespace.If you can use any sort of XPath engine, it should probably be namespace aware already. With it, you can specify for example

//*[local-name() = 'date']

to get all "date" elements, regardless of their namespace.In PHP5, and most other server environments, there is XPath support, as well as complete DOM support, including methods like getElementsByTagNameNS() which allow you to limit the selection of elements between ones in a certain namespace.........What environment exactly do you want to use the XML in?In other words - what is the language (and its version) with which you want to parse the XML document, and is it on the server, or the client (browser)? If the client, know getting it to work in all browsers is entering h#ll's gate.

Link to comment
Share on other sites

  • 2 months later...
doesn't matter. It was just a general question.thanx for the reply ne how.
I realize this was a general question, but prefixes, like local names, cannot start with a number, i.e., "123" -- only letters and the underscore character. See: http://www.w3.org/TR/xml-names/#NT-Prefix :) CzechM8
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...