Obviously you'll just create a flame war with this... I am FAR from alone, both on and off this group, from the only person asserting that default namespace handling wasn't well thought-out... If you generate XML, put prefixes on your tags. Trust me, you are doing the whole world a big favor.
On Friday 28 March 2003 10:04 am, Daniel Veillard wrote: > On Fri, Mar 28, 2003 at 09:46:05AM -0500, Tod Harter wrote: > > Part of the problem here is that the SPEC is 'broken'. How do you select > > with XPath an element that is in a default namespace? There is no prefix > > you can place in the XPath statement!!! Your stuck! > > Perfectly wrong ! > Either: > 1/ you map the default namespace name of your target nodes to > a namespace with a prefix in the context of the XPath expression > i.e. map foo to the default namespace name and use > /foo:name > this is the prefered solution and every correct use of XPath should > allow you to do such a namespace mapping > 2/ or if you can't define such a namespace mapping you build your > XPath expression with the local-name() and namespace-uri() defined > in the XPath spec: > http://www.w3.org/TR/xpath#function-local-name > /*[local-name() = 'name' and namespace-uri() = 'default namespace > name'] > > Again before asserting that a spec or code associated to it is broken, > it's better to read the associated spec and make sure your understand it ! > > > I had this problem with parsing > > some XHTML the other day where everything was in the default namespace. > > In XSLT you're template can specifiy the same namespace as the default > > and then IIRC you get a match, but what if you had to deal with multiple > > namespaces? The entire concept of default namespaces makes me grind my > > teeth. Its like autovivification of variables and hash keys in perl. > > Anyone designing XML processing systems DO NOT USE DEFAULT NAMESPACES, > > ever ever ever! > > Sorry, this is crap. Simply define the xmlns:xhtml="XHTML namespace" > at the top of your XSLT stylesheet and use xhtml:html etc. in your > template match and embedded XPath expressions. People have done that > for years without trouble, you're just showing ignorance here. Sorry > that doesn't give you the right to shout on the topic ... > > Daniel -- Tod Harter Giant Electronic Brain --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
