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

RE: Walking through text with embedded tags

Subject: RE: Walking through text with embedded tags
From: "Bruce Kyle \(Volt\)" <a-bkyle@xxxxxxxxxxxxx>
Date: Wed, 19 May 2004 11:07:35 -0700
xslt embedded tags
Hello Ken and all,

Thanks so much for your answer, Ken. It led me to my issues.  I
discovered I had two issues. 

1) I wasn't letting the default template help me. This is a new idea to
me. I have always though of it as a pain point to prevent duplication of
text. 
2) I didn't have a template handling my root node <test> so I was
getting duplicate text. I incorrectly thought the duplicate text was
coming from my default template or lack of it.

This is the correct stylesheet to support my nested links.

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:msxsl="urn:schemas-microsoft-com:xslt">

<xsl:template match="/">
    <doc>
        <xsl:apply-templates />
    </doc>
</xsl:template>

<xsl:template match="test">
	<xsl:apply-templates />
</xsl:template>

<xsl:template match="c">
	<xsl:apply-templates />
</xsl:template>

<xsl:template match="a">
    <b><xsl:value-of select="@cref" /></b>
</xsl:template>

<xsl:template match="x">
    <b><xsl:value-of select="." /></b>
</xsl:template>

<xsl:template match="d"></xsl:template>

<xsl:template match="*|text()">
	<xsl:value-of select="." />
	<xsl:apply-templates />
</xsl:template>

</xsl:stylesheet>

Thanks so much for helping me understand the default template better.

bruce

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.