|
[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
Subject: Re: transforming XML to XML with XSLT 1.0
From: "Mark Kersten" <markker83@xxxxxxxxxxx>
Date: Fri, 20 May 2005 16:16:14 +0200
|
Works fine !
What do I need to add when I get more then 1 <aid> from the database ? This
is mostly the case, and always a unknown number of AID's.
Mark K.
From: David Carlisle <davidc@xxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: transforming XML to XML with XSLT 1.0
Date: Fri, 20 May 2005 15:08:10 +0100
<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
| RSS 2.0 |
|
| Atom 0.3 |
|
|