xsl-list
[Top] [All Lists]

[xsl] Re: xsl:namespace

2009-02-21 02:02:09
> Can you please clarify on how to eliminate xsl:namespace in the example > I've
> provided?

If we take your code and expand it into a full example, it could look like this:
...

No. It could be a function building element with attribute of type xs:QName.
The goal is to ensure that one can reconstruct QName with resolve-QName().


If you cannot reliably know that namespace declaration appears somewhere
higher in the tree, then you neen to declare namespace at element level.

Consider:

<xsl:function name="t:create-schema-element" as="element()">
 <xsl:param name="name" as="xs:string"/>
 <xsl:param name="type" as="xs:QName"/>

 <xs:element name="{$name}" type="{$type}">
   <xsl:namespace name="{prefix-from-QName($type)}"
     select="namespace-uri-from-QName($type)"/>
 <xs:element>
<xsl:function>
--
Vladimir Nesterovsky
http://www.nesterovsky-bros.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>
--~--

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