[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Copy one namespace, replace another

Subject: Copy one namespace, replace another
From: "Marc Franquesa" <marc.franquesa@xxxxxxxxx>
Date: Mon, 7 Aug 2006 15:23:38 +0200
xslt replace namespace
Hi, I'm trying to do something that probably is very easy, but I don't
get what I won't.

The source XML document is an XHTML page with the correct namespace,
and using default namespace (no prefix). In the source document there
are very few elements (three) in another namespace (my own
http://www.l3jane.net/doxpace/l3Build/) prefixed with l3b.

I 'm trying to develop a XSLT stylesheet that copies "as-is" the xhtml
elements and transform the
other (l3b namespace) elements. The result document _must_be_  XHTML or HTML.

I see this trickl to handle namespaces in XSLT (but I'm not sure that
works well):
http://www.forum4designers.com/message145552.html

So I write this a very simple stylesheet: with this rules:

<xsl:template match="xhtml:*" >
	<xsl:copy-of select="." />
</xsl:template>

<xsl:template match="l3b:moduleName" >
	<xsl:value-of select="$ModuleName" />
</xsl:template>

I belive that the problem is that the 'match="/"', copy the entire
tree without checking the namespace of the inner elements. But I don't
know how to make this in easy manner with few templates.

I tried using <xsl:apply-templates /> instead of copy-of, but then the
result document only has the PCDATA nodes, not the xhtml elements
structure.

I hope that I explain well what I'm trying to do.

Thanks for any hint!

--
"If you don't know where you're going,
any road will take you there" - Lewis Carroll
Visit http://www.l3jane.net/
Marc Franquesa
Vic - Catalonia
--------------------------------------------------------------

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.