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

Re: xmlns="" / XML to XHTML

Subject: Re: xmlns="" / XML to XHTML
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Mon, 12 Sep 2005 21:18:48 +0200
Re:  xmlns="" / XML to XHTML
Hi,

Tempore 20:39:29, die 09/12/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Alexander Nichau <ml@xxxxxxxxxx>:

IB4m having a real confusing problem and I hope anyone can help me;
IB4m using a system which takes valid XHTML input done by the user and
puts it out together with meta information and other stuff in a XML set.

The problem is that you do not understand namespaces. I'll leave it up to the guru's of this list to provide theoretical answers. I'll give this practical answer:


<xsl:template name="content_xhtml">
  <xsl:param name="content" select="/page/content/topic"/>
  <xsl:apply-templates select="$content/text/*" mode="put_in_new_namespace">
	<xsl:with-param name="new_namespace">http://www.w3.org/1999/xhtml</xsl:with-param>
  </xsl:apply-templates>
</xsl:template>

<xsl:template match="*" mode="put_in_new_namespace" priority="1">
<xsl:param name="new_namespace"/>
<xsl:element name="{local-name()}" namespace="{$new_namespace}">
	<xsl:copy-of select="@*"/>
	<xsl:apply-templates select="node()" mode="put_in_new_namespace">
		<xsl:with-param name="new_namespace" select="$new_namespace"/>
	</xsl:apply-templates>
</xsl:element>
</xsl:template>

<xsl:template match="node()" mode="put_in_new_namespace">
	<xsl:copy-of select="."/>
</xsl:template>


regards, -- Joris Gillis (http://users.telenet.be/root-jg/me.html) Laudeo W3C et dona ferens

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-2013 All Rights Reserved.