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 (1168)
+ Stylus Studio Technical Forum (14398)
+ Website Feedback (244)
+ XSLT Help and Discussion (7588)
- XQuery Help and Discussion (1941)
-> + What path notation works when ... (6)
-> - Xquery Exception (1)
-> + [java] [Fatal Error] Test.xml:... (2)
-> + unable to produce correct XML ... (2)
-> + where can I find stylusxql uti... (3)
-> - Trouble Mapping Multiple Eleme... (3)
-> ->Trouble Mapping Multiple ...
-> ->Trouble Mapping Multiple ...
-> - input parameter (1)
-> - set element value (1)
-> + Xquery Performance Issue (21)
-> + Run Xquery Program using Java (2)
-> + XQuery XML to CSV (3)
-> + XQuery MySQL connector (4)
-> + XQuery with JDBC connection is... (2)
-> + Create FTP Server (2)
-> + XQuery Nested Loop Lookup (5)
-> + Xpath using a Variable for [@I... (2)
-> - My xqDoc option is disabled. (1)
-> + Xpath ancestor selection (4)
-> + Exception: sequence of more th... (2)
-> + XQUF usage (3)
-- [1-20] [21-40] [41-60] Next
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (363)
+ Stylus Studio Announcements (113)
Topic  
Postnext
breydon stangelandSubject: Trouble Mapping Multiple Elements to one unique Node Element
Author: breydon stangeland
Date: 18 Aug 2016 04:04 PM
Hi All,

I am currently working on mapping from one XML format to another and am running into some concerns.

I have a file which has unique elements for each value, however the goal format has one node with unique elements within it.

I have toyed around with different IF statements and don't seem to get the result I am looking for.

I keep getting all the values from the multiple elements piled into one element of the goal structure which doesn't give me the desired outcome.

example desired result

Source:
element1>123
element2>456
element3>789

Goal:
deduction>
element1
</deduction

deduction>
element2
</deduction
deduction>

element3
</deduction
----

What is currently happening.
Source:
element1>123
element2>456
element3>789

Goal:
deduction>
Element1Element2Element3
</deduction
--


Any assist or point in the right direction would be greatly appreciated.

Thanks!

Postnext
Ivan PedruzziSubject: Trouble Mapping Multiple Elements to one unique Node Element
Author: Ivan Pedruzzi
Date: 18 Aug 2016 04:14 PM

The example formatting is really clear.

Can you please attach XML files for source and desired output to a post?

Ivan Pedruzzi
Stylus Studio Team

Posttop
breydon stangelandSubject: Trouble Mapping Multiple Elements to one unique Node Element
Author: breydon stangeland
Date: 18 Aug 2016 04:54 PM
Thanks Ivan,

Sorry to bother you it, looks like I was creating a problem for myself by having the structure only be looking in a specific group other than any time this sub group was visible.

I solved it with.
for $invoice_item_group in $single_shipper_netout_invoice1//a:invoice_item_group

<deduction>
<type>
LOSS
</type>
<rate>
{
$invoice_item/a:invoice_rate_loss/text()
}
</rate>

It looks like that has solved it for me.
Thank you for offering your assistance.

All the best.
</deduction>

   
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.