|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] Generating xhtml from xml in no namespaceMichael Kay mike at saxonica.comWed Dec 17 11:50:10 PST 2008
> > This is surely a faq, but I'm interested in what people think > is the right approach for this... > > The input is in no namespace, the required output is unprefixed xhtml: > > <html xmlns="http://www.w3.org/1999/xhtml"> > .... > <body> > { > for $x in collection(...)/path/to/node > > For some reason the default namespace on the html element > affects the xpath - which is different to xslt and a little > odd to me... > > Is there something like xpath-default-namespace so I can > clear the default namespace for the xpaths? No, unfortunately not. I tried to get something like this in, but the general tendency of the WG was resistance to making namespaces even more complicated than they were already. If you want the output to be in an unprefixed namespace, but the input is in no namespace, then the only ways I know to achieve this are either (a) to use computed element constructors to create all the output elements, or (b) to put all the path expressions into functions, rather than having them nested within element constructors I think it would have been better to have had two completely separate static namespace contexts, one used for path expressions and one for constructed elements, and for namespace declarations on constructed elements to affect only the latter. Michael Kay http://www.saxonica.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






