S
Stefan Siegl
Hello,
I am trying to learn XSLT to use it in another project. I start reading
the book "Java and XSLT" and tried the examples and they are went quite
fine (how suprising *g*).
Then I tried to adopt these examples to my files. Unfortunately I did
not work even though the styleSheet is very simple. Perhaps you can help
me with it.
Here is the XML file is try to transform:
-----------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<citywalk
xsi:schemaLocation="http://demo.heywow.com/schema/citywalk/v0004/citywalk
http://demo.heywow.com/schema/citywalk/v0004/citywalk.xsd"
xmlns="http://demo.heywow.com/schema/citywalk/v0004/citywalk"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<destinationEntity>
<userId>Landsberg</userId>
</destinationEntity>
<insert>
<CTarget Id="LandsbergTarget01"
packagePath="dlr.tourGuide.tourGuideContent.">
<elementInfo>
<city>Landsberg</city>
<name>Rathaus</name>
<description xml:lang="DE">(1) some text</description>
<mapref mapId="LandsbergMap1-0" fromLeft="20" fromTop="10" />
</elementInfo>
</CTarget>
[I simplified this! there are a lot of CTarget elements here]
</insert>
</citywalk>
----------------------------------------
And here is the sylesheet I tried to use:
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="html" />
<xsl:template match="/">
<html>
<head>
<title> Just a test </title>
</head>
<body>
<h1> start of body </h1>
<xsl:apply-templates select="citywalk/destinationEntity"/>
<h1> end of body</h1>
</body>
</html>
</xsl:template>
<xsl:template match="destinationEntity">
<h2>inside destination</h2>
</xsl:template>
</xsl:stylesheet>
-------------------------------------
When transforming the xml file using this stylesheet the
<xsl:apply-templates ...> inside the body is not executed.
Can you see my error?
Thanks in advance,
Stefan Siegl
I am trying to learn XSLT to use it in another project. I start reading
the book "Java and XSLT" and tried the examples and they are went quite
fine (how suprising *g*).
Then I tried to adopt these examples to my files. Unfortunately I did
not work even though the styleSheet is very simple. Perhaps you can help
me with it.
Here is the XML file is try to transform:
-----------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<citywalk
xsi:schemaLocation="http://demo.heywow.com/schema/citywalk/v0004/citywalk
http://demo.heywow.com/schema/citywalk/v0004/citywalk.xsd"
xmlns="http://demo.heywow.com/schema/citywalk/v0004/citywalk"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<destinationEntity>
<userId>Landsberg</userId>
</destinationEntity>
<insert>
<CTarget Id="LandsbergTarget01"
packagePath="dlr.tourGuide.tourGuideContent.">
<elementInfo>
<city>Landsberg</city>
<name>Rathaus</name>
<description xml:lang="DE">(1) some text</description>
<mapref mapId="LandsbergMap1-0" fromLeft="20" fromTop="10" />
</elementInfo>
</CTarget>
[I simplified this! there are a lot of CTarget elements here]
</insert>
</citywalk>
----------------------------------------
And here is the sylesheet I tried to use:
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="html" />
<xsl:template match="/">
<html>
<head>
<title> Just a test </title>
</head>
<body>
<h1> start of body </h1>
<xsl:apply-templates select="citywalk/destinationEntity"/>
<h1> end of body</h1>
</body>
</html>
</xsl:template>
<xsl:template match="destinationEntity">
<h2>inside destination</h2>
</xsl:template>
</xsl:stylesheet>
-------------------------------------
When transforming the xml file using this stylesheet the
<xsl:apply-templates ...> inside the body is not executed.
Can you see my error?
Thanks in advance,
Stefan Siegl