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

newbie question

Subject: newbie question
From: Markus Jais <markusjais@xxxxxxxx>
Date: 24 Sep 2002 23:18:37 +0200
prey list
Hello

I have just started reading "beginning XSLT" from Wrox and I played
a little bit with the examples and tried them on my own xml files.

here is my xml file:


-------------
<?xml version="1.0"?>
<birds>
    <eagles>
        <species comment="seldom, in Germany only in the alpes">
            <english_name>Golden Eagle</english_name>
            <german_name>Steinadler</german_name>
            <prey>Birds, Mammals</prey>
        </species>
    </eagles>
    <falcons>
        <species comment="seldom">
            <english_name>Perigrine Falcon</english_name>
            <german_name>Wanderfalke</german_name>
            <prey>Birds</prey>
        </species>
    </falcons>
    <woodpeckers>
        <species comment="greatest woodpecker in Europe">
            <english_name>Black Woodpecker</english_name>
            <german_name>Schwarzspecht</german_name>
            <prey>insects, especially ants</prey>
        </species>
    </woodpeckers>
</birds>
-------------

and here is the xsl file:

---------------
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">

	<html>
	<body>
	
	<xsl:for-each select="/birds/eagles">
		  
	<xsl:value-of select = "." />
		<input type="text" name="bla" value="{comment}"/>
	</xsl:for-each>
	
	</body>
	</html>

</xsl:template>

</xsl:stylesheet>
----------------


I ran the example with xsltproc from libxslt 1.0.20 and with saxon 6.5.2
on RedHat 7.3


I get this output:

<html><body>

            Golden Eagle
            Steinadler
            Birds, Mammals

    <input type="text" name="bla" value="">
</body></html>



but I do not understand. why are the contents of the <english_name>,
<german_name> and <prey> printed and why is value="" ??

I thought that /birds/eagles would result in the species node.
and that "{comment}" would access the value of the "comment" attribute.

can anybody explain what is going on here ?

thanks
markus
















__________________________________________________________________

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Yahoo! präsentiert als offizieller Sponsor das Fußball-Highlight des
Jahres: - http://www.FIFAworldcup.com


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.