all groups > dotnet xml > july 2007 >
You're in the

dotnet xml

group:

Nothing is Getting display in the Browser


Nothing is Getting display in the Browser Samir1014
7/31/2007 7:24:01 PM
dotnet xml:
Dear Friends

Please look at the follwing XML and XSL file let me know. what i am doing
wrong. When i open the XML file in Browser it display blank page.

'----------------Product1,xsl
<?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>
<head>
</head>
<body>
<font face="arial">
<xsl:for-each select="PRODUCTDATA/PRODUCT">
<LI>
<xsl:text> Product ID : </xsl:text>
<font color="red"><xsl:value-of select="@PRODID"/>
</font>

<xsl:text>Product Name: </xsl:text>
<font color="red"><xsl:apply-templates select="PRODUCTNAME"/>
</font>

<xsl:text> Price Per unit (In U.S. $): </xsl:text>
<font color="red"><xsl:value-of select="PRICE"/>
</font>
</LI>
</xsl:for-each>

</font>
</body>
</html>
</xsl:template>
</xsl:stylesheet>


-----------------Prodcut1.xml

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="Prodcut1.xsl"?>
<PRODCUTDATA>
<PRODUCT PRODID="P001" CATEGORY="TOY">
<PRODCUTNAME>MINI BUS</PRODCUTNAME>
<DESCRIPTION> This is toy for childern aged 4 and above</DESCRIPTION>
<PRICE>75</PRICE>
<QUANTITY>54</QUANTITY>
</PRODUCT>
<PRODUCT PRODID="P002" CATEGORY="TOY">
<PRODCUTNAME>BARBIE DOLL</PRODCUTNAME>
<DESCRIPTION> This is toy for childern aged 4 and above</DESCRIPTION>
<PRICE>20</PRICE>
<QUANTITY>200</QUANTITY>
</PRODUCT>
</PRODCUTDATA>


Regards
Samir
Re: Nothing is Getting display in the Browser Martin Honnen
8/1/2007 2:35:50 PM
[quoted text, click to view]

I think it is simply a spelling issue, here you use

[quoted text, click to view]
^^^^^^^^^^^
PRODUCTDATA while your XML instance document has


[quoted text, click to view]
^^^^^^^^^^^^

PRODCUTDATA

So make sure you use the same spelling for element names in the XML
instance document and for element names in the stylesheet. The same
holds for any file names.

--

Martin Honnen --- MVP XML
Re: Nothing is Getting display in the Browser Samir1014
8/1/2007 7:32:02 PM
Thanks Martin

I guess i was drunk (could not able to notice such a silly mistake) , Thanks
once again

[quoted text, click to view]
AddThis Social Bookmark Button