BizTalk Server Orchestration - Urgent - xpath problem

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Orchestration > February 2005 > Urgent - xpath problem





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Urgent - xpath problem
Kerry Reynolds

2005-02-22, 2:46 am

I have an urgent problem with an xpath query running on the following document:

<?xml version="1.0" encoding="utf-8"?>
<ns0:AssetsInOrder xmlns:ns0="http://CompleteOrder.Schema.AssetsInOrder">
<AssetGuid>546B302A-0026-483D-A06E-075684F05221</AssetGuid>
<AssetGuid>9114049E-7D5A-4382-945A-2DE5365D4C87</AssetGuid>
</ns0:AssetsInOrder>

I run it through the following expression shape (to iterate through the
items):
xpathString = System.String.Format("//*[local-name()='AssetGuid'][{0}]",
currentAsset);
outputString = xpath(Message_2, xpathString);

But all I get is a "<AssetGuid xmlns=''> was not expected." when it tries
the xpath() part.

Am I missing a patch or something in the query?


The following is the full error raised

Uncaught exception terminated service
Orchestration.CompleteOrder.MainProcess(4d3aa2f1-d9cc-3732-c5d6-bd63769eac59), instance b7c7cdce-9148-4f7f-8c72-625b4d8efd61

There is an error in the XML document.

Exception type: InvalidOperationException
Source: System.Xml
Target Site: System.Object Deserialize(System.Xml.XmlReader, System.String,
System.Xml.Serialization.XmlDeserializationEvents)
Help Link:
Additional error information:

<AssetGuid xmlns=''> was not expected.

Exception type: InvalidOperationException
Source: coigcckv
Target Site: System.Object Read2_string()
Help Link:
Additional error information:

Neal Walters

2005-02-22, 5:50 pm



If you go to your schema, and click on AssetGuid - you will see the complete
and correct Xpath in a property called "Instance Xpath".

/*[local-name()='AssetsInOrder' and
namespace-uri()='http://CompleteOrder.Schema.AssetsInOrder']/*[local-name()='AssetGuid' and namespace-uri()='']

You might also need the "string" parameter as in this example from Biztalk
help:
myString = xpath(msg, "string(/*/book[1]/title)");

So maybe try:
xpathString = System.String.Format("/*[local-name()='AssetsInOrder' and
namespace-uri()='http://CompleteOrder.Schema.AssetsInOrder']/*[local-name()='AssetGuid' and namespace-uri()=''][{0}]",
currentAsset);
outputString = xpath(Message_2, "string(" + xpathString + ")" );


or if you want to use the // the following might work???
xpathString = System.String.Format("//*[local-name()='AssetGuid' and
namespace-uri()=''][{0}]",
currentAsset);

Neal Walters
http://Biztalk-Training.com


"Kerry Reynolds" wrote:

> I have an urgent problem with an xpath query running on the following document:
>
> <?xml version="1.0" encoding="utf-8"?>
> <ns0:AssetsInOrder xmlns:ns0="http://CompleteOrder.Schema.AssetsInOrder">
> <AssetGuid>546B302A-0026-483D-A06E-075684F05221</AssetGuid>
> <AssetGuid>9114049E-7D5A-4382-945A-2DE5365D4C87</AssetGuid>
> </ns0:AssetsInOrder>
>
> I run it through the following expression shape (to iterate through the
> items):
> xpathString = System.String.Format("//*[local-name()='AssetGuid'][{0}]",
> currentAsset);
> outputString = xpath(Message_2, xpathString);
>
> But all I get is a "<AssetGuid xmlns=''> was not expected." when it tries
> the xpath() part.
>
> Am I missing a patch or something in the query?
>
>
> The following is the full error raised
>
> Uncaught exception terminated service
> Orchestration.CompleteOrder.MainProcess(4d3aa2f1-d9cc-3732-c5d6-bd63769eac59), instance b7c7cdce-9148-4f7f-8c72-625b4d8efd61
>
> There is an error in the XML document.
>
> Exception type: InvalidOperationException
> Source: System.Xml
> Target Site: System.Object Deserialize(System.Xml.XmlReader, System.String,
> System.Xml.Serialization.XmlDeserializationEvents)
> Help Link:
> Additional error information:
>
> <AssetGuid xmlns=''> was not expected.
>
> Exception type: InvalidOperationException
> Source: coigcckv
> Target Site: System.Object Read2_string()
> Help Link:
> Additional error information:
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com