Subject: Re: [xsl] how to define a namespace-prefix for null-namespace From: Siegfried Baiz <baiz@xxxxxxxxx> Date: Wed, 23 Mar 2005 19:11:56 +0100 |
Your last sentence also means that in the XSLT-Spec, exists no "dummy"-namespace as placeholder for that "no-namespace" like in my second trial: <xsl:stylesheet version="2.0" .... xmlns:my="#default"> <xsl:template match="my:*"> ... ?
Is there any other way to avoid changing all the xpath-selection rsp. all the match-patterns of my stylesheet, when the input-document will be decorated by a namespace.
<xsl:stylesheet version="2.0" .... > <xsl:template match="root"> <xsl:apply-template select="tag1/tag2[tag3]"/> ... into
As far as I know it is neither possible to use empty namespace-prefix, like <xsl:stylesheet version="2.0" .... xmlns="http://www.my.thenewnamespace"> <xsl:template match="root"> <xsl:apply-template select="tag1/tag2[tag3]"/>
-------------------------------------------------- Dipl.-Math. (Univ.) Siegfried Baiz Sulzer GmbH Frankfurter Ring 162, D-80807 Muenchen Tel.: +49 89 31858-264 Fax : +49 89 31858-599 mailto:baiz@xxxxxxxxx --------------------------------------------------
In my XSLT-stylesheet I wanted to define a xmlns-prefix for that null-namespace,
The XML Namespaces rec does not allow a prefix to be used with no-namespaace.
With XML Namespace 1.0 (which is the version used by almost all systems) xmlns:my="" is a syntax error. With WXML Namespace 1.1 xmlns:my="" is allowed but it does not make <my:foo/> refer to foo in no-namespace it unbinds the prefix my (if it had already been bound) so making <my:foo/> an error.
So your requested result isn't conformant to the XML namespaces rec, and XSLT won't generate it for you.
David
________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] how to define a namespace, David Carlisle | Thread | RE: [xsl] how to define a namespace, Michael Kay |
[xsl] XSL / XML initial tag incompa, yechiel lewis | Date | Re: [xsl] XSL / XML initial tag inc, G. Ken Holman |
Month |