|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
nothing shows UP!! (frustration! help!!)
xsl file...
Code:
<?xml version ="1.0"?>
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0">
<xsl:template match ="/">
<p align="center">
<font color ="blue">
Piranha palace...
</font>
</p>
<xsl:for-each select="SUMMARY/PRODUCT">
<b>PRODUCT ID:</b><xsl:value-of select = "./@ID" /> <br/>
NAME: <xsl:value-of select ="@NAME"/> <br/>
PRICE PER UNIT : <xsl:value-of select = "@PRICE"/>
<br/><br/>
<xsl:for-each select = "ORDER">
<b>ORDER NUMBER: <xsl:value-of select ="@ID"/></b><br/>
SHIPPING ADDRESS: <xsl:value-of select ="SHIP_ADD"/>
TOTAL QUANTITY: <xsl:value-of select ="QUANTITY"/><br/>
ORDER VALUE:<xsl:value-of select = '(../@PRICE) * (QUANTITY)'/> <br/><br/>
</xsl:for-each>
<HR/>
<b>PRODUCT SALES VALUE: <xsl:value-of select = '(./@PRICE) * sum(./ORDER/QUANTITY)'/></b>
<br/>
<hr/>
<br/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
xml file.... Code:
<?xml version ="1.0"?> <SUMMARY> <PRODUCT ID = "P001" NAME = "Mini Bus" PRICE ="75"> <ORDER OID = "O001"> <SHIP_ADD>10 newstand</SHIP_ADD> <QUANTITY>30</QUANTITY> </ORDER> <ORDER OID = "O002"> <SHIP_ADD>101 oldstand</SHIP_ADD> <QUANTITY>10</QUANTITY> </ORDER> </PRODUCT> <PRODUCT ID = "P002" NAME = "Barbie Doll" PRICE ="20"> <ORDER OID = "O003"> <SHIP_ADD>103 news</SHIP_ADD> <QUANTITY>60</QUANTITY> </ORDER> </PRODUCT> </SUMMARY> all i get is "piranha palace..." that s it... nothing else.. i have checked and re checked and checked again for the past hour.. WHY WHY WHY doesnt anything show? please help. my hair is turning grey! |
|
#2
|
|||
|
|||
|
Ok i found your prob in about 2 seconds,
Ask your self this simple question, how does your XSL know what to format, is your XML linked to your XSL. The answer is it doesnt and no its not. Stop turning your hair grey, its an easy fix. Try this in your XML ok <?xml version="1.0" ?> <?xml-stylesheet type="text/xsl" href="yourXSL.xsl" ?> ![]() |
|
#3
|
|||
|
|||
|
Quote:
Just curious -- how would he have seen the 'Piranah palace...' text if he didn't have the XML and XSL linked? If he called the XSL file directly, shouldn't it have been displayed as XML? ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > nothing shows UP!! (frustration! help!!) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|