Problem with XML job
Moderators: chulett, rschirm, roy
Problem with XML job
Hi,
I am getting this error in my XML job.....anyone...please help me out
TEST..XML_Input_1: Unable to resolve prefix 'xs'.
pattern = '/xs:schema/xs:element/xs:complexType/xs:sequence/xs:element/xs:complexType/xs:attribute'(Unknown URI, 15, 143)
Remaining tokens: ('/')
Thanks in Advance
Kumar
I am getting this error in my XML job.....anyone...please help me out
TEST..XML_Input_1: Unable to resolve prefix 'xs'.
pattern = '/xs:schema/xs:element/xs:complexType/xs:sequence/xs:element/xs:complexType/xs:attribute'(Unknown URI, 15, 143)
Remaining tokens: ('/')
Thanks in Advance
Kumar
Usually it means that your xml contains namespaces (the xs: is actually in your xml document, in front of the element and attribute names), and is in your xpath (look at the description property of each column on your xmlInput Stage output link), but you don't have the namespace declared in the namespace section.......look in the transformation settings tab for the namespace declaration property box and do a "load" of the same table definition that used for import of metadata on your output link.
Ernie
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
NAME SPACE ISSUE
Hi Eostic,
Thanks for your reply.
I added the name space,but still i am getting same error,the name space should be same as description in output link?,,i tried to paste the same what ever i have in description and run the job then i was getting a different error (TEST..XML_Input_1: The transformation XSLT stylesheet is invalid) again i changed and did a direct load from the same table defination but getting same error like before ....
TEST..XML_Input_1: Unable to resolve prefix 'xs'.
pattern = '/xs:schema/xs:element/xs:complexType/xs:sequence/xs:element/xs:complexType/xs:attribute'(Unknown URI, 15, 143)
Remaining tokens: ('/')
Thanks
Kumar
Thanks for your reply.
I added the name space,but still i am getting same error,the name space should be same as description in output link?,,i tried to paste the same what ever i have in description and run the job then i was getting a different error (TEST..XML_Input_1: The transformation XSLT stylesheet is invalid) again i changed and did a direct load from the same table defination but getting same error like before ....
TEST..XML_Input_1: Unable to resolve prefix 'xs'.
pattern = '/xs:schema/xs:element/xs:complexType/xs:sequence/xs:element/xs:complexType/xs:attribute'(Unknown URI, 15, 143)
Remaining tokens: ('/')
Thanks
Kumar
Hi,
this is namespace i load from the table defination.
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
Thanks
Kumar
this is namespace i load from the table defination.
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
Thanks
Kumar
hi,
I have 'XSD' layout with column attributes like this:....................
<xs:element name="Cart" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="HC_ID" form="unqualified" type="xs:string" />
<xs:attribute name="STATUS" form="unqualified" type="xs:string" />
And i have main 'XML' metadata like this ..............
<?xml version="1.0"?>
<CompressableData>
<PMxml><ProductsAndRelations xmlns="http://tempuri.org/ProductsAndRelations.xsd">
<Cart HC_ID="-9" PKG_HC_ID="0" CONTRACT="" FID_NAME="193" QUANTITY="1" STATUS="Void" ACTION="10" HC_CATEGORY="" HC_SUB_CATEGORY=""
Can any one please suggest how to proceed with this kind of data,because i have put 'XML' data in UNIX box but i cannot understand how to read the data and how to load the columns in datastage,,when i try to load through table defination i am not getting all the field names like regular XML tree,,so my main question is how to load columns and how to read the data from the 'XML' metadata which i kept in UNIX box.
I have 'XSD' layout with column attributes like this:....................
<xs:element name="Cart" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="HC_ID" form="unqualified" type="xs:string" />
<xs:attribute name="STATUS" form="unqualified" type="xs:string" />
And i have main 'XML' metadata like this ..............
<?xml version="1.0"?>
<CompressableData>
<PMxml><ProductsAndRelations xmlns="http://tempuri.org/ProductsAndRelations.xsd">
<Cart HC_ID="-9" PKG_HC_ID="0" CONTRACT="" FID_NAME="193" QUANTITY="1" STATUS="Void" ACTION="10" HC_CATEGORY="" HC_SUB_CATEGORY=""
Can any one please suggest how to proceed with this kind of data,because i have put 'XML' data in UNIX box but i cannot understand how to read the data and how to load the columns in datastage,,when i try to load through table defination i am not getting all the field names like regular XML tree,,so my main question is how to load columns and how to read the data from the 'XML' metadata which i kept in UNIX box.
It "looks" like you have xml inside of xml...meaning...you have a very primitve document called "CompressableData" with one element called PMxml, and it contains itself.....another xml document. It's an interesting technique that comes up once in awhile, most often when people want to pass complete xml documents as arguments inside another protocol which is itself also xml (such as SOAP). That's why you see all the escaped stuff (<).
Use two XMLInput Stages. Separate them with a Transformer, just in case some confusions occur with xpath laying around (clear out the Description property on the output link of the intermediate Transformer).
Your first XMLInput Stage will just have one column. PXxml. Give it a longvarchar and some long length that will pick up the whole document that it contains. Put /CompressableData/PXxml/text() in the Description on the output link of your XMLInput Stage (for now I will assume that you know how to pick up this xml document from disk or message queue and feed it into XMLInput)
Then in your second XMLInput Stage you will use the "actual" metadata that has Contract and Quantity and Status and all those other pieces of information.
Probably try to debug this separately first. Have one job with the first xmlInput Stage that writes the output to a file. Once you have that working, then build a job that gets the saved xml content parsed correctly...then put them together.
Ernie
Use two XMLInput Stages. Separate them with a Transformer, just in case some confusions occur with xpath laying around (clear out the Description property on the output link of the intermediate Transformer).
Your first XMLInput Stage will just have one column. PXxml. Give it a longvarchar and some long length that will pick up the whole document that it contains. Put /CompressableData/PXxml/text() in the Description on the output link of your XMLInput Stage (for now I will assume that you know how to pick up this xml document from disk or message queue and feed it into XMLInput)
Then in your second XMLInput Stage you will use the "actual" metadata that has Contract and Quantity and Status and all those other pieces of information.
Probably try to debug this separately first. Have one job with the first xmlInput Stage that writes the output to a file. Once you have that working, then build a job that gets the saved xml content parsed correctly...then put them together.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
hi Ernie,
Its qiute complex job ernie, and also this is my first time dealing with XML data.
I am reading the file as single row, but the question is how to add the fields...i mean i should add the fields manually, because when i import the table defination i am not able to read fields in a tree like regular XML file, so how to add the particular fields and how data can parse into different fields.
Its qiute complex job ernie, and also this is my first time dealing with XML data.
I am reading the file as single row, but the question is how to add the fields...i mean i should add the fields manually, because when i import the table defination i am not able to read fields in a tree like regular XML file, so how to add the particular fields and how data can parse into different fields.
Please read again my prior entry. If the data coming in looks like you have pasted, then it is one xml document "inside" the other....you need two xml stages...one after the other in succession.
Ernie
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
hi,
I did exactly as you mentioned my job is like this...
folder-XMLInput-XMLinput-Trasformer-Seqfile.
i read file in a single row in first input stage and i pass it on to second input stage and in the output of second XML input stage i manually added the fields ("description for output is /CompressableData/PXxml/text()")and trying to run the job then i am getting this error
Abnormal termination of stage TEST..XML_Input_1 detected
I did exactly as you mentioned my job is like this...
folder-XMLInput-XMLinput-Trasformer-Seqfile.
i read file in a single row in first input stage and i pass it on to second input stage and in the output of second XML input stage i manually added the fields ("description for output is /CompressableData/PXxml/text()")and trying to run the job then i am getting this error
Abnormal termination of stage TEST..XML_Input_1 detected