Wrox Programmer Forums
|
BOOK: Beginning XSLT and XPath : Transforming XML Documents and Data
This is the forum to discuss the Wrox book Beginning XSLT and XPath : Transforming XML Documents and Data by Ian Williams ISBN: 978-0-470-47725-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning XSLT and XPath : Transforming XML Documents and Data section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 15th, 2014, 05:54 AM
Registered User
 
Join Date: Nov 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Post Handling Multiple message in XML file

Hi All,

How to parse the multiple message in xml?

When we receive multiple messages in a XML file, xml parser fails translation & consider its an invalid xml.

Input file:

<?xml version="1.0" encoding="UTF-8"?>
<Pip3B12ShippingOrderRequest>
<fromRole>
<PartnerRoleDescription>
<GlobalPartnerRoleClassificationCode/>
<PartnerDescription>
<BusinessDescription>
<GlobalBusinessIdentifier>CUSTOMER</GlobalBusinessIdentifier>
</BusinessDescription>
<GlobalPartnerClassificationCode/>
</PartnerDescription>
</PartnerRoleDescription>
</fromRole>
<GlobalDocumentFunctionCode>Request</GlobalDocumentFunctionCode>
<ShippingOrder>
<OrderInformation>
<orderDateTime>
<DateTimeStamp>20141116T224014</DateTimeStamp>
</orderDateTime>
<orderNumber>
<ProprietaryDocumentIdentifier>0800596734</ProprietaryDocumentIdentifier>
</orderNumber>
</OrderInformation>
<RequestingOrderInformation>
<DocumentReference>
<GlobalDocumentReferenceTypeCode/>
<ProprietaryDocumentIdentifier/>
</DocumentReference>
<GlobalOrderAdminCode>EDI</GlobalOrderAdminCode>
<isOrderToBeMerged>
<AffirmationIndicator/>
</isOrderToBeMerged>
<orderReference>
<ProprietaryDocumentIdentifier/>
<CustomerReference2/>
<CustomerReference3/>
<CustomerReference4/>
</orderReference>
</RequestingOrderInformation>
<ShipmentInformation>
<freightReference>
<ProprietaryDocumentIdentifier/>
</freightReference>
<freightTotalPhysicalDimension>
<PhysicalDimension>
<WeightDimension unit-of-measure=""/>
</PhysicalDimension>
</freightTotalPhysicalDimension>
<Instructions>
<notes>
<FreeFormText/>
</notes>
<ShipmentInstructions1/>
<ShipmentInstructions2/>
<ProprietaryShippingInstructionsCode/>
</Instructions>
<isDutyPaidByShipper>
<AffirmationIndicator>Y</AffirmationIndicator>
</isDutyPaidByShipper>
<RoutingInformation>
<GlobalFreightPaymentTermsCode>UN</GlobalFreightPaymentTermsCode>
<GlobalShippingServiceLevelCode>NBDP5</GlobalShippingServiceLevelCode>
<SequenceNumber/>
<transportedBy>
<PartnerDescription>
<BusinessDescription>
<GlobalBusinessIdentifier/>
</BusinessDescription>
<GlobalPartnerClassificationCode/>
</PartnerDescription>
</transportedBy>
</RoutingInformation>
<shipFrom>
<PartnerDescription>
<BusinessDescription/>
<GlobalPartnerClassificationCode/>
<PhysicalLocation>
<PartnerLocationIdentification>
<ProprietaryDomainIdentifier/>
<ProprietaryLocationIdentifier>T1</ProprietaryLocationIdentifier>
</PartnerLocationIdentification>
<PhysicalAddress>
<GlobalCountryCode>JP</GlobalCountryCode>
</PhysicalAddress>
</PhysicalLocation>
</PartnerDescription>
</shipFrom>
<shipTo>
<PartnerDescription>
<BusinessDescription>
<businessName>
<FreeFormText>Osaka</FreeFormText>
</businessName>
<GlobalBusinessIdentifier>0000222213</GlobalBusinessIdentifier>
</BusinessDescription>
<ContactInformation>
<contactName>
<FreeFormText/>
</contactName>
<facsimileNumber>
<CommunicationsNumber/>
</facsimileNumber>
<telephoneNumber>
<CommunicationsNumber/>
</telephoneNumber>
</ContactInformation>
<GlobalPartnerClassificationCode/>
<PhysicalLocation>
<PhysicalAddress>
<addressLine1>
<FreeFormText>Osaka</FreeFormText>
</addressLine1>
<addressLine2>
<FreeFormText>GLP 7F, 2-4-43 Nanko Suminoe-ku</FreeFormText>
</addressLine2>
<addressLine3>
<FreeFormText/>
</addressLine3>
<addressLine4>
<FreeFormText/>
</addressLine4>
<addressLine5>
<FreeFormText/>
</addressLine5>
<cityName>
<FreeFormText>Osaka-City, Osaka</FreeFormText>
</cityName>
<GlobalCountryCode>JP</GlobalCountryCode>
<NationalPostalCode>559-0032</NationalPostalCode>
<regionName>
<FreeFormText/>
</regionName>
</PhysicalAddress>
</PhysicalLocation>
</PartnerDescription>
</shipTo>
</ShipmentInformation>
<ShipmentLineItem>
<GlobalProductUnitOfMeasureCode>EA</GlobalProductUnitOfMeasureCode>
<isContainsHazardousMaterial>
<AffirmationIndicator/>
</isContainsHazardousMaterial>
<LineNumber>000001</LineNumber>
<productDescription>
<TextualDescription>
<detail>
<FreeFormText>ASSY,BSM,FIELDREPLACEMENT,REFURB</FreeFormText>
</detail>
<summary>
<FreeFormText/>
</summary>
</TextualDescription>
</productDescription>
<ProductIdentification>
<GlobalProductIdentifier>0030-1485R</GlobalProductIdentifier>
</ProductIdentification>
<QuantityInformation>
<requestedQuantity>
<ProductQuantity>00001</ProductQuantity>
</requestedQuantity>
</QuantityInformation>
<RequestingOrderLineItemReference>
<DocumentReference>
<GlobalDocumentReferenceTypeCode/>
<ProprietaryDocumentIdentifier/>
<LineType>P</LineType>
<LineItemPriceList/>
<LineItemUnitPrice>0.00</LineItemUnitPrice>
</DocumentReference>
<subLineNumber>
<LineNumber/>
<LotReference>
<requestedLot>
<ProprietaryLotIdentifier/>
</requestedLot>
</LotReference>
<ManufacturerProfile>
<productSerialIdentifier>
<ProprietarySerialIdentifier/>
</productSerialIdentifier>
</ManufacturerProfile>
</subLineNumber>
</RequestingOrderLineItemReference>
<LineItemReference>
<LineReference1/>
<LineReference2/>
<LineReference3/>
</LineItemReference>
</ShipmentLineItem>
</ShippingOrder>
<thisDocumentGenerationDateTime>
<DateTimeStamp>20141116T224014</DateTimeStamp>
</thisDocumentGenerationDateTime>
<thisDocumentIdentifier>
<ProprietaryDocumentIdentifier/>
<MessageProperties>
<SystemID>PA2</SystemID>
<TransactionPurpose>A</TransactionPurpose>
<MessageType>SOR</MessageType>
<MessageVersion>1.0</MessageVersion>
</MessageProperties>
<MessageSummary>
<TotalOfLineItemValues>0.00</TotalOfLineItemValues>
<TotalOrderValue>0.00</TotalOrderValue>
<TotalLineItems>00001</TotalLineItems>
</MessageSummary>
</thisDocumentIdentifier>
<toRole>
<PartnerRoleDescription>
<GlobalPartnerRoleClassificationCode/>
<PartnerDescription>
<BusinessDescription>
<GlobalBusinessIdentifier/>
</BusinessDescription>
<GlobalPartnerClassificationCode/>
</PartnerDescription>
</PartnerRoleDescription>
</toRole>
</Pip3B12ShippingOrderRequest>
<Pip3B12ShippingOrderRequest>
<fromRole>
<PartnerRoleDescription>
<GlobalPartnerRoleClassificationCode/>
<PartnerDescription>
<BusinessDescription>
<GlobalBusinessIdentifier>CUSTOMER</GlobalBusinessIdentifier>
</BusinessDescription>
<GlobalPartnerClassificationCode/>
</PartnerDescription>
</PartnerRoleDescription>
</fromRole>
<GlobalDocumentFunctionCode>Request</GlobalDocumentFunctionCode>
<ShippingOrder>
<OrderInformation>
<orderDateTime>
<DateTimeStamp>20141116T224014</DateTimeStamp>
</orderDateTime>
<orderNumber>
<ProprietaryDocumentIdentifier>0800596734</ProprietaryDocumentIdentifier>
</orderNumber>
</OrderInformation>
<RequestingOrderInformation>
<DocumentReference>
<GlobalDocumentReferenceTypeCode/>
<ProprietaryDocumentIdentifier/>
</DocumentReference>
<GlobalOrderAdminCode>EDI</GlobalOrderAdminCode>
<isOrderToBeMerged>
<AffirmationIndicator/>
</isOrderToBeMerged>
<orderReference>
<ProprietaryDocumentIdentifier/>
<CustomerReference2/>
<CustomerReference3/>
<CustomerReference4/>
</orderReference>
</RequestingOrderInformation>
<ShipmentInformation>
<freightReference>
<ProprietaryDocumentIdentifier/>
</freightReference>
<freightTotalPhysicalDimension>
<PhysicalDimension>
<WeightDimension unit-of-measure=""/>
</PhysicalDimension>
</freightTotalPhysicalDimension>
<Instructions>
<notes>
<FreeFormText/>
</notes>
<ShipmentInstructions1/>
<ShipmentInstructions2/>
<ProprietaryShippingInstructionsCode/>
</Instructions>
<isDutyPaidByShipper>
<AffirmationIndicator>Y</AffirmationIndicator>
</isDutyPaidByShipper>
<RoutingInformation>
<GlobalFreightPaymentTermsCode>UN</GlobalFreightPaymentTermsCode>
<GlobalShippingServiceLevelCode>NBDP5</GlobalShippingServiceLevelCode>
<SequenceNumber/>
<transportedBy>
<PartnerDescription>
<BusinessDescription>
<GlobalBusinessIdentifier/>
</BusinessDescription>
<GlobalPartnerClassificationCode/>
</PartnerDescription>
</transportedBy>
</RoutingInformation>
<shipFrom>
<PartnerDescription>
<BusinessDescription/>
<GlobalPartnerClassificationCode/>
<PhysicalLocation>
<PartnerLocationIdentification>
<ProprietaryDomainIdentifier/>
<ProprietaryLocationIdentifier>T1</ProprietaryLocationIdentifier>
</PartnerLocationIdentification>
<PhysicalAddress>
<GlobalCountryCode>JP</GlobalCountryCode>
</PhysicalAddress>
</PhysicalLocation>
</PartnerDescription>
</shipFrom>
<shipTo>
<PartnerDescription>
<BusinessDescription>
<businessName>
<FreeFormText>Osaka</FreeFormText>
</businessName>
<GlobalBusinessIdentifier>0000222213</GlobalBusinessIdentifier>
</BusinessDescription>
<ContactInformation>
<contactName>
<FreeFormText/>
</contactName>
<facsimileNumber>
<CommunicationsNumber/>
</facsimileNumber>
<telephoneNumber>
<CommunicationsNumber/>
</telephoneNumber>
</ContactInformation>
<GlobalPartnerClassificationCode/>
<PhysicalLocation>
<PhysicalAddress>
<addressLine1>
<FreeFormText>Osaka</FreeFormText>
</addressLine1>
<addressLine2>
<FreeFormText>GLP 7F, 2-4-43 Nanko Suminoe-ku</FreeFormText>
</addressLine2>
<addressLine3>
<FreeFormText/>
</addressLine3>
<addressLine4>
<FreeFormText/>
</addressLine4>
<addressLine5>
<FreeFormText/>
</addressLine5>
<cityName>
<FreeFormText>Osaka-City, Osaka</FreeFormText>
</cityName>
<GlobalCountryCode>JP</GlobalCountryCode>
<NationalPostalCode>559-0032</NationalPostalCode>
<regionName>
<FreeFormText/>
</regionName>
</PhysicalAddress>
</PhysicalLocation>
</PartnerDescription>
</shipTo>
</ShipmentInformation>
<ShipmentLineItem>
<GlobalProductUnitOfMeasureCode>EA</GlobalProductUnitOfMeasureCode>
<isContainsHazardousMaterial>
<AffirmationIndicator/>
</isContainsHazardousMaterial>
<LineNumber>000001</LineNumber>
<productDescription>
<TextualDescription>
<detail>
<FreeFormText>ASSY,BSM,FIELDREPLACEMENT,REFURB</FreeFormText>
</detail>
<summary>
<FreeFormText/>
</summary>
</TextualDescription>
</productDescription>
<ProductIdentification>
<GlobalProductIdentifier>0030-1485R</GlobalProductIdentifier>
</ProductIdentification>
<QuantityInformation>
<requestedQuantity>
<ProductQuantity>00001</ProductQuantity>
</requestedQuantity>
</QuantityInformation>
<RequestingOrderLineItemReference>
<DocumentReference>
<GlobalDocumentReferenceTypeCode/>
<ProprietaryDocumentIdentifier/>
<LineType>P</LineType>
<LineItemPriceList/>
<LineItemUnitPrice>0.00</LineItemUnitPrice>
</DocumentReference>
<subLineNumber>
<LineNumber/>
<LotReference>
<requestedLot>
<ProprietaryLotIdentifier/>
</requestedLot>
</LotReference>
<ManufacturerProfile>
<productSerialIdentifier>
<ProprietarySerialIdentifier/>
</productSerialIdentifier>
</ManufacturerProfile>
</subLineNumber>
</RequestingOrderLineItemReference>
<LineItemReference>
<LineReference1/>
<LineReference2/>
<LineReference3/>
</LineItemReference>
</ShipmentLineItem>
</ShippingOrder>
<thisDocumentGenerationDateTime>
<DateTimeStamp>20141116T224014</DateTimeStamp>
</thisDocumentGenerationDateTime>
<thisDocumentIdentifier>
<ProprietaryDocumentIdentifier/>
<MessageProperties>
<SystemID>PA2</SystemID>
<TransactionPurpose>A</TransactionPurpose>
<MessageType>SOR</MessageType>
<MessageVersion>1.0</MessageVersion>
</MessageProperties>
<MessageSummary>
<TotalOfLineItemValues>0.00</TotalOfLineItemValues>
<TotalOrderValue>0.00</TotalOrderValue>
<TotalLineItems>00001</TotalLineItems>
</MessageSummary>
</thisDocumentIdentifier>
<toRole>
<PartnerRoleDescription>
<GlobalPartnerRoleClassificationCode/>
<PartnerDescription>
<BusinessDescription>
<GlobalBusinessIdentifier/>
</BusinessDescription>
<GlobalPartnerClassificationCode/>
</PartnerDescription>
</PartnerRoleDescription>
</toRole>
</Pip3B12ShippingOrderRequest>



Is there anyway we can parse the xml file & process it.

Please suggest.

Thanks,
Praveen.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Merging multiple xml files into a single xml file Pauletta XSLT 4 April 18th, 2012 10:13 AM
Combine multiple xml files to create one xml file jonnyuk3 XSLT 6 March 29th, 2012 11:51 AM
How can I handle multiple XML declarations in XML File gkrishna.tibco XSLT 2 November 17th, 2010 09:49 AM
handling multiple input xml feeds stolte XSLT 5 March 3rd, 2010 06:21 PM
Multiple input xml / get data from other xml file elayaraja.s XSLT 3 July 25th, 2008 06:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.