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
Conferences Close Tree View
- Stylus Studio Feature Requests (1192)
-> - Proposal to Add Git Support to... (1)
-> + XML formatter option request (3)
-> - Could Pipeline input scenario ... (1)
-> + XML Traversal in XSLT Mapper (2)
-> + Email not in HTML as expected (3)
-> + My SS Open [tools]==>.[option... (3)
-> + Fonts in Stylus Studio (2)
-> - Fix the check for concurrent s... (1)
-> + Stylus is showing the error fo... (2)
-> - XML editor (1)
-> + Unable to see filename in sche... (2)
-> + Unable to connect to JVM (2)
-> - Stylus Studio forum questions (1)
-> + User Interface - X16 Enterpris... (2)
-> + Stylus Studio High DPI support (2)
-> + target xsd includes and import... (2)
-> + XML/EDIFACT Schema (3)
-> + Options to control whether BOM... (2)
-> + Snippets and/or Emmet integrat... (2)
-> + internal error accessing metho... (2)
-- [1-20] [21-40] [41-60] Next
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Julio de la VegaSubject: Problems defining my parent and child elements
Author: Julio de la Vega
Date: 05 Jul 2007 05:26 AM
Originally Posted: 05 Jul 2007 04:11 AM
Hi *,

It is the first time that I use Stylus. I have a little question. Please let me show you my scenario:

In my company structure, every customer has 3 records with their data:

RECORDID1Field1Field2Filed3
RECORDID2Field1Field2
RECORDID3Field1Field2Filed3

This structure is repeated for every customer that I have. Imagine that I have 3 customer so my real input data is:

RECORDID1Field1Field2Filed3
RECORDID2Field1Field2
RECORDID3Field1Field2Filed3
RECORDID1Field1Field2Filed3
RECORDID2Field1Field2
RECORDID3Field1Field2Filed3
RECORDID1Field1Field2Filed3
RECORDID2Field1Field2
RECORDID3Field1Field2Filed3


I need to convert this information to this xml output:

<root>
<customer>
<RECORDID1>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
<Field3>zzz</Field3>
</RECORDID1>
<RECORDID2>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
</RECORDID2>
<RECORDID3>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
<Field3>zzz</Field3>
</RECORDID3>
</customer>
<customer>
<RECORDID1>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
<Field3>zzz</Field3>
</RECORDID1>
<RECORDID2>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
</RECORDID2>
<RECORDID3>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
<Field3>zzz</Field3>
</RECORDID3>
</customer>
<customer>
<RECORDID1>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
<Field3>zzz</Field3>
</RECORDID1>
<RECORDID2>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
</RECORDID2>
<RECORDID3>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
<Field3>zzz</Field3>
</RECORDID3>
</customer>
</root>


Instead of the correct output, my wrong result is being this one:

<root>
<customer>
<RECORDID1>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
<Field3>zzz</Field3>
</RECORDID1>
<RECORDID2>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
</RECORDID2>
<RECORDID3>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
<Field3>zzz</Field3>
</RECORDID3>
<RECORDID1>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
<Field3>zzz</Field3>
</RECORDID1>
<RECORDID2>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
</RECORDID2>
<RECORDID3>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
<Field3>zzz</Field3>
</RECORDID3>
<RECORDID1>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
<Field3>zzz</Field3>
</RECORDID1>
<RECORDID2>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
</RECORDID2>
<RECORDID3>
<Field1>xxx</Field1>
<Field2>yyy</Field2>
<Field3>zzz</Field3>
</RECORDID3>
</customer>
</root>


I am mixing information from different customer. How could I separate information from different customers? How can I set up the product to tell it when a different customer starts in a different node? How can I set up my parent and childs when I work with fixed width length files and parent and childs are in different lines?


Thanks in advace

Regards

Julio

Posttop
Tony LavinioSubject: Problems defining my parent and child elements
Author: Tony Lavinio
Date: 05 Jul 2007 11:38 AM
(Since this was also asked via email, the resolution was mailed directly.)

   
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.