xsl-list
[Top] [All Lists]

RE: XPATH problem with namespace

2004-10-07 05:07:25

Apologies for the XSLT 2.0 newbie question but why does the 
XSLT author 
have to deal with two default namespaces in the same 
document? At first 
glance, it seems that making XPath aware of the XSLT 
document's default 
namespace is a simpler solution.


That's the solution XQuery went for, but it means that if your input file
uses the null namespace and your output file doesn't, then you need to
prefix all your element names in output element constructors, and also if
the output is XHTML then you are likely to end up with prefixes in the
serialized result, which will violate the XHTML DTD and not work in legacy
browsers. Equally, if the output uses the null namespace and the input
doesn't, as in many XML->HTML transformations, you'll be back with having to
prefix all the names in path expressions.

Also, of course, 2.0 has to be backwards compatible with 1.0: but the above
explains why 1.0 decided not to use the default namespace for names in path
expressions.

Michael Kay



<Prev in Thread] Current Thread [Next in Thread>