|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: transforming XML to XML with XSLT 1.0
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output indent="yes"/>
<xsl:key name="sm" match="Row" use="@SHORT_MESSAGE"/>
<xsl:template match="oda">
<oda>
<aid><xsl:value-of select="Row[1]/@AID"/></aid>
<group>
<type><xsl:value-of select="Row[1]/@GROUP_TYPE"/></type>
<version><xsl:value-of select="Row[1]/@GROUP_VERSION"/></version>
</group>
<timeout><xsl:value-of select="Row[1]/@TIMEOUT"/></timeout>
<xsl:for-each select="Row[generate-id()=generate-id(key('sm',@SHORT_MESSAGE))]">
<shortmessage><xsl:value-of select="@SHORT_MESSAGE"/></shortmessage>
</xsl:for-each>
<odaaccessrights>
<xsl:for-each select="Row">
<number><xsl:value-of select="position()"/></number>
<enabled><xsl:value-of select="@ACCESS_RIGHT"/></enabled>
</xsl:for-each>
</odaaccessrights>
</oda>
</xsl:template>
</xsl:stylesheet>
$ saxon oda.xml oda.xsl
<?xml version="1.0" encoding="utf-8"?>
<oda>
<aid>CD46</aid>
<group>
<type>08</type>
<version>A</version>
</group>
<timeout>2</timeout>
<shortmessage>0066</shortmessage>
<shortmessage>6280</shortmessage>
<odaaccessrights>
<number>1</number>
<enabled>0</enabled>
<number>2</number>
<enabled>0</enabled>
<number>3</number>
<enabled>1</enabled>
</odaaccessrights>
</oda>
________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
|
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








