xsl-list
[Top] [All Lists]

transforming XML to XML with XSLT 1.0

2005-05-20 06:53:51
Hi all,

I've got the following problem:

I need to transform data I get from a database in an XML document, to another better formed XML document.

This is the xml that I get from the database:

<oda>
<Row AID="CD46" GROUP_TYPE="08" GROUP_VERSION="A" TIMEOUT="2" SHORT_MESSAGE="0066" PORT_NR="1" ACCESS_RIGHT="0" /> <Row AID="CD46" GROUP_TYPE="08" GROUP_VERSION="A" TIMEOUT="2" SHORT_MESSAGE="0066" PORT_NR="2" ACCESS_RIGHT="0" /> <Row AID="CD46" GROUP_TYPE="08" GROUP_VERSION="A" TIMEOUT="2" SHORT_MESSAGE="6280" PORT_NR="3" ACCESS_RIGHT="1" />
</oda>

And this is how it has to look like after the XSLT transformation:

<oda>
 <aid>CD46</aid>
<group>
 <type>08</type>
 <version>A</version>
 </group>
 <timeout>2</timeout>
 <shortmessage>0066</shortmessage>
 <shortmessage>6280</shortmessage>
<odaaccessrights>
<portaccess>
 <number>1</number>
 <enabled>0</enabled>
 </portaccess>
<portaccess>
 <number>2</number>
 <enabled>0</enabled>
 </portaccess>
<portaccess>
 <number>3</number>
 <enabled>1</enabled>
 </portaccess>
 </odaaccessrights>
</oda>

I've tried numerous solutions also listed on http://gandhimukul.tripod.com/grouping.html but I can't get any to work properly.



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>