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)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
- XQuery Help and Discussion (2016)
-> - Issue with Processing Instruct... (1)
-> + problem converting json to XML... (2)
-> + Problem base64 decoding string... (3)
-> + Problems posting multipart for... (5)
-> + trouble with download of price... (2)
-> + Problem with http-post not bei... (3)
-> + path problem, xps_file:writeAl... (9)
-> + Xquery update support? (2)
-> + problem with Stylus studio try... (5)
-> + adding dtd reference to xml ou... (4)
-> + xquery escaping ambarsand when... (3)
-> + Whitespace problem when return... (5)
-> + Problem with namespace prefix ... (5)
-> - Sending via SFTP returns unexp... (1)
-> + Query and Sftp clent (4)
-> + xquery and try - catch (3)
-> + Query + ddtek:http-post optio... (5)
-> + Example files referenced in do... (3)
-> + Automatic Error Detection and ... (3)
-> + Working with result of ddtek:h... (2)
-- [1-20] [21-40] [41-60] Next
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ 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.