|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Re[2]: question about symbols in attribute value
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart


![RE: Re[2]: question about symbols in attribute value](/images/get_stylus.gif)





