XML Output Stage Not Generating XML File

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
skilletrx2
Participant
Posts: 15
Joined: Mon Jul 20, 2009 7:16 am

XML Output Stage Not Generating XML File

Post by skilletrx2 »

Hi all, I'm trying to figure out what I am missing. When I run my job, everything looks fine and green, but no XML file is generated out of my XML Output Stage. I have checked the box to Write out the XML output but no file is ever created.

I have also referenced the IBM example, and still did not get an XML file outputted, despite a successfully executed job.

http://www-128.ibm.com/developerworks/d ... 0703xiong/

Any hints, comments, tips would be appreciated. Thanks in advance.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

This typically means your XPath Expressions are not correct. How were they generated - from an xsd or manually? Can you post some samples of what you are trying to generate and the XPath Expressions you are using?
-craig

"You can never have too many knives" -- Logan Nine Fingers
datskosaraju
Premium Member
Premium Member
Posts: 48
Joined: Tue Nov 25, 2008 11:10 pm
Location: Des Moines,IA

Post by datskosaraju »

In addition you can always check this for more information on XML and web services( Ernie's Blog)

http://dsrealtime.wordpress.com/
"It's easier to go down a hill than up it but the view is much better at the top"
-Bennet,Arnold
skilletrx2
Participant
Posts: 15
Joined: Mon Jul 20, 2009 7:16 am

Post by skilletrx2 »

chulett wrote:This typically means your XPath Expressions are not correct. How were they generated - from an xsd or manually? Can you post some samples of what you are trying to generate and the XPath Expressions you are using?
Hi there, this is my input Sequential File:
0001, Company, Lee, Chen, Lee@gmail.com

I use:
Sequential File Stage (bring in the input CSV file), connect it to the TRANSFORMER Stage, which is connected to the XML Output Stage.

I mapped the transformer stage to the xml output stage, and in the xml output stage I set the following:

(everything default except:
STAGE > Document Settings > Namespace Declaration > [x] Include
and I loaded the target.xml definition which looks like this:

<CustomerInfo xmlns="http://www.ibm.com/schemas/SimpleXMLDemo"
xmlns:cnt="http://www.ibm.com/schemas/ContactDemo"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CustomerID>0000000001</CustomerID>
<CompanyName>MindLight Corp.</CompanyName>
<Contacts>
<cnt:Contact>
<cnt:FirstName>Lee</cnt:FirstName>
<cnt:LastName>Chen</cnt:LastName>
<cnt:Email>LeeChen@gmail.com</cnt:Email>
</cnt:Contact>L
</Contacts>
</CustomerInfo>

Also changed TRANSFORMATION SETTINGS to output a single row, and set it to output the XML file.

TIA!
skilletrx2
Participant
Posts: 15
Joined: Mon Jul 20, 2009 7:16 am

Post by skilletrx2 »

Found it:

XPATH was the correct issue, I had no idea, that resided in the "DESCRIPTION" column of the XML Output Stage (Input > Columns > Description)

That had to be mapped correctly for it to work, the best thing to do would be to use a table definition instead of quickly putting columns in. Using Table Definitions seem to populate the "DESCRIPTION" field which I believe are XPATH values.

Just wanted to jot this down in case it helps some noobie.

Thanks all.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Correct, the XPath Expressions go in the "Description" field... glad you got that figured out. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply