|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Generating an XSD: namespace difficulty
> I can't figure out how to get the declaration of such a
> prefix into the
> xs:schema result element since both the prefix and the URI to which it
> refers are unknown until runtime.
The xsl:namespace instruction was added in XSLT 2.0 for this purpose. It
allows you to create a namespace node with a prefix and uri, just as you
would use xsl:attribute to create an attribute node.
The only way to achieve the same effect in XSLT 1.0 is a workaround: create
a result tree fragment containing an element in the relevant namespace, and
then copy the resulting namespace node:
<xsl:variable name="temp">
<xsl:element name="{concat($prefix, ':dummy')}" namespace="{$uri}"/>
</xsl:variable>
<xsl:copy-of select="xx:node-set($temp)//namespace::*[name()=$prefix]"/>
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
|

Cart








