|
Rank: Newbie
Joined: 7/16/2015 Posts: 2 Location: Louisiana
|
Greetings, I am trying mapforce for the first time, and learning it's capabilities.
I have an xml that has a similar schema as this:
<root> <child1>23</child1> <child2> <data1>test1</data1> <data2>test2</data2> </child2> </root>
What I need to get is the XML snippet of <child2>.
I am using a CSV style output and want to have the following output child1, child2 23,"<child2><data1>test1</data1></data2>test2</data2></child2>"
How do I get that via mapforce?
Thank you.
|
|
Rank: Newbie
Joined: 10/28/2002 Posts: 1,283 Location: AT
|
Hi,
attached is an example maping and test files to achieve the desired results.
The contents of "test.xml" are mapped to another xml component which is set to "Serialize XML as Strings" The carriage return and line feed are then removed from the string and this is mapped to the output csv component.
File Attachment(s): test.zip (3kb) downloaded 553 time(s).
island attached the following image(s):
|
|
Rank: Newbie
Joined: 7/16/2015 Posts: 2 Location: Louisiana
|
Thank you so much. the only trouble I am having is the option to "Change Root Node" is disabled/grayed-out. How do I enable it so I can perform the changes?
THanks
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
Are you talking about how to change from File to String? Click the File/String button...
|
|
Rank: Newbie
Joined: 10/28/2002 Posts: 1,283 Location: AT
|
arcee123 wrote:Thank you so much. the only trouble I am having is the option to "Change Root Node" is disabled/grayed-out. How do I enable it so I can perform the changes?
The schema (xsd) used for the "intermediate component" in the mapping, defines "child2" as a global element (only elements defined globally in an xsd can be used as root elements in an instance xml file). If "child2" is not defined as a global element in your schema you will have to amend the xsd and declare it globally so that it can be used as a root element for the intermediate component in your mapping.
|
|
guest |