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

Re: XHTML to XHTML transform

Subject: Re: XHTML to XHTML transform
From: Robert Koberg <rob@xxxxxxxxxx>
Date: Fri, 02 Apr 2004 17:58:36 -0800
xsl xhtml
This thread seems very strange... Or perhaps the subject line is simply wrong. No one seems to be talking about XHTML (it requires lowercase tags...). I provided a relatively complete answer to the problem but people (and the original poster) seem to be trying to make it more difficult than it is. I don't get it...

-Rob


-----Original Message-----
From: Jeffrey Moss [mailto:jeff@xxxxxxxxxxxx] Sent: 02 April 2004 21:55
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: XHTML to XHTML transform


How do I match text nodes in my custom namespace? As in override the default
text node template for "mynamespace"?


All my variables <mynamespace:name>blah</mynamespace:name> for instance
appear as text in the results, I've tried this:


<xsl:template match="text()[namespace-uri()='mynamespace:namespace']">
</xsl:template>

but that doesn't work... I ended up changing all the elements I want hidden
under all circumstances to the mynamespace-var namespace...


<xsl:template match="*[namespace-uri()='mynamespace-var:namespace']">
</xsl:template>

This works, but I think its messy, I was wondering if there was a better
way? I'm pasting my code below.


Thanks,

-Jeff



<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:nbn="nbn:namespace"
 xmlns:nbn-run="nbn-run:namespace"
 xmlns:nbn-var="nbn-var:namespace"
 exclude-result-prefixes="nbn nbn-run nbn-var">
<xsl:param name="controller" select="'index.php'"/>
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>

<xsl:template match="/sitemap">
 <DIV CLASS="navtree">
   <xsl:apply-templates />
 </DIV>
</xsl:template>

<xsl:template match="*[not(namespace-uri())]">
 <xsl:copy>
   <xsl:apply-templates />
 </xsl:copy>
</xsl:template>

<xsl:template match="text()">
</xsl:template>

<xsl:template match="*[namespace-uri()='nbn-var:namespace']">
</xsl:template>

<xsl:template match="nbn:link">
<xsl:element name="A">
<xsl:attribute name="HREF">/<xsl:value-of
select="$controller"/>/module/<xsl:value-of
select="nbn-var:location/nbn-var:module" />/action/<xsl:value-of
select="nbn-var:location/nbn-var:action" />/</xsl:attribute>
<xsl:attribute name="ID"><xsl:value-of select="@id"/></xsl:attribute>
<xsl:attribute name="CLASS">menuitem</xsl:attribute>
<xsl:value-of select="@name"/>
</xsl:element>
<xsl:apply-templates />
<BR/>
<xsl:if test="link">
<xsl:element name="DIV">
<xsl:attribute name="CLASS">submenu</xsl:attribute>
<xsl:apply-templates select="link"/>
</xsl:element>
</xsl:if>
</xsl:template>


</xsl:stylesheet>

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.