Hi All,
I am trying to capture couple of column data that are same in the 3 different xmls by dynamically changing the xpath expressions.
for ex:
col1,col2,col3---------xml1,xml2,xml3
is there any way to pass xpath expressions dynamically when i run my job atleast first part like (/xml1/col1/text() when i run second xml i want to replace xml1 to xml2 like (/xml2/col1/text()).
Thanks in advance.
change xpath expressions of xml Dymanically
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 116
- Joined: Fri Jan 20, 2006 2:30 pm
You can't change the xpath...but you could code for it in advance.....each link could have its own xpath, and then do something else downstream, bring the links back together, etc.
...or, if the xml content is not "too" big, just change the xml itself in an upsteam transformer...easy if the pattern is as basic as you have described.
Ernie
...or, if the xml content is not "too" big, just change the xml itself in an upsteam transformer...easy if the pattern is as basic as you have described.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
-
- Charter Member
- Posts: 299
- Joined: Wed Nov 13, 2002 5:38 pm
- Location: USA
I don't have access to DataStage so this is from memory and might be a little vague. It has been over a year since I talked DataStage so my accent might be rather thick.
You can change it dynamically (per job run that is) using parameters. Parameters will work within the description field. Parameters will also work in the XML Stage itself if you wanted to change the schema dynamically as well.
You can change it dynamically (per job run that is) using parameters. Parameters will work within the description field. Parameters will also work in the XML Stage itself if you wanted to change the schema dynamically as well.
-
- Premium Member
- Posts: 116
- Joined: Fri Jan 20, 2006 2:30 pm
Very nice! That's great! I haven't seen a use case that demanded it (usually the variety is very low, or else dramatic and impacting downstream stages making a separate path of stages a requirement).
Can you describe how #JPass1# changes? Does it ever include multiple nodes (slashes embedded in its value)?
Hmm. I have to think about the implications for 8.5........
Thanks.
Ernie
Can you describe how #JPass1# changes? Does it ever include multiple nodes (slashes embedded in its value)?
Hmm. I have to think about the implications for 8.5........
Thanks.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
-
- Charter Member
- Posts: 299
- Joined: Wed Nov 13, 2002 5:38 pm
- Location: USA
I'm happy that worked for you. The application I used it for was multiple xml schemas going to an Oracle db. The schemas described different hedged options like commodities (rice, hops, barley, the essentials for beer), as well as hedging international currency fluctuations, transportation costs, stuff like that as the input. The thing is those different XML schemas can all be parsed into loading the same Oracle table model. Consequently all these different XPaths all parsed into the same Update/Insert into Oracle AND were relatively the same except for element naming. Therefore the parameterized job could take different schemas but the exact same Oracle stages post parse. That my friend was re-usability.