XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Nacho PistachoSubject: Table aggroupament
Author: Nacho Pistacho
Date: 21 Jun 2007 06:14 AM
Hello

I have to do this transform :

"ORGINAL XML"

<root>
<AAA>
<DATA1>BLABLA</DATA1>
<DATA2>BLABLA</DATA2>
</AAA>
<AAA>
<DATA1>BLEBLE</DATA1>
<DATA2>BLEBLE</DATA2>
</AAA>
<CCC>ASDF</CCC>
...
...
<BBB>
<DDD>VALUE</DDD>
<EEE>
<DATA1>VALUE1</DATA1>
<DATA2>VALUE2</DATA2>
</EEE>
<EEE>
<DATA1>VALUE3</DATA1>
<DATA2>VALUE4</DATA2>
</EEE>
</BBB>
</root>

"DESIRED TRANSFORM"

<root>
<AAA>
<!-- Here comes the changes -->
<rowAAA rownum="1">
<DATA1>BLABLA</DATA1>
<DATA2>BLABLA</DATA2>
</rowAAA>
</AAA>
<AAA>
<rowAAA rownum="2">
<DATA1>BLEBLE</DATA1>
<DATA2>BLEBLE</DATA2>
</rowAAA>
</AAA>
<CCC>ASDF</CCC>
...
...
<BBB>
<DDD>VALUE</DDD>
<EEE>
<rowEEE rownum="1">
<DATA1>VALUE1</DATA1>
<DATA2>VALUE2</DATA2>
</rowEEE>
</EEE>
<EEE>
<rowEEE rownum="2">
<DATA1>VALUE3</DATA1>
<DATA2>VALUE4</DATA2>
</rowEEE>
</EEE>
</BBB>
</root>

So, i need to identify sibling nodes with the same tagname and put it into a table with different "rownumber" for each one.
In the entry, if there are any table, comes continuous

Any help are welcome,

Thanks!!

Posttop
(Deleted User) Subject: Table aggroupament
Author: (Deleted User)
Date: 26 Jun 2007 06:24 AM
If all you need is retrieve the value for the rownumber attribute, you can use count(preceding-sibling::AAA)+1

Hope this helps,
Alberto

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.