[xsl] XML-transformation - Problem

Subject: [xsl] XML-transformation - Problem
From: amit jain <amit_j@xxxxxxx>
Date: 28 Dec 00 05:19:26 EST
Hi Gurus,

I am a starter and using xml-spy for transformation. I have a basic problem

I have a xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<Book>
<title>My First XML</title>
<author>Amit</author>
<publisher>
<publisher1>Tata Mac</publisher1>
<publisher2>EEE</publisher2>
</publisher>
</Book>

and my xsl file is as follows

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- edited with XML Spy v2.5.1 NT - http://www.xmlspy.com -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl";>
<!--XSL Stylesheet for generating simple Orgchart-->


<xsl:template match="/">

<HTML>
<BODY>
<b><xsl:value-of select="Book/title"></xsl:value-of> </b>
<b><xsl:value-of select="Book/author"></xsl:value-of> </b>
</BODY>
</HTML>


</xsl:template>

</xsl:stylesheet>

when i do the xslt transformation(f10 in xml-spy)
IT GENERATES THE HTML (works fine)

BUT IF IF I MATCH ANYTHING OTHER THEN "/" AS SHOWN BELOW 


<?xml version="1.0" encoding=3D"ISO-8859-1"?>
<!-- edited with XML Spy v2.5.1 NT - http://www.xmlspy.com -->
<xsl:stylesheet xmlns:xsl=3D"http://www.w3.org/TR/WD-xsl";>
<!--XSL Stylesheet for generating simple Orgchart-->

<xsl:template match="Book">
<HTML><BODY><xsl:apply-templates/></BODY></HTML>
</xsl:template>

<xsl:template match="title">
<b><xsl:apply-templates/></b>
</xsl:template>

<xsl:template match="author">
<b><xsl:apply-templates/></b>
</xsl:template>

</xsl:stylesheet>

it shows me a blank html page means does not work and i have no clue, also how
do i compare a value using if
i mean if <author> is null in xml i don't want to display it in html.
Shall i use some other xslt processor


any help and a direct mail will be highly appreciated





____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

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


Current Thread