This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Creating namespace declarations


> this is more a request for confirmation than a real question ...
> Am I right, that there's no way in XSLT 1.0 to create
>
> <example xmlns:ns="urn:namespace" value="ns:something" />
>
> if "urn:namespace" should be provided as a parameter (i.e.
> there aren't
> namespace nodes for this namespace, neither in the XML source
> nor in the stylesheet).
>
You are right. The requirement is recognized in the published XSLT 2.0
requirements.

You can get close in XSLT 1.0 (+errata) by creating an external document
dd.xml

<doc xmlns:ns="urn:namespace/>

and doing

<example>
  <xsl:copy-of select="document('dd.xml')/doc/namespace::ns"/>
  <xsl:attribute name="value">ns:something</xsl:attribute>
</example>

But it's probably simpler to create a dummy attribute in the required
namespace.

Mike Kay
Software AG


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]