XML Input & OutPut Stages

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
seethamsetty
Participant
Posts: 24
Joined: Sun Nov 13, 2005 6:14 pm

XML Input & OutPut Stages

Post by seethamsetty »

Hi!

This is with regard to XML Meta data import. I have a doubt with regard to metadata import, are columns taken from XML or XSD file?

I am importing metadata from Xsd file , and using the required fields in the job.

I am facing problem wth regard to namespaces.

I have given the following in XML Input Namespace declaration

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:="http://www.cust.org/Contract"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"

It gives the following error :
Contract_ranga1..XML_Input_1: Unable to resolve prefix 'defns'.
pattern = '/defns:contracts/defns:contract'(Unknown URI, 12, 87)
Remaining tokens: ('/')

Can any one help me on the above problem.
seethamsetty
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

There a few posts with similar issues, like this
If that does not help get back.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

...a few tips to consider along with that other thread.... the error is most likely a result of the xpath that is sitting in the "Description" property for your columns... /defns:<yourcolumnname> is right from the Xpath syntax.

This means that you need a namespace definition for defns. Normally it would come in from the table definition that you imported from the xsd or xml doc..... but it doesn't have to be... you can just go in and edit the namespace "window" and add your own:

xmlns:defns="fred" (or whatever unique qualifying string you want...best if it was the actual one, but anything will likely work fine).

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

Post by chulett »

And just out of curiousity, are there actually any namespace declarations in your incoming XML files?
-craig

"You can never have too many knives" -- Logan Nine Fingers
seethamsetty
Participant
Posts: 24
Joined: Sun Nov 13, 2005 6:14 pm

XML Input stage

Post by seethamsetty »

I am using folder statge to retrive the xml file and xml input stage to process the xml document and write onto sequential file.

I am able to send a record to input stage and nothing is written out of outout stage to target.

Job is processed sucessfully, no errors

My input file looks like
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <NAXML-BusDoc xmlns="http://www.naxml.org/Retail-EDI/Vocabulary/2003-10-16" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.naxml.org/Retail-EDI/Vocabul ... oice15.xsd" version="1.5">

But i am importing the metadata for this xml from xml file .
and a prefix of ns1 is taken while importing and also in colums load.

It that correct. Is it some thing to do with name spaces.
Kindly help
seethamsetty
Post Reply