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

xsl:apply-templates doesn't fill variable correctly

Subject: xsl:apply-templates doesn't fill variable correctly
From: "Lensch, Thomas" <Lensch@xxxxxxxx>
Date: Mon, 1 Aug 2005 10:49:05 +0200
xsl variable applytemplates
Hi,

the following snipet shows the usage of variable tHtml:

When i find a 'fussnote' in my xml i apply templates into tHtml. Then,
this variable is processed further.


    <xsl:template match="*">
	...
			<xsl:when test="name()='fussnote'">
				<xsl:variable name="tHtml">
					<xsl:apply-templates
select="text()|*"/>
				</xsl:variable>
				<!-- Pos_1 -->
				<xsl:variable name="ttHtml">
					<xsl:apply-templates
select="xalan:nodeset($tHtml)" mode="escape"/>
				</xsl:variable>
				.... further processing and output of
$ttHtml
			</xsl:when>

    <!-- Process Attributes -->
    <xsl:template match="@*">
        <xsl:choose>
			<xsl:when test="name()='href'">
                <xsl:choose>
                    <xsl:when test="starts-with(.,'#')">
                        <xsl:attribute name="href">
                            <xsl:call-template name="VerityLink">
                                <xsl:with-param name="price"
select="'0.0'"/>
                                <xsl:with-param name="part"
select="/*/parameter/doc.part"/>
                            </xsl:call-template>
                            <xsl:value-of select="."/>
                        </xsl:attribute>
                    </xsl:when>
                    <xsl:otherwise>
				....



Excerpts of my XML file:
a)
	<fussnote nr="13">
          <a href="#rd_200">Dazu Rn. 200</a>.</fussnote>

b)
	<fussnote nr="71">
          <a href="#rd_103">Dazu Rn. 103</a>.</fussnote>

While a) works b) doesn't. In b) only the "." ist output.

When i use apply-templates without putting the result in a variable, b)
works too!

Does anybody have some hints for me? Possible problem of recursion on
variable content?

Best regards
Thomas.

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.