Subject: RE: Re[2]: [xsl] question about symbols in attribute value From: Jarno.Elovirta@xxxxxxxxx Date: Tue, 11 Mar 2003 15:59:04 +0200 |
Hi, > I have data like this > > <data field_delim="0x250" line_delim="0x13,0x10"> > <field></field> > <field></field> > <data> > ..... > <data> > <data> > > I want to get text > field_value @field_delim field_value @field_delim > .....@line_delim ... > > if using example > > field_value0x250field_value0x250.....0x130x10...field_value0x2 > 50field_value0x250 <xsl:output method="text" /> <xsl:variable name="field_delim" select="/data/@field_delim" /> <xsl:variable name="line_delim" select="translate(/data/@line_delim, ',', '')" /> <xsl:template match="/"> <xsl:for-each select="data"> <xsl:apply-templates select="field" /> <xsl:apply-templates select="data" /> <xsl:apply-templates select="field" /> </xsl:for-each> </xsl:template> <xsl:template match="field"> <xsl:text>field_value</xsl:text> <xsl:value-of select="." /> <xsl:value-of select="$field_delim" /> </xsl:template> <xsl:template match="data"> <xsl:value-of select="normalize-space(.)" /> <xsl:value-of select="$line_delim" /> <xsl:text>...</xsl:text> </xsl:template> Will output what you specified above, though I don't know if it's what you want. Cheers, Jarno - Feindflug: In Gefangenschaft XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re[2]: [xsl] question about symbols, Andrey Solonchuk | Thread | Re[4]: [xsl] question about symbols, Andrey Solonchuk |
Re[2]: [xsl] question about symbols, Andrey Solonchuk | Date | Re[4]: [xsl] question about symbols, Andrey Solonchuk |
Month |