ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Embedding XML within an XML in WTX

Post new topic  Reply to topic
 Embedding XML within an XML in WTX « View previous topic :: View next topic » 
Author Message
Anannya
PostPosted: Wed Jul 11, 2012 1:11 pm    Post subject: Embedding XML within an XML in WTX Reply with quote

Newbie

Joined: 11 Jul 2012
Posts: 9

I have a situation in which I have to generate one xml, and embed that xml in another xml. I am trying to simplify my problem with an example -

Consider I have 2 xsd's - employee.xsd and salary.xsd.
salary.xsd generates an xml in which I have the split of my salary structure. So, a very basic salary.xml would look like -
<salary>
<basic>1000</basic>
<tax>50</tax>
<HRA>123</HRA>
</salary>

employee.xsd generates an xml in which we have all the details of an employee like name, age, DOB and a also tag called as salarystructure. I want to embed the salary xml (shown above) inside this salarystructure tag. So, a very basic employee.xml would look like:

<employee>
<name>Anannya</name>
<age>26</age>
<DOB>3rd Feb</DOB>
<salarystructure>
<salary>
<basic>1000</basic>
<tax>50</tax>
<HRA>123</HRA>
</salary>
</salarystructure>
</employee>

Can anyone please let me know how to do this in WTX? I tried using 2 output cards with the "Onsuccess -> append" option applied for the 2nd one, but the salary xml gets appended to the employee xml at the very end i.e. at after the </employee> tag. This is not what I want. I want to EMBED it in between. Any inputs?
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Jul 11, 2012 1:16 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Please use [c o d e ] tags.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Anannya
PostPosted: Wed Jul 11, 2012 1:19 pm    Post subject: Reply with quote

Newbie

Joined: 11 Jul 2012
Posts: 9

lancelotlinc wrote:
Please use [c o d e ] tags.


I am sorry, I did not get you....
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Jul 11, 2012 1:21 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Anannya wrote:
lancelotlinc wrote:
Please use [c o d e ] tags.


I am sorry, I did not get you....


Edit your original post, and put the code you pasted in the original post inside [c od e] tags.

Like this...

Code:
SET A = B + C;

_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Anannya
PostPosted: Wed Jul 11, 2012 1:24 pm    Post subject: Reply with quote

Newbie

Joined: 11 Jul 2012
Posts: 9

I have a situation in which I have to generate one xml, and embed that xml in another xml. I am trying to simplify my problem with an example -

Consider I have 2 xsd's - employee.xsd and salary.xsd.
salary.xsd generates an xml in which I have the split of my salary structure. So, a very basic salary.xml would look like -

Code:

<salary>
<basic>1000</basic>
<tax>50</tax>
<HRA>123</HRA>
</salary>


employee.xsd generates an xml in which we have all the details of an employee like name, age, DOB and a also tag called as salarystructure. I want to embed the salary xml (shown above) inside this salarystructure tag. So, a very basic employee.xml would look like:

Code:

<employee>
<name>Anannya</name>
<age>26</age>
<DOB>3rd Feb</DOB>
<salarystructure>
<salary>
<basic>1000</basic>
<tax>50</tax>
<HRA>123</HRA>
</salary>
</salarystructure>
</employee>


Can anyone please let me know how to do this in WTX? I tried using 2 output cards with the "Onsuccess -> append" option applied for the 2nd one, but the salary xml gets appended to the employee xml at the very end i.e. at after the employee tag. This is not what I want. I want to EMBED it in between. Any inputs?
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Jul 11, 2012 1:28 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

ESQL would be much more efficient here. What is your motivation for using WTX? Why unnecessarily complicate the operation?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Anannya
PostPosted: Wed Jul 11, 2012 1:29 pm    Post subject: Reply with quote

Newbie

Joined: 11 Jul 2012
Posts: 9

Using WTX is a mandate and I am not an ESQL guy. Is there any way in which we can do this in WTX?
Back to top
View user's profile Send private message
inMo
PostPosted: Thu Jul 12, 2012 6:26 am    Post subject: Reply with quote

Master

Joined: 27 Jun 2009
Posts: 216
Location: NY

Quote:
I want to embed the salary xml (shown above) inside this salarystructure tag


Are you looking to dynamically embed something like salary xml, or are you always looking to produce the same final fixed structure?
Back to top
View user's profile Send private message
Anannya
PostPosted: Thu Jul 12, 2012 6:31 am    Post subject: Reply with quote

Newbie

Joined: 11 Jul 2012
Posts: 9

Yes, I want it dynamically. My requirement is that the ENTIRE output generated by out1 card (in this example its is salary) should be included in the output generated by the 2nd output card.

If not clear, let me know. i will try to explain again.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Jul 12, 2012 7:01 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Anannya wrote:
Using WTX is a mandate and I am not an ESQL guy. Is there any way in which we can do this in WTX?


Whose mandate? The current implementation of WTX is a legacy implementation and new code should not be written using it. DFDL is the current generation technology.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Thu Jul 12, 2012 12:46 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Just so that we're all clear in our minds...
- DFDL is a parser, like XMLNSC or JSON or MRM. It's true that DFDL is the best option for parsing and writing non-XML data formats. You would not, however, use DFDL to combine two XML documents into a single document.
- WMB does have native facilities that can do that trick. It would be very simple in ESQL or Java. I'm pretty sure it would be very easy using the new mapping node and its associated mapping editor.

If you explain a little more about where the two XML documents come from and how they are presented to the WMB flow then we may be able to suggest a very straightforward solution. Worth a try?
Back to top
View user's profile Send private message
shanson
PostPosted: Mon Jul 16, 2012 1:09 am    Post subject: Reply with quote

Partisan

Joined: 17 Oct 2003
Posts: 344
Location: IBM Hursley

Sounds like you need a WTX map with two input cards and one output card. the single output is built from the two inputs. If you do go down the WTX route, then you should build the maps using the xsds (do not import the xsds to create type trees). But to echo the earlier sentiments, you don't need WTX to do this.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Embedding XML within an XML in WTX
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.