|
Home > Archive > BizTalk Server Orchestration > February 2006 > Modifying XML within Orchestration
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 |
Modifying XML within Orchestration
|
|
| Namshub 2006-02-06, 5: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
| |
| Greg Forsythe 2006-02-06, 5: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
>
| |
| Namshub 2006-02-06, 5: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...
>
>
| |
| Greg Forsythe 2006-02-07, 2: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...
>
>
|
|
|
|
|