|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problems with XML with XSL displaying all Id in JSP
test.xml
<?xml version="1.0"?> <!DOCTYPE eSearchResult PUBLIC "-//NLM//DTD eSearchResult, 11 May 2002//EN" "http://www.ncbi.nlm.nih.gov/entrez/query/DTD/eSearch_020511.dtd"> <eSearchResult> <IdList> <Id>15368588</Id> <Id>15368480</Id> <Id>15368477</Id> </IdList> </eSearchResult> test.xsl <?xml version="1.0" encoding="ISO-8859-1"?> <!-- Edited with XML Spy v4.2 --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <h2>My CD Collection</h2> <table border="1"> <tr bgcolor="#9acd32"> <th align="left">ID</th> </tr> <xsl:for-each select="eSearchResult/IdList"> <tr> <td><xsl:value-of select="Id"/></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet> test.jsp <html> <body> <script type="text/javascript"> // Load XML var xml = new ActiveXObject("Microsoft.XMLDOM") xml.async = false xml.load("mesh.xml") // Load the XSL var xsl = new ActiveXObject("Microsoft.XMLDOM") xsl.async = false xsl.load("mesh.xsl") // Transform document.write(xml.transformNode(xsl)) </script> </body> </html> It only display one Id in test.jsp. How can I do in test.xml to display all Id like this? output.jsp <html> <body> <h2>My CD Collection</h2> <table border="1"> <tr bgcolor="#9acd32"> <th align="left">ID</th> </tr> <tr> <td>15368588</td> </tr> <tr> <td>15368480</td> </tr> <tr> <td>15368477</td> </tr> </table> </body> </html> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Problems with XML with XSL displaying all Id in JSP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|