|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hey folks,
I have the following simple xml document called myxml.xml <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="test.xsl"?> <RegionInfo> <Region> <RegionName>Northeast</RegionName> <Area> <AreaID>AR000</AreaID> </Area> </Region> <Region><RegionName>EastCentral</RegionName> <Area> <AreaID>AR120</AreaID> </Area> </Region> </RegionInfo> test.xsl looks like this: <?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> <body> <h2>Region Info</h2> <table border="1"> <tr bgcolor="#9acd32"> <th>Region</th> </tr> <xsl:for-each select="RegionInfo/Region"> <tr> <td><xsl:value-of select="RegionName"/></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet> Now, when I open the XML file in a browser, I should be getting the two region names as rows of a table. But, I only get the table heading and not the region names. When I try this on my co-workers' machine, it works fine. I am running I.E 6.0 and I have MSXML4.0 SP2 Parser and SDK installed on my machine. Please help!!!!!!!!!!!!!!!!!!!!! |
|
#2
|
|||
|
|||
|
Hi,
I could see nothing wrong with your files. I tested them on my own computer, and they worked fine. I got a nice little table with a green header row and two cells with region names. I am running Explorer 5.0 and MSXML. I have also downloaded the MSXML-validation tools which allow you to see the xsl-output passed to the browser. I find that very useful when testing for errors. This is the output from your files - and as far as I can see, it is a neat little table. It could of course have something to do with explorer 6, but I can't imagine what it would have against this code: output: <html> <body> <h2>Region Info</h2> <table border="1"> <tr bgcolor="#9acd32"> <th>Region</th> </tr> <tr> <td>Northeast</td> </tr> <tr> <td>EastCentral</td> </tr> </table> </body> </html> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > XML/XSL Question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|