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

missing output in XSLT 2.0

Subject: missing output in XSLT 2.0
From: Jim_Albright@xxxxxxxxxxxx
Date: Sun, 27 Mar 2005 09:35:20 -0500
xslt descendant example
Missing output in XSLT 2.0.


output of XMLSpy 2004  (XSLT 1.0 processor)

<?xml version="1.0" encoding="UTF-8"?>
<semantic-domains>
        <example-group>
                <example>'act of God'</example>
                <number>4.4.2.4</number>
        </example-group>
        <example-group>
                <example>'morning</example>
                <number>8.4.1.2</number>
        </example-group>
        <example-group>
                <example>'wing'</example>
                <number>2.2.3.2</number>
        </example-group>
        <example-group>
                <example>-'s</example>
                <number>8.1.6.1</number>
        </example-group>
...

output of Saxon 8.3 XSLT 2.0 processor

<?xml version="1.0" encoding="UTF-8"?>
<semantic-domains/>

XSLT:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
        <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="
yes"/>
        <xsl:template match="semantic-domains">
                <semantic-domains>
                        <xsl:for-each select="
descendant::example[@lang='en']">
                                <xsl:sort select="." data-type="text" 
order="ascending"/>
                                <example-group>
                                        <example>
                                                <xsl:value-of select="."/>
                                        </example>
                                        <number>
                                                <xsl:value-of select="
preceding::number[1]"/>
                                        </number>
                                </example-group>
                        </xsl:for-each>
                </semantic-domains>
        </xsl:template>
</xsl:stylesheet>

I have found that changing
                        <xsl:for-each select="
descendant::example[@lang='en']">
to
                        <xsl:for-each select="descendant::example">
allows for there to be some output.
In XMLSpy using the evaluate XPath, I get the same selections in 1.0 and 
2.0 Beta.
input
<?xml version="1.0" encoding="UTF-8"?>
<semantic-domains>
        <domain>
                <number id="x-1">1</number>
                <name lang="en">The physical universe</name>
                <cross-reference type="parent" ref="x-0"/>
                <cross-reference type="child" ref="x-1.1">Sky</
cross-reference>
                <cross-reference type="child" ref="x-1.2">World</
cross-reference>
                <cross-reference type="child" ref="x-1.3">Water</
cross-reference>
                <cross-reference type="child" ref="x-1.4">Living things</
cross-reference>
                <cross-reference type="child" ref="x-1.5">Plant</
cross-reference>
                <cross-reference type="child" ref="x-1.6">Animal</
cross-reference>
                <cross-reference type="child" ref="x-1.7">Nature, 
environment</cross-reference>
                <description lang="en">Use this domain for general words 
referring to the physical universe. Some languages may not have a single 
word for the universe and may have to use a phrase such as 'rain, soil, 
and things of the sky' or 'sky, land, and water' or a descriptive phrase 
such as 'everything you can see' or 'everything that exists'.</description
>
                <question-group>
                        <question lang="en">What words refer to everything 
we can see?</question>
                        <example-group>
                                <example lang="en">universe</example>
                                <example lang="en">heaven and earth</
example>
                                <example lang="en">(all) creation</example
>
                                <example lang="en">cosmos</example>
                                <example lang="en">macrocosm</example>
                                <example lang="en">everything that exists
</example>
                        </example-group>
                        <exampleSentence lang="en">In the beginning God 
created <examplar>the heavens and the earth</examplar>.</exampleSentence>
                </question-group>
                <question-group>
                        <question lang="en">What words describe something 
that happens in nature?</question>
                        <example-group>
                                <example lang="en">natural phenomenon</
example>
                        </example-group>
                </question-group>
                <question-group>
                        <question lang="en">What words refer to the study 
of the physical universe?</question>
                        <example-group>
                                <example lang="en">science</example>
                                <example lang="en">natural science</
example>
                                <example lang="en">physical science</
example>
                                <example lang="en">physics</example>
                                <example lang="en">astronomy</example>
                                <example lang="en">chemistry</example>
                                <example lang="en">biology</example>
                                <example lang="en">ecology</example>
                        </example-group>
                </question-group>
        </domain>
....

Jim Albright
704 843-0582
Wycliffe Bible Translators

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.