Click to See Complete Forum and Search --> : [RESOLVED] XSL will not present element content?


webdev077
06-17-2007, 06:04 PM
Hello everyone:

I am learing to use XSL to present element's content in XML file.

The actural output I got is the source code in XML file. I expected to see 3 consecutive text llike Summer Chemistry 101.

I think problem lies in my XSL file. Please check my XSL file and give me some suggestion to correct this problem. Thanks!

code in XML file
<?xml version="1.0" encoding="utf-8"?>
<?xsl-stylesheet type="text/xsl" href="class_schedule.xsl"?>
<class_schedule>
<quarter>Summer</quarter>
<class_name>Chemistry</class_name>
<section_id>101</section_id>
</class_schedule>

code in XSl file

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>

webdev077
6-17-07

webdev077
06-17-2007, 06:38 PM
Hello:

I reviewed my code and found an typo in xml file:

<?xsl-stylesheet type="text/xsl" href="class_schedule.xsl"?>

xsl-stylesheet should be xml-stylesheet

webdev077