Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: XSL Transformation Problem XSL Transformation ProblemTo: NULL Date: 1/5/2006 5:16:00 AM Hi All, I want to make a csv out of an xml file. The XML file's structure is: <MatchDataset> <BlockDataset> <Block>A.3</Block> <CategoryDataset> <Category>2</Category> <RowDataset> <Row>26</Row> <SeatDataset> <SeatNo>1</SeatNo> </SeatDataset> <SeatDataset> <SeatNo>2</SeatNo> </SeatDataset> <MatchDataset> and I want to put it into a csv file: Block;Row;Category;SeatNo A block can have one or more row that can be of different categories and each row can have one or more seats. I wrote an XSL file, but it gives me only one row in the csv file!! Here is the code: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs xsi"> <xsl:output method="xml" encoding="UTF-8" indent="yes" doctype-system="C:/DOKUME~1/tnuccio/EIGENE~1/test/result.dtd"/> <xsl:template match="/MatchDataset"> <Eintrag> <xsl:for-each select="BlockDataset"> <xsl:for-each select="Block"> <xsl:attribute name="block"> <xsl:value-of select="."/> </xsl:attribute> </xsl:for-each> </xsl:for-each> <xsl:for-each select="BlockDataset"> <xsl:for-each select="CategoryDataset"> <xsl:for-each select="Category"> <xsl:attribute name="kat"> <xsl:value-of select="."/> </xsl:attribute> </xsl:for-each> </xsl:for-each> </xsl:for-each> <xsl:for-each select="BlockDataset"> <xsl:for-each select="CategoryDataset"> <xsl:for-each select="RowDataset"> <xsl:for-each select="Row"> <xsl:attribute name="row"> <xsl:value-of select="."/> </xsl:attribute> </xsl:for-each> </xsl:for-each> </xsl:for-each> </xsl:for-each> <xsl:for-each select="BlockDataset"> <xsl:for-each select="CategoryDataset"> <xsl:for-each select="RowDataset"> <xsl:for-each select="SeatDataset"> <xsl:for-each select="SeatNo"> <xsl:attribute name="seatno"> <xsl:value-of select="."/> </xsl:attribute> </xsl:for-each> </xsl:for-each> </xsl:for-each> </xsl:for-each> </xsl:for-each> </Eintrag> </xsl:template> </xsl:stylesheet> --- Can anybody explain why onle one row is written? Thanks in advance, Mel | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
