XML File poblem
Moderators: chulett, rschirm, roy
XML File poblem
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!
Unable to resolve prefix 'rs'.
pattern = '/xml/rs:data/z:row'(Unknown URI, 12, 74)
Remaining tokens: ('/' 'xml' '/')
Thanks!
As a guess, your XPath expressions are wrong. Or you have a namespace problem. Or both.
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.
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
"You can never have too many knives" -- Logan Nine Fingers
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
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.
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.
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...
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
"You can never have too many knives" -- Logan Nine Fingers
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.
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...
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'.
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
"You can never have too many knives" -- Logan Nine Fingers
XML File Problem
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.
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'.
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.
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
"You can never have too many knives" -- Logan Nine Fingers
XML File Problem
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
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.
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".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...
3NF: Every non-key attribute must provide a fact about the key, the whole key, and nothing but the key. So help me Codd.
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.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
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.
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.