Aren't default namespaces just EVIL? ;) I always felt that this was a near-fatal flaw in the binding between XML and Xpath/XSLT...as it creates the need for a "programmer" to consciously "add" something to a DOM, parser or other component to enable Xpathing anything with a default namespace somewhere in the path. And since the assigned prefix is determined by the programmer, it is essentially "non-portable" - the context used for an Xpath expression in product "A" might not be the same as product "B".
But as well all know, there isn't an easy solution...other than not using default namespaces or providing a prefix mapping in the source document for each default namespace URI. Any other recommended "best practices"? Rick Bullotta CTO Lighthammer Software (http://www.lighthammer.com) -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Sunday, October 24, 2004 2:36 PM To: [EMAIL PROTECTED] Subject: Re: XPath with default namespace > I am essentially using the code from SimpleXPathAPI sample in the > Xalan-C_1_8_0-windows_2000-msvc_60 samples programs to evaluate > a series of XPath expressions. The XML document that I am > evaluating the XPath expressions against uses a bunch of XML > namespaces. I find that even for elements in the default > namespace I have to qualify the element name with the namespace > prefix in the XPath expression for it to work. Is there any way > to make XPathEvaluator() recognize element names without a prefix > as being in the default namespace? No, there isn't. You must use a prefix for the default namespace. Dave --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
