Page 1 of 1

XML Input Stage

Posted: Wed Jan 10, 2007 10:19 am
by seethamsetty
Hello,

Can any one help on the following problem.

Requirement : Xml File To Table or XML file to XML

I tried using sequential stage -> XML Input Stage - Table / Sequential file
Ver 7.5.1A PX Job


I tried using Folder Stage -> XML Input Stage - Sequential file in Server job Ver 7.5.1.A


Records are moving from Sequential stage or Folder stage to XML Input Stage in both jobs BUT the are not processed from XML Input to upstream.

Can any one help on XML Input Stage.

Will be greate if any throw some light on this , and if possible send a sample job to email:. seethamsetty@hotmail.com

Thanks

Posted: Wed Jan 10, 2007 11:41 pm
by Kirtikumar
If the records are not moving outside XML then that is the problem of XPaths defined in the XML stage.

Providing XML you are reading and XPaths used for columns would be useful to understand the problem and suggest solution. See if there is any diff in the XPaths and XML tags.

This problem is normally the problem in Xpaths. Any errors or warnings in the Director?

Posted: Tue Jan 16, 2007 12:03 pm
by seethamsetty
1. It is Reading the File from Folder Stage.
2. XML Input Stage , Metadata is imported from XML File .
3. But no out is generated.

XPaths are the same that are generated from xml file while loading the columns in output.

Does xpath differ from the originally generated from import.

Kindly help

XMLInput Does not send data out

Posted: Tue Jan 16, 2007 12:16 pm
by seethamsetty
Hi!,

Here is the XML File and Name spaces that i have declared.

[b]Name Space Delcaration :[/b]
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:defns="http://www.naxml.org/Retail-EDI/Vocabulary/2003-10-16"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"


[b]XML File :[/b]

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <NAXML-BusDoc xmlns="http://www.naxml.org/Retail-EDI/Vocabulary/2003-10-16" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.naxml.org/Retail-EDI/Vocabul ... oice15.xsd" version="1.5">
- <TransmissionHeader>
<TransmissionId>200610041033163</TransmissionId>
<TransmissionDate>2006-10-04</TransmissionDate>
<TransmissionTime>10:33:16</TransmissionTime>
<TransmissionStatus actionType="original" />
</TransmissionHeader>
- <Parties>
- <Supplier>
<Name identType="Customer Vendor Number" ident="99400">MCLANE COMPANY</Name>
</Supplier>
- <Buyer>
<Name identType="Customer Chain Number" ident="425">CHEVRON</Name>
</Buyer>
</Parties>
- <Invoice>
- <Supplier>
<Name identType="Customer Vendor Number" ident="99400">MCLANE</Name>
</Supplier>
- <Location>
<Name identType="Customer Store Number" ident="001483">CHEVRON #1483</Name>
</Location>
<InvoiceNumber>0500282791</InvoiceNumber>
<InvoiceDate>2006-10-03</InvoiceDate>
<Currency code="USD" />
- <InvoiceDetail>
- <LineItem count="1">
- <InvoiceUnit>
<InvoiceUnitId identType="VIN">515478</InvoiceUnitId>
<InvoiceUnitDescription>ARROWHEAD SPRING WTR</InvoiceUnitDescription>
<InvoiceUnitQty cstoreUOMBasis="CA">3</InvoiceUnitQty>
<InvoiceUnitCost currency="USD">7.45</InvoiceUnitCost>
<Taxes taxable="No" />
<LineItemGrossAmt identType="Debit" currency="USD">22.35</LineItemGrossAmt>
<LineItemNetAmt identType="Debit" currency="USD">22.35</LineItemNetAmt>
</InvoiceUnit>
- <RetailUnitPricing>
<RetailUnitId identType="GTIN">071142008582</RetailUnitId>
<RetailUnitQty identType="GTIN" ident="007114207859" UOMBasis="EA">24</RetailUnitQty>
<RetailPrice currency="USD">0.89</RetailPrice>
</RetailUnitPricing>
</LineItem>
- <LineItem count="2">
- <InvoiceUnit>
<InvoiceUnitId identType="VIN">296525</InvoiceUnitId>
<InvoiceUnitDescription>ARRWHD MTN SPRNG WTR</InvoiceUnitDescription>
<InvoiceUnitQty cstoreUOMBasis="CA">4</InvoiceUnitQty>
<InvoiceUnitCost currency="USD">6.14</InvoiceUnitCost>
<Taxes taxable="No" />
<LineItemGrossAmt identType="Debit" currency="USD">24.56</LineItemGrossAmt>
<LineItemNetAmt identType="Debit" currency="USD">24.56</LineItemNetAmt>
</InvoiceUnit>
- <RetailUnitPricing>
<RetailUnitId identType="GTIN">071142000050</RetailUnitId>
<RetailUnitQty identType="GTIN" ident="007114205005" UOMBasis="EA">6</RetailUnitQty>
<RetailPrice currency="USD">1.69</RetailPrice>
</RetailUnitPricing>
</LineItem>
- <LineItem count="3">
- <InvoiceUnit>
<InvoiceUnitId identType="VIN">645408</InvoiceUnitId>
<InvoiceUnitDescription>ARRWHD MTN SPRNG .5 LTR</InvoiceUnitDescription>
<InvoiceUnitQty cstoreUOMBasis="CA">4</InvoiceUnitQty>
<InvoiceUnitCost currency="USD">5.96</InvoiceUnitCost>
<Taxes taxable="No" />
<LineItemGrossAmt identType="Debit" currency="USD">23.84</LineItemGrossAmt>
<LineItemNetAmt identType="Debit" currency="USD">23.84</LineItemNetAmt>
</InvoiceUnit>
- <RetailUnitPricing>
<RetailUnitId identType="GTIN">071142001262</RetailUnitId>
<RetailUnitQty identType="GTIN" ident="007114205126" UOMBasis="EA">4</RetailUnitQty>
<RetailPrice currency="USD">1.99</RetailPrice>
</RetailUnitPricing>
</LineItem>
- <InvoiceSummary>
<InvoiceSubTotals />
- <InvoiceTotals>
<TotalInvoiceUnits count="3" />
<TotalLineItemNetAmt identType="Debit" currency="USD">8522.04</TotalLineItemNetAmt>
- <AllowanceOrCharge>
<AllowanceOrChargeReason identType="SERVICE" quantity="1" />
<ChargeAmt currency="USD">3.4</ChargeAmt>
</AllowanceOrCharge>
<TotalWeight UOMBasis="Pounds">0</TotalWeight>
<TotalTaxes />
<TotalInvoiceDueAmt identType="Debit">8522.04</TotalInvoiceDueAmt>
</InvoiceTotals>
</InvoiceSummary>
</InvoiceDetail>
</Invoice>
</NAXML-BusDoc>


Xpaths used are the same that are generated from XML File using Metadata importer.

Hope this helps to understand the problem.

Thanks in advance.

Posted: Tue Jan 16, 2007 2:35 pm
by eostic
Hi...

I don't know what it is exactly, as I haven't had time to debug it in detail, but I was able to reproduce your issue with only a snippet of the xml, and got it to work by removing the dash in the highest level element
NAXML-BusDoc.

It may not be related at all, but once I removed the dash from the source xml and my XPath, I started retriving the elements and attributes I expected.

Ernie

Posted: Tue Jan 16, 2007 2:56 pm
by chulett
I was assuming the 'dash' was some sort of artifact of the cut-and-paste operation from whatever was used to view the XML and not actually in the file itself. :?

Posted: Tue Jan 16, 2007 3:31 pm
by seethamsetty
So I can try it by changing NAXML-BusDoc to NAXMLBusDoc
and removing making the xpath also NAXML-BusDoc.

Am i correct as per our discussion thread

Posted: Tue Jan 16, 2007 4:07 pm
by chulett
Oh, that dash. For some reason I was fixating on the leading dashes some lines have...

Posted: Tue Jan 16, 2007 4:09 pm
by seethamsetty
I have removed the Dash (ie ,NAXMLBusDoc) from the source XML and tried to import the columns and check.

But still data is not flowing through.

Is there any thing i need to set other than this.

Thanks in advace

Posted: Wed Jan 17, 2007 9:43 pm
by eostic
Yes --- Craig --- you were right too --- the xml content in the thread above was probably cut/pasted from a browser. Indeed those are "extra" dashes in front.

This one is strange. Hard to say what the actual problem might be. I smelled a rat when the document (on my machine at least) also hangs Internet Explorer. After trying various things, I was able to read at least one element of the document successfully (well --- I get 3000 + rows of data! :) ) after entirely removing all the namespace info from the initial element, using an external editor.

Is it some value deep in the document? Is it some conflict with the namespace info or specification? Is it just "this" document, or all of them that come from this application? Hard to say. My suggestion to move forward would be to see if the author can leave out the namespaces, or else perhaps try removing them using DS before the string enters the XML Input Stage.

Ernie

Posted: Wed Jan 17, 2007 10:16 pm
by ray.wurlod
Does the mention of a Folder stage indicate that this is really a server job?

Posted: Wed Jan 17, 2007 10:56 pm
by chulett
They seem to have tried both with no joy.

Posted: Thu Jan 18, 2007 1:05 am
by rameshrr3
Seetham :Is the namespace declaration copied from the sample XML file? Also if you are posting XML, suggest you use the 'view source' option in IE, to copy the xml text rather than directly copying from browser window.

Posted: Thu Jan 18, 2007 7:44 am
by eostic
He sent me the actual xml document in a separate email. It truly is strange. I've seen some oddities with XML in the past...checking against other "instances" of this document is a good idea, to see if it's something specific in one given set of data. Beyond that, it could be any number of things.

As XML has matured, I'm seeing odd things with the standards less and less, but there have been numerous occasions in the past where a document didn't quite work right because of a standards or structure issue. In those cases it sometimes came down to "how the vendor interprets the standard" (the standards aren't as rigid in some areas as we might expect). ...and the "vendor" in this case could be the author of the document, DataStage, or the open source Apache xerces parser that DataStage uses. Good luck trying to get through that maze and having vendors point fingers at each other to figure it out. You could be a hero, and figure out some very esoteric things about XML, but will have spent many days getting there. Ah, I digress. Perhaps it's not a standards problem at all.

Assuming it's not just this one instance of the document that is somehow corrupted, it may be best to edit the file programmatically as needed, and get the data you need from it (can you say "punt"? :) ).

Let us know if the job I sent you was "supposed" to retrieve some 3000+ invoice lines. If so, it will be a starting point for you.

Ernie

Posted: Thu Jan 18, 2007 2:44 pm
by seethamsetty
Ernie,

Thanks for your extended help. I have tried in server job it is working and need to checke the record count.

Thanks a lots