Urgent - xpath problem
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server Orchestration > Urgent - xpath problem




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Urgent - xpath problem  
Kerry Reynolds


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-22-05 07:46 AM

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

<?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'][&#
123;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:






[ Post a follow-up to this message ]



    RE: Urgent - xpath problem  
Neal Walters


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-22-05 10: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-nam
e()='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-nam
e()='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 docu
ment:
>
> <?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-bd63769eac
59), 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:
>





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:45 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register