xsl-list
[Top] [All Lists]

RE: [xsl] Find the root element from an attribute node

2008-07-11 08:37:42
OK. So none of these work - and why not? Do I really have to 
assign a namespace? 

If your source document is in a namespace, then you must refer to its
elements by that namespace.


Is there a way to say "any namespace"? Why isn't that the default?


The namespace is part of the name. Saying "any namespace" would be like
saying "anyone called Dave, don't care about the surname". That's fine so
long as your stylesheet never strays further than your own little closed
world, but if it's going to have wider exposure then you can't afford to be
so parochial.

Or to take another analogy, it's like publishing your phone number without
an international dialling code. By doing that, you are saying that you're
not expecting anyone outside your own country to want to talk to you.

What you can do in XSLT 2.0 is to say xpath-default-namespace="....". That
means that unprefixed names refer to a specific namespace, rather than to
names in no namespace.

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--