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
Go to previous topicPrev TopicGo to next topicNext 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>

 
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.