Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] Template/for-each/Firefox

From: Brett Zamir <brettz9@--------->
To:
Date: 9/1/2005 4:33:00 PM
Along the lines of the question of the difference between for-each and
apply-templates, when trying to transform, the following I get different
results from the subsequent stylesheets (the text after the embedded element
doesn't show up in the latter, even if I included another text() value-of
statement), and I don't know why.

I also don't know why I need to specify "/pars" in the last template as I
thought "pars" is already the root (if I don't do it, Firefox will not show
anything).

Also, I don't understand why in Firefox, refreshing the page does not always
accurately reflect the changes I've made...I have to sometimes close the tab
and start another one to see the changes. Some caching problem or?

I am also having trouble figuring out why call-template does not seem to
work for me (using it like apply-templates but for just one template).

thanks in advance,
Brett



<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<pars>
<par>The first part <embedded>comes before</embedded> the second part</par>
<par>The third part <embedded>also comes before</embedded> the fourth
part</par>
</pars>

-----------------------------------

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>

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

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

<xsl:template match="text()">
    <b><xsl:value-of select="."/></b>
</xsl:template>

</xsl:stylesheet>


-----------------------------------


<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>

<xsl:template match="/pars">
    <xsl:for-each select="par">
        <b><xsl:value-of select="text()"/></b>
        <b><xsl:value-of select="embedded"/></b>
    </xsl:for-each>
</xsl:template>

</xsl:stylesheet>


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent