Debatching

Viewing 1 reply thread
  • Author
    Posts
    • #20567

       I have the following xmlmessage I am trying to debatch

      <tasks xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns=”http://iTask/task.xsd“>
        <task>
         <ownerid>Premier</ownerid>
         <taskid>4004</taskid>                                                                                                                                                                         </task>
        <task>
         <ownerid>Premier</ownerid>
         <taskid>5000</taskid>
        </task>
      </tasks>

      When I write the following:

      iRecordCount = System.Convert.ToInt32(xpath(xmlmessage, “count(/*[local-name()=’tasks’ and namespace-uri()=’http://iTask/task.xsd’%5D/*%5Blocal-name()=’task&#8217; and namespace-uri()=’http://iTask/task.xsd’%5D)”));

      iRecordCount gets a 0.

      I thing the problem is with the XPath. Please help.

       

       

    • #20568

      Wonder (?!?),

      It looks as though your XPath is incorrect; I’ve just knocked up a quick schema that looks like the one above and I came out with the following XPath:

      count(/*[local-name()=’tasks’ and namespace-uri()=’http://iTask/task.xsd’%5D/*%5Blocal-name()=’task&#8217; and namespace-uri()=”])

      Notice that the ‘task’ element doesn’t have a namespace-uri (I’m presuming here that your schema has the Element FormDefault setting set to ‘Default’, which is unqualified) – I think this is where you are going wrong.

      HTH, Nick.

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.