XML Input Stage - help

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Not sure what you are proposing, unless we are all still mis-understanding the objective. I am under the impression that the goal is to match the actual "documentation string" from the xsd next to each of the possible enumerated values that might be flowing down from an individual instance document...

meaning that for a particular value in an element or attribute flowing thru the job, they don't want the value, they want what is in the documentation element of the xsd...

...ie...when the value in the document is "4", use this string from the xsd:

<xs:documentation>Closed G</xs:documentation>


So...at some point, i/o has to be performed on the xsd itself. How that xsd is parsed of course, is simply a developer choice...with stage or with xslt...either or something else would be fine --- but it contains the values that are desired for each matching value.

...or maybe I still don't understand the initial objective. ; )

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post by rameshrr3 »

I can agree that all responders are in a different state of confusion surrounding the original posted req. The XSLT fragment I proposed is a way to handle decoding the XML to a set of Attribute=Value pairs as requested in the most recent post by OP. A lookup is still required somewhere to do what's requested in the earliest post - and that will require parsing of the XSD itself and building a lookup out of it - and will requre abother xslt based extraction if one is using the 'deprecated' xml stages . I dont have much exp in the new fancy XML stage - old habits die hard!.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

...I agree with you there....and there are times when it is the better choice.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post by rameshrr3 »

The only bizzare thing i noticed is that the XML metadata importer does not import Xpaths for the xs:enumeration tag , its values and descendants - the OP will have to manually define the Xpath for this tag and its descendants/attributes to make the transformation from the XSD ( read is as XML) to a set?? of lookup tables for use based on the XSD tag attributename. Also tag values with Ampersands '&' need to be substituted as it can cause an import error.

Reading the XSD just needs 2 XML input stages , in cascade, but can be done with one if not confusing enough :). The 'data' payload needs to be transformed by XSLT , and then Field functions used to get the 'value' data exclusively from the Attribute=Value combination so that it can be looked up on the XSD - it could be simpler of course.
karthikr25
Participant
Posts: 8
Joined: Thu Apr 18, 2013 2:35 pm
Location: Toronto

Post by karthikr25 »

Thanks guys wil try and let you know which one worked
karthik
Post Reply