Modifying XML within Orchestration
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 > Modifying XML within Orchestration




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

    Modifying XML within Orchestration  
Namshub


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


 
02-06-06 10:53 PM

Hi,

I'm having trouble modifying a couple of attributes within an xmlDocument
that I have created.
I create a messagetype as an xmldocument.  I then after some branching have
to modify the message so i assign it to a xmldocument and tried to use the
following xpath but it prompts me with an error I'm using this with an
message construct and message assignment shapes.

XMLDoc is a system.xml.document
msgXMLDoc is a messagetype of system.xml.document that has already been
generated.


XMLDoc = msgXmlDoc

xpath(XMLDoc,"//PASData/@StatusValue") = "0";

I 'm getting an error say that it must be in the format (document ref,
string_ref) which is what I thought I was doing.

I only need to change 2 attributes and don't really want to do a mapping as
I beleive this could be more intensive (though I could be wrong)

Can anyone help with how to do this?

Cheers







[ Post a follow-up to this message ]



    Re: Modifying XML within Orchestration  
Greg Forsythe


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


 
02-06-06 10:53 PM

You do not need the system.xml.xmldocument variable. The xpath function
works with the message.
i.e.
xpath(msgXMLDoc,"//PASData/@StatusValue") = "0";

Also you will need a fully qualified xpath string, you can get this by
opening the schema, selecting the attribute and copying the xpath from the
properties view.

Greg


"Namshub" <Ricchard.Pullen@Southend.nhs.uk.RemoveMyspam> wrote in message
news:%23oe8ka1KGHA.2320@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> I'm having trouble modifying a couple of attributes within an xmlDocument
> that I have created.
> I create a messagetype as an xmldocument.  I then after some branching
> have to modify the message so i assign it to a xmldocument and tried to
> use the following xpath but it prompts me with an error I'm using this
> with an message construct and message assignment shapes.
>
> XMLDoc is a system.xml.document
> msgXMLDoc is a messagetype of system.xml.document that has already been
> generated.
>
>
> XMLDoc = msgXmlDoc
>
> xpath(XMLDoc,"//PASData/@StatusValue") = "0";
>
> I 'm getting an error say that it must be in the format (document ref,
> string_ref) which is what I thought I was doing.
>
> I only need to change 2 attributes and don't really want to do a mapping
> as I beleive this could be more intensive (though I could be wrong)
>
> Can anyone help with how to do this?
>
> Cheers
>







[ Post a follow-up to this message ]



    Re: Modifying XML within Orchestration  
Namshub


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


 
02-06-06 10:53 PM

Hi
I tried this but it said that i tried to modify the message after it had
been constructed.  (This error is thrown after deployment)

The message branches but in one instance I get a status that is not 0, but
due to the rules i can rest the value back.

I think i tried to do a shortcut as he same messagetype can then go out on
the same port.

The intial file is delimited string, that is enriched.  The XML that is
created is from an externall Dll,  (I enrich the message and submit it back
as an string), so there is no schema associated with the xml.  Its then
loaded into a system.xml.xmldocument  which is then sent to a MSMQ.

Could you explain this;
> Also you will need a fully qualified xpath string, you can get this by
> opening the schema, selecting the attribute and copying the xpath from the
> properties view.

Thanks

"Greg Forsythe" <greg.forsythe@gmail.com> wrote in message
news:%23txINA2KGHA.648@TK2MSFTNGP14.phx.gbl...
> You do not need the system.xml.xmldocument variable. The xpath function
> works with the message.
> i.e.
> xpath(msgXMLDoc,"//PASData/@StatusValue") = "0";
>
> Also you will need a fully qualified xpath string, you can get this by
> opening the schema, selecting the attribute and copying the xpath from the
> properties view.
>
> Greg
>
>
> "Namshub" <Ricchard.Pullen@Southend.nhs.uk.RemoveMyspam> wrote in message
> news:%23oe8ka1KGHA.2320@TK2MSFTNGP11.phx.gbl... 
>
>







[ Post a follow-up to this message ]



    Re: Modifying XML within Orchestration  
Greg Forsythe


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


 
02-07-06 07:48 AM

Biztalk messages are immutable, they cannot be changed once they are
constructed
If you need to change a message then you need to create a copy of the
message and modify the copy within a MessageAssignment shape of  a Construct
Message shape.
i.e. where the constructed message is outputMessage:

outputMessage = msgXMLDoc;
xpath(outputMessage,"//PASData/@StatusValue") = "0";

And send outputMessage to MSMQ.

A fully qualified xpath string must specify all namespace information
e.g. "//*[local-name()='PASData' and namespace-uri() =
'your:namespace']/@*[local-name() = 'StatusValue' and namespace-uri()=''
]"

This assumes you are using namespaces

Greg

"Namshub" <Ricchard.Pullen@Southend.nhs.uk.RemoveMyspam> wrote in message
news:%234Q1G22KGHA.744@TK2MSFTNGP09.phx.gbl...
> Hi
> I tried this but it said that i tried to modify the message after it had
> been constructed.  (This error is thrown after deployment)
>
> The message branches but in one instance I get a status that is not 0, but
> due to the rules i can rest the value back.
>
> I think i tried to do a shortcut as he same messagetype can then go out on
> the same port.
>
> The intial file is delimited string, that is enriched.  The XML that is
> created is from an externall Dll,  (I enrich the message and submit it
> back as an string), so there is no schema associated with the xml.  Its
> then loaded into a system.xml.xmldocument  which is then sent to a MSMQ.
>
> Could you explain this; 
>
> Thanks
>
> "Greg Forsythe" <greg.forsythe@gmail.com> wrote in message
> news:%23txINA2KGHA.648@TK2MSFTNGP14.phx.gbl... 
>
>







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:01 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