XML File poblem

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

bobby28
Participant
Posts: 17
Joined: Mon Jan 17, 2005 9:56 am

XML File poblem

Post 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!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
bobby28
Participant
Posts: 17
Joined: Mon Jan 17, 2005 9:56 am

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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...
-craig

"You can never have too many knives" -- Logan Nine Fingers
bobby28
Participant
Posts: 17
Joined: Mon Jan 17, 2005 9:56 am

Post 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...
bobby28
Participant
Posts: 17
Joined: Mon Jan 17, 2005 9:56 am

Post 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
bobby28
Participant
Posts: 17
Joined: Mon Jan 17, 2005 9:56 am

Post by bobby28 »

Can anyone help me understand what could be causing "zero rows" to be processed??

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

Post 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'.
-craig

"You can never have too many knives" -- Logan Nine Fingers
bobby28
Participant
Posts: 17
Joined: Mon Jan 17, 2005 9:56 am

XML File Problem

Post 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'.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
bobby28
Participant
Posts: 17
Joined: Mon Jan 17, 2005 9:56 am

XML File Problem

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ah... good. :D
-craig

"You can never have too many knives" -- Logan Nine Fingers
battaliou
Participant
Posts: 155
Joined: Mon Feb 24, 2003 7:28 am
Location: London
Contact:

Post 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".
3NF: Every non-key attribute must provide a fact about the key, the whole key, and nothing but the key. So help me Codd.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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:
-craig

"You can never have too many knives" -- Logan Nine Fingers
battaliou
Participant
Posts: 155
Joined: Mon Feb 24, 2003 7:28 am
Location: London
Contact:

Post 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.
3NF: Every non-key attribute must provide a fact about the key, the whole key, and nothing but the key. So help me Codd.
Post Reply