Page 1 of 2

XML File poblem

Posted: Thu May 25, 2006 5:08 pm
by bobby28
I am getting the following error while reading from an XML file, can you please helpme identifying the issue:

Unable to resolve prefix 'rs'.
pattern = '/xml/rs:data/z:row'(Unknown URI, 12, 74)
Remaining tokens: ('/' 'xml' '/')

Thanks!

Posted: Thu May 25, 2006 5:14 pm
by chulett
As a guess, your XPath expressions are wrong. Or you have a namespace problem. Or both. :lol:

Do you have an xsd for this file? Best thing to do would be to get one and use that to import the metadata into DataStage via the Manager. That process will create the XPath expressions you will need to properly process the file.

Posted: Thu May 25, 2006 5:21 pm
by bobby28
Hello

I have already imported the metadata from the xml file via Manager. The XML file has definitions at the top and data in the bottom of the file (I am new to XML).

Can you please let me know the namespace issue or any other thing I should look for.

Thanks


chulett wrote:As a guess, your XPath expressions are wrong. Or you have a namespace problem. Or both. :lol:

Do you have an xsd for this file? Best thing to do would be to get one and use that to import the metadata into DataStage via the Manager. That process will create the XPath expressions you will need to properly process the file.

Posted: Thu May 25, 2006 5:29 pm
by chulett
Ok... hard to get too specific with someone new to XML, and I'm not exactly an expert on it. :(

In the 'definitions at the top' are there any 'namespace' or 'xmlns' entries? Did you include that in your metadata import? If so, then you'll need to load that information into the XML Input stage... you are using a combination of Folder and XML Input stages to read this file, yes?

There is a checkbox to 'Include namespace declaration'. You would need to check/enable that and then enter the data. Easiest way to do that is via the 'Load' button which will automatically pull it from your imported metadata.

Give that a shot...

Posted: Thu May 25, 2006 5:40 pm
by bobby28
1. Yes there is xmlns
2. Yes I included it in metadata import
3. I have loaded that in input stage now
4. I am using both folder stage and xml input stage.
5. Now I have checked on 'Include namespace declaration'. and done "Load"

Can you let me know what should be my column names in the folder stage.

Thank you so much for your help.
chulett wrote:Ok... hard to get too specific with someone new to XML, and I'm not exactly an expert on it. :(

In the 'definitions at the top' are there any 'namespace' or 'xmlns' entries? Did you include that in your metadata import? If so, then you'll need to load that information into the XML Input stage... you are using a combination of Folder and XML Input stages to read this file, yes?

There is a checkbox to 'Include namespace declaration'. You would need to check/enable that and then enter the data. Easiest way to do that is via the 'Load' button which will automatically pull it from your imported metadata.

Give that a shot...

Posted: Thu May 25, 2006 5:51 pm
by bobby28
Job is executing without any warning or errors now but it is processing zero rows. I am writing to a Sequential File and it is empty.

Please advise.

Thanks

Posted: Thu May 25, 2006 6:21 pm
by bobby28
Can anyone help me understand what could be causing "zero rows" to be processed??

Thanks!!

Posted: Thu May 25, 2006 6:49 pm
by chulett
Sure... but have some patience, we're not all here online 24x7.

This should mean you are having parsing errors. There should be several entries to that effect in the job's log, can you verify that? Perhaps post one or two of them? Usually because your column names don't match up with the XPath expressions.

The column names in the Folder stage don't really matter - as long as you have two columns. The first one will receive the name of the XML file and the second will contain the entire contents of the file. I usually name them 'Filename' and 'Record' respectively, and set the Record column to a LongVarChar of a large size. Make sure you set the 'XML source column' on the Input tab to the 'Record' column - whatever you end up calling it. That and make sure the 'Column content' is set to 'XML Document'.

XML File Problem

Posted: Thu May 25, 2006 8:36 pm
by bobby28
I am getting the following error: Xalan fatal error (publicId: , systemId: , line: 1, column: 11): The prefix 'rs' has not been mapped to any URI

Looks like I have not imported the metadata correctly, please advise.

Thanks.

chulett wrote:Sure... but have some patience, we're not all here online 24x7.

This should mean you are having parsing errors. There should be several entries to that effect in the job's log, can you verify that? Perhaps post one or two of them? Usually because your column names don't match up with the XPath expressions.

The column names in the Folder stage don't really matter - as long as you have two columns. The first one will receive the name of the XML file and the second will contain the entire contents of the file. I usually name them 'Filename' and 'Record' respectively, and set the Record column to a LongVarChar of a large size. Make sure you set the 'XML source column' on the Input tab to the 'Record' column - whatever you end up calling it. That and make sure the 'Column content' is set to 'XML Document'.

Posted: Thu May 25, 2006 8:57 pm
by chulett
Hmmm... this is where it gets hard to help without actually being there. Is there anyone onsite there with you (even if they don't know DataStage) that knows XML and could sit through the process with you?

If you don't think you've imported the metadata correctly - give it another shot. Make use of the 'Auto-check' option if you didn't use that the first time, see it that helps.

XML File Problem

Posted: Fri May 26, 2006 10:16 am
by bobby28
Thank you so much for your extended help. There was an issue with my metadata and I fixed it after analyzing the XML file.

Regards
Bobby
chulett wrote:Hmmm... this is where it gets hard to help without actually being there. Is there anyone onsite there with you (even if they don't know DataStage) that knows XML and could sit through the process with you?

If you don't think you've imported the metadata correctly - give it another shot. Make use of the 'Auto-check' option if you didn't use that the first time, see it that helps.

Posted: Fri May 26, 2006 11:13 am
by chulett
Ah... good. :D

Posted: Thu Feb 15, 2007 3:16 am
by battaliou
chulett wrote:Ok... hard to get too specific with someone new to XML, and I'm not exactly an expert on it. :(

In the 'definitions at the top' are there any 'namespace' or 'xmlns' entries? Did you include that in your metadata import? If so, then you'll need to load that information into the XML Input stage... you are using a combination of Folder and XML Input stages to read this file, yes?

There is a checkbox to 'Include namespace declaration'. You would need to check/enable that and then enter the data. Easiest way to do that is via the 'Load' button which will automatically pull it from your imported metadata.

Give that a shot...
Nice one Craig, remember too, you must check the "Inherit stage properties" tag on the "Ouput" -> "Transformation Settings" This will help to solve your "poblem".

Posted: Thu Feb 15, 2007 7:57 am
by chulett
Interesting... not only did you reply to a pushing one year old thread, but this wasn't my "problem". And no, there is no "must" in using the Inherit stage properties option, you certainly can but not there is no "must" here. And inheriting bad metadata from the Stage tab wouldn't be all that helpful. :wink:

Posted: Thu Feb 15, 2007 8:26 am
by battaliou
I just set up an XML reader with namespace in Xpath and it was the only way I could get it to work, so I figured I'd add to the best post on the subject.

Caption definitetly says its "poblem" and I cant bare bad speling.