Error - Only text-only elements or attributes may be selected.

Error:

The XPath expression '/*[local-name()='OrderCanonical' and namespace-uri()='http://Order.Common.Schemas.SalesOrderCanonical']/*[local-name()='SalesOrder' and namespace-uri()='']/*[local-name()='Header' and namespace-uri()='']/*[local-name()='DCNumber' and namespace-uri()='']' selected a node which is not valid for property or distinguished field retrieval, or it selected no node at all. Only text-only elements or attributes may be selected.

Solution:

To resolve this issue  follow the steps outlined below:

Check Input Message:

First, ensure that the input message contains the field you are trying to retrieve, in this case, the 'DCNumber' field. If the 'DCNumber' field is not present in the input message, the XPath expression will fail. Verify the structure and content of the input message to confirm the presence of the 'DCNumber' field.

Map a Dummy Value:

If the 'DCNumber' field is missing in the input message, you can resolve the XPath error by mapping a dummy value to the 'DCNumber' field. 

For example, you can assign a dummy value like 'N/A' or 'Not Available' to the 'DCNumber' field in the input message.

Message Assignment using XPath:

After mapping the dummy value to the 'DCNumber' field, attempt the message assignment using XPath again. 


Comments

Popular posts from this blog

EDI X12 Trading partner configuration in BizTalk

How to create an EDI 850 profile in Boomi?

Basics of Correlation in BizTalk