XML SChema help

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

XML SChema help

Post by swades »

Hi,
I am having foollowing problem while generating output as XML file.
Please anybody can help me out on this.

It is from Teradata->Xfmer-> Hash->Xfermer-> XML OUT

I have following 12 columns in my hash file
BAN
DUNS
BANBillCycle
Contactfirstname
stprvCd
cityNm
addressnm
cntctfirstname
cntcsbusnm
Technicalcontact
technicalphonenumber
BillingParent

The output should be divided in following way
First three columns should ne under /BAN
Second Hierarchi should be under /BillingContactDetails with next 4 columns
third Hierarchi should be under / BillingContactAddress with next 2 columns
Fourth shoold be under /technicalcontactdetails with next 2 columns
and Final with last column as /Billingparent

if I give first three column as
/Ban
/ban/duns
/ban/billcycle

then
/BillingContactDetails/Contactfirstname
/BillingContactDetails/stprvCd
/BillingContactDetails/cityNm
/BillingContactDetails/addressnm
then same way other header like
/billingcontactdetails
then
/Technicalcontactdetails
and final one

But in output I get only first three columns only.
Others I want to add header or Hirarchi as mentioned.
Last edited by swades on Thu Mar 15, 2007 8:38 pm, edited 1 time in total.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Policy Note

We don't do "urgent" or "ASAP" here. All posters are unpaid volunteers. If you want urgent help sign up with your support provider for premium service, and learn the true cost of "urgent".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ok, now that that is out of the way...

Do you (ideally) have an xsd for or at the very least a sample of this target file you are trying to create? You would then use that to import the XML metadata and that process would build the XPath Expressions for you automagically. I find those generally work better than any you cobble together yourself.
-craig

"You can never have too many knives" -- Logan Nine Fingers
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Craig is right --- an xsd or existing XML document is going to make this far simpler....but for starters, be sure you have a full root structure that wraps all of these element "nodes".....

...so, I don't know what your "header" looks like, but you should be ok if you start a pattern like below:

Here is your original...

/ban/duns
/ban/billcycle

then
/BillingContactDetails/Contactfirstname
/BillingContactDetails/stprvCd
/BillingContactDetails/cityNm
/BillingContactDetails/addressnm
then same way other header like
/billingcontactdetails
then
/Technicalcontactdetails


at the very least, it should look like:


/mybase/ban/duns/text()
/mybase/ban/billcycle/text()

then
/mybase/BillingContactDetails/Contactfirstname/text()
/mybase/BillingContactDetails/stprvCd/text()
/mybase/BillingContactDetails/cityNm/text()
/mybase/BillingContactDetails/addressnm/text()

/mybase/billingcontactdetails/text()

/mybase/Technicalcontactdetails/text()


...we don't know exactly what the details are that you need, but at a minimum you want to have a root element and then a higher sub node of that that "contains" each of your individual column groups. Assuming these columns all came from a single row of a hash table or other relational structure you'll be fine. You'll get into difficulty if the various groups you describe are individually repeating.....

Ernie
Post Reply