Using XML Input Stage with External Source Stage

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

Post Reply
Rajesekhar
Participant
Posts: 19
Joined: Fri May 14, 2010 3:54 pm

Using XML Input Stage with External Source Stage

Post by Rajesekhar »

Hi,

I am usnig external source to read xml files and XMl input stage to parse the xml message.

My schema is having a target name space because of which in my XMLInput Stage --> Output --> Columns --> description tab it is shown as /defns:..

I am able to compile the job and at the time of execution it is giving error like "The prefix defns is not declared" and Error occured in call to ORPHCallActivePluginInitialize().

Can any one help how to deal with this?

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

Post by chulett »

How did you generate the metadata / XPath Expressions you are using? From an xsd for your source file? Can you post some examples of them, please? Also, did you load your namespace definition? From the docs...
If you used the XML Meta Data Importer to create table definitions, select the Include namespace declaration box and click the Load button to extract namespace declarations from a specific table definition.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Rajesekhar
Participant
Posts: 19
Joined: Fri May 14, 2010 3:54 pm

Post by Rajesekhar »

Yes right.. I am using xsd to create metadata. Import --> tableDefinitions --> XML table definitions.

From here I am selecting the file which is there on my local system, checking all the necessary attributes and saving the datadefinitions.

In XML Input Stage --> Output --> Columns Iam loading these data definitions.

When I do this in description column it is given as /defns:.. which I believe is improper.

Here is the snippet of schema iam usnig..

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.something.com/1.0/site" elementFormDefault="qualified" version="1.0">
<xs:element name="Message_Name">
<xs:annotation>
<xs:documentation>CDATA Format: :<![CDATA[ABC|DEF|GHI]]></xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
Rajesekhar Potteti
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It would be helpful if you answered the last question asked. Also, can you post a snippet of the actual xml and some full examples of your XPath Expressions? Thanks.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Rajesekhar
Participant
Posts: 19
Joined: Fri May 14, 2010 3:54 pm

Post by Rajesekhar »

Hi Craig,

Good Catch, I didnt load namespace definitions. but I manuaaly inserted them on to Stage --> Transformaiton Setting.

Need your help in understanding how to load namespace definitions, some article would help.

I just tried using a proper schema (instead of using flat file structure in document, used actual elements and other properties) and the corresponding xml file and it worked.

I am new to DataStage, but I am having work experience in WMB and WTX. Hope to learn DS quick.

-Thanks for your help.
Rajesekhar Potteti
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I quoted right from the supplied documentation, check out the XML Pack Guide pdf that is part of that suite.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Ragupathy
Participant
Posts: 9
Joined: Thu Feb 11, 2010 11:14 pm

Post by Ragupathy »

Hi

after loading the table definations

need to load the columns it will be tree like structure.....

it is the error i think so....

this should be done in xml table data definations

Thanks
chulett wrote:How did you generate the metadata / XPath Expressions you are using? From an xsd for your source file? Can you post some examples of them, please? Also, did you load your namespace definition? From the docs...
If you used the XML Meta Data Importer to create table definitions, select the Include namespace declaration box and click the Load button to extract namespace declarations from a specific table definition.
Ragu
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Default namespaces can be a pain to work with. As Craig suggests, put a snippet of xml here so we can see..just need the first couple of elements and attributes near the top along with the all-important header..... share your xpath also (the Description property of your xmlInput Stage's output link).

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply