xsl-list
[Top] [All Lists]

RE: missing output in XSLT 2.0

2005-03-27 10:51:23
I can't reproduce the problem.

Could you please post a complete stylesheet and source document, and the
expected output? The source XML you supplied doesn't have any data in it
that would account for the XMLSpy output shown.

If the files are too big and you can't produce a cut-down example, you can
send me the files direct.

Seems an appropriate problem to tackle on Easter Sunday: let there be light!

Michael Kay
http://www.saxonica.com/

 

-----Original Message-----
From: Jim_Albright(_at_)wycliffe(_dot_)org 
[mailto:Jim_Albright(_at_)wycliffe(_dot_)org] 
Sent: 27 March 2005 15:35
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] missing output in XSLT 2.0

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[(_at_)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[(_at_)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



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>