xsl-list
[Top] [All Lists]

RE: pulling a document with a null namespace into a namespace

2003-08-10 09:17:44
Write a stylesheet containing the following template rule:

<xsl:template match="*">
<xsl:element name="w:{local-name()}" namespace="http://wibble.com/ns";>
  <xsl:copy-of select="@*"/>
  <xsl:apply-templates/>
</xsl:element>
</xsl:template>

Michael Kay

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Michael Clark
Sent: 08 August 2003 17:16
To: XSL List (XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com)
Subject: [xsl] pulling a document with a null namespace into 
a namespace


I've tried, I really have, but I can't come up with a 
solution to this.

Given some document with unknown elements (i.e., I can't 
enumerate the elements inside the stylesheet for special 
processing) in a null namespace:

<random>
      <elements baz="foo">qux</elements>
</random>

Can I use XSLT to process this document and move it into a namespace:

<w:random xmlns:w="http://wibble.com/ns";>
      <w:elements baz="foo">qux</elements>
</w:random>

Thanks for reading!

Michael

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



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