|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
node contain multiple children in same sequence
Hi
Can anyone help me with this pls ------------------------------------------- My xml <PublicationList> <Title> title1 </Title> <Author>author1 </Author> <Title> title2 </Title> <Author>author2 </Author> <Title> title3 </Title> <Author>author3 </Author> <Title> title4 </Title> <Author>author4 </Author> </PublicationList> --------------------------------------------- and output shoud be title1 - author1 title2 - author2 title3 - author3 title4 - author4 ------------------------------------- pls can anyone help me with this if I use <xsl:appy templates select=”Title”/> I get title1 title2 title3 title4 and <xsl:appy templates select=”Author”/> author1 author2 author3 author4 in separate sets but I want title1 - author1 title2 - author2 title3 - author3 title4 - author4 this format… it may be very easy but being beginner I don’t know how to do that…so any help would be appreciated thank u with regards niha |
|
#2
|
|||
|
|||
|
It will be easier to group your data in output if you wrap it on the input. Check out this modified XML:
<PublicationList> <book> <Title> title1 </Title> <Author>author1 </Author> </book> <book> <Title> title2 </Title> <Author>author2 </Author> </book> <book> <Title> title3 </Title> <Author>author3 </Author> </book> <book> <Title> title4 </Title> <Author>author4 </Author> </book> </PublicationList> Then you can write this XSL for output to HTML: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl utput method="html"/><xsl:template match="PublicationList"> <html> <body> <xsl:apply-templates/> </body> </html> </xsl:template> <xsl:template match="book"> <p> <xsl:apply-templates/> </p> </xsl:template> <xsl:template match="Title"> <xsl:value-of select="."/> </xsl:template> <xsl:template match="Author"> <xsl:text> - </xsl:text> <xsl:value-of select="."/> </xsl:template> </xsl:stylesheet> Which will give you this output: <html> <body> <p> title1 - author1 </p> <p> title2 - author2 </p> <p> title3 - author3 </p> <p> title4 - author4 </p> </body> </html> If you are looking for a modification of this process let me know. Enjoy! Chinnman!! |
|
#3
|
|||
|
|||
|
thank u chinnman
hi
thank u chinnman i will look into that. if i have any probs i sure will come back to u thank u ever so much with regards niha |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > node contain multiple children in same sequence |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|