XQuery

Viewing 1 reply thread
  • Author
    Posts
    • #20599

      I am trying to return a taskid from the following

      declare @xmltask xml
      set @xmltask = ‘<tasks  xmlns=”http://iTask/task.xsd“>
                                 <task>                           
                                  <taskid>371</taskid>
                                 </task>
                                <tasks>
      select task.ref.value(‘(taskid/text())[1]’,’nvarchar(50)’) as taskid
      from @xmlTask.nodes(‘/tasks/task’) task(ref)

      it returns 371 only if I remove the namespace. how can I make if work it with the namespace

    • #20603

      Dunno if this helps any, but if I were using with XPath, it would be like this:

      //*[local-name()=”taskid”]

      I have found that when namespaces are involved, I need to use the local-name() function because standard XPath like //taskid doesn’t work.

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