Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XML data not displayed with XSL

843834Aug 29 2001 — edited Aug 29 2001
I have just started learning XML so bear with me. I have a xml document that I created and want to use a stylesheet to display it in html but it doesn't seem to be working. Here is the xml file:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="XSL\myXSL.xsl" type="text/xsl"?>
<GstBk:Book xmlns:GstBk="http://www.testurl.com">
<GstBk:Guest>
<GstBk:Address>
<GstBk:Name>John Doe</GstBk:Name><GstBk:From>Anywhere USA</GstBk:From>
</GstBk:Address>
</GstBk:Guest>
</GstBk:Book>

And here is the xsl document:

<?xml version="1.0"?>

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

<xsl:template match="GstBk:Book">
<html>
<head>
<title>Guest Book</title>
</head>
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>

<xsl:template match="GstBk:Guest">
Name = <xsl:value-of select="GstBk:Name" />
</xsl:template>

</xsl:stylesheet>

But the only data I get on the browser is:

Name =

Can anyone see something wrong with my files? I have downloaded examples from the net and they seem to work. I even compared them to my files and can't see anything obviously different. Any ideas?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 26 2001
Added on Aug 29 2001
3 comments
240 views