XML Input Stage Problem

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
rajeevn80
Participant
Posts: 28
Joined: Mon Jan 31, 2005 10:58 pm

XML Input Stage Problem

Post by rajeevn80 »

Hi,
I have a server job that reads xml data in a single record through a sequential file and then converts this raw input into XML using the XML Input Stage and then a bit simple transform in BASIC transformer and then the final output to a file.

The problem here is that no records are being output from the XML Input stage. i can see that the records are being read by Sequential stage and then input to the XML. But the no records are written out of the XML stage. The job finishes without even a warning.

Can anybody through light on this?
Rajeev
Nobody knows Everything,
But U should not be the One who knows Nothing.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Usually means your XPath expressions are not correct. How were they generated?
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

ps. Server jobs don't have a BASIC Transformer.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rajeevn80
Participant
Posts: 28
Joined: Mon Jan 31, 2005 10:58 pm

Post by rajeevn80 »

ps. Server jobs don't have a BASIC Transformer
:) have been working too much on parallel now that when u move to a server u tend to forget the damn thing.

Anyways what do u mean by "XPath expressions"
Rajeev
Nobody knows Everything,
But U should not be the One who knows Nothing.
VCInDSX
Premium Member
Premium Member
Posts: 223
Joined: Fri Apr 13, 2007 10:02 am
Location: US

Post by VCInDSX »

Hi rajeevn80,
This post actually belongs to the Server forum.... because you have mentioned "Server" in your post header...

Cheers!!!
-V
rajeevn80
Participant
Posts: 28
Joined: Mon Jan 31, 2005 10:58 pm

Post by rajeevn80 »

VCInDSX wrote:Hi rajeevn80,
This post actually belongs to the Server forum.... because you have mentioned "Server" in your post header...

Cheers!!!
Yes this is a server job but i think at this point the XML stage is the issue. Tried the same in a Parallel still gives the same problem.
Rajeev
Nobody knows Everything,
But U should not be the One who knows Nothing.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, the issue seems to be the fact that you don't know what XPath Expressions are. :?

They do all the dirty work in the stage and tell it how to parse the elements out that you want from the XML. They are generated for you automatically when you import the metadata from your source xml or better yet the .xsd - did you do that?

Specifically, they are the expressions in the Output Columns tab Description column and look something like this:

elementName/text()
-craig

"You can never have too many knives" -- Logan Nine Fingers
rajeevn80
Participant
Posts: 28
Joined: Mon Jan 31, 2005 10:58 pm

Post by rajeevn80 »

yes i did import the metadata from a .xsd file. After the metdata import the output columns tab description had '/defns' appended to each level-
eg.
"/defns:BACSDocument/defns:Data/defns:ISCDDocument/Version/text()"
When i ran the job it aborted indicating '/defns:' as the problem.

I compared the new metadata with an old xml one and found out that the old one did not have any '/defns' in description. So i manually removed the 'defns:' to make it as
eg.
"/BACSDocument/Data/ISCDDocument/Version/text()"
Now the job runs to a completion with no errors but no records output from the XML input stage.
Rajeev
Nobody knows Everything,
But U should not be the One who knows Nothing.
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

Refer THIS link for a small example to understand the concept
Last edited by JoshGeorge on Thu Sep 20, 2007 7:30 am, edited 1 time in total.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No errors with no output means your expressions are 'valid' but don't match what is coming in from the xml. Can you post a sample of the xml you are processing and your corresponding xpath expressions?
-craig

"You can never have too many knives" -- Logan Nine Fingers
VCInDSX
Premium Member
Premium Member
Posts: 223
Joined: Fri Apr 13, 2007 10:02 am
Location: US

Post by VCInDSX »

rajeevn80 wrote: I compared the new metadata with an old xml one and found out that the old one did not have any '/defns' in description. So i manually removed the 'defns:' to make it as
eg.
"/BACSDocument/Data/ISCDDocument/Version/text()"
To get rid of the "defns" prefix, do the following.
1. Launch XML Metadata Importer
2. Import the XSD
3. Open "View" menu and select "Namespaces"
4. Here you will see "Prefix" textbox and an "Always Qualify" check box. Uncheck this box. It will show a warning message. Dismiss it.
5. This should remove the "defns:" prefix from your schema.

Time and again, as everybody else, I would like to refer you Duke's wonderful page with this "XML Best Practices document" for a good understanding of the XML stages.
http://www.duke-consulting.com/Download ... ctices.zip

NOTE: This "feature" is not seen in version 8.0.[/i]

Good luck,
-V
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Great points by all.... it's also worth emphasizing that you should always follow Craig's advice and look carefully at your actual XML instance document sample that you are trying to read, and compare it against your XPath....just to be sure there were no inconsistencies between your xsd and your particular document.

Ernie
rajeevn80
Participant
Posts: 28
Joined: Mon Jan 31, 2005 10:58 pm

Post by rajeevn80 »

I am getting the following error -
1. Xalan error(publicid ; systemid ; line1, cloumn191): The input ended before all started tags were ended.

Does this mean that my .xsd and .xml are not in sync. :?:
Rajeev
Nobody knows Everything,
But U should not be the One who knows Nothing.
Post Reply