- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
NIFI Reading value in XML node
- Labels:
-
Apache NiFi
Created on ‎06-15-2023 11:21 PM - edited ‎06-15-2023 11:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have the following xml:
<?xml version="1.0" encoding="UTF-8"?><ns1:SalesOrderMessages mlns:ns1="http://corpintra.net/pi/CBFC_GLOBAL_SAP_APPL/SalesOrder" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <SalesOrder> <MessageProcessingInformation> <SendingSystemID>SMS_0175</SendingSystemID> </MessageProcessingInformation> <Header> <SalesDocumentType>YPO0</SalesDocumentType> <SalesOrganization>7002</SalesOrganization> <DistributionChannel>00</DistributionChannel> <RequestedDeliveryDate>2023-06-15</RequestedDeliveryDate> <CustomerPurchaseOrderDate>2023-06-15</CustomerPurchaseOrderDate> <Incoterms1>EXW</Incoterms1> <Incoterms2>Ex Works</Incoterms2> <PaymentTerms>E007</PaymentTerms> <CustomerPurchaseOrderNumber>990831 </CustomerPurchaseOrderNumber> <ReferenceDocumentNumber>SI-000000614</ReferenceDocumentNumber> <ServicesRenderedDate>2023-06-15</ServicesRenderedDate> <LogisticData> <SourceReferenceDocumentNumber>SI-000000614</SourceReferenceDocumentNumber> <SourceSalesOrderNumber>SO-000050562</SourceSalesOrderNumber> </LogisticData> </Header> <Items> <ItemNumber>10</ItemNumber> ............
I need to read the node value "ReferenceDocumentNumber", which is "SI-000000614"
But this is not helping. I tried with addng "/@ReferenceDocumentNumber". Please guide me here
Created ‎06-16-2023 06:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The path you specified seems to be correct according to the XML you provided. Since you did not provide the full XML I was only able to test it on the following:
<?xml version="1.0" encoding="UTF-8"?>
<SalesOrder>
<MessageProcessingInformation>
<SendingSystemID>SMS_0175</SendingSystemID>
</MessageProcessingInformation>
<Header>
<SalesDocumentType>YPO0</SalesDocumentType>
<SalesOrganization>7002</SalesOrganization>
<DistributionChannel>00</DistributionChannel>
<RequestedDeliveryDate>2023-06-15</RequestedDeliveryDate>
<CustomerPurchaseOrderDate>2023-06-15</CustomerPurchaseOrderDate>
<Incoterms1>EXW</Incoterms1>
<Incoterms2>Ex Works</Incoterms2>
<PaymentTerms>E007</PaymentTerms>
<CustomerPurchaseOrderNumber>990831 </CustomerPurchaseOrderNumber>
<ReferenceDocumentNumber>SI-000000614</ReferenceDocumentNumber>
<ServicesRenderedDate>2023-06-15</ServicesRenderedDate>
<LogisticData>
<SourceReferenceDocumentNumber>SI-000000614</SourceReferenceDocumentNumber>
<SourceSalesOrderNumber>SO-000050562</SourceSalesOrderNumber>
</LogisticData>
</Header>
</SalesOrder>
and I was able to get the ReferenceDocumentNumber using the Path:
/SalesOrder/Header/ReferenceDocumentNumber
Notice I had to remove the following line because I was getting Parsing Error:
<ns1:SalesOrderMessages mlns:ns1="http://corpintra.net/pi/CBFC_GLOBAL_SAP_APPL/SalesOrder" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
What are you seeing exactly? Are you seeing an error or the value is not populated in the FileName attribute ? Can you please provide more info on that?
Thanks
