Windows Server - Assign Value to XML Element using XPATH in orchestration

Asked By K on 26-Jan-09 10:39 AM
The problem is silly and i'm stuck on it for a while now. i've tried
following criteraias but for some reason i'm not able to get this to work.
the schema i'm dealing with is a Oracle Generated schema whcih calls a SP in
Oracle.  The field can't be promoted or distinguished becase BT believes that
this NODE can occur multiple times even though i know i'm creating &
expecting only 1 record in/From ORACLE.

CUD any1 pls help me poiting what i'm missing?

I', trying to assign a value to one of the Text Element whcih is always
available in the XML.

1.  Using Absolute/FULL Path
xpath(msgOraCreateTicket,

2. xpath(msgOraCreateTicket, "//*[local-name()='PW_EMAIL']") =



3. xpath(msgOraCreateTicket, "//PW_EMAIL") = "firstname.lastname@server.com";


in all cases i'm getting this error based on the type of expression used....

The XPath expression
'/ESMSTicketCreateRequestRequest/Operation1/ESMS_CREATE_TICKET/Parameters/PW_EMAIL'
selected a node which is not valid for property or distinguished field
retrieval, or it selected no node at all.

The XPath expression '//*[local-name()='PW_EMAIL']' selected a node which is
not valid for property or distinguished field retrieval, or it selected no
node at all. Only text-only elements or attributes may be selected.




Dan Rosanova replied on 28-Jan-09 08:08 PM
Hi,
You can either go into the schema that was generated by the oracle
adapter and set the node that "can repeat but doesn't" to have a max
occurence of 1, which will then allow promotion.  Or you can add a [1]
to your xpath so it knows which node you explicitly want.  You may
also need to put a string() around the xpath, but I think that's only
for reading.  There is also the option of text() in the xpath at the
end, but again I don't think you need it.

Kind Regards,
-Dan
K replied on 26-Jan-09 11:26 AM
OK I generated instance of my schema and got a schema and found that
Operation1 is Unbounded.

xmlns:ns0="http://schema.hdsupply.com/Biztalk/ESMSCreateTicketORA">








SO PW_EMAIL needs to be extracted using array[1] i think.... i'm going to
try that and see if that works....

something like this
xpath(msgOraCreateTicket,


Biztalk Beginner
K replied on 26-Jan-09 03:37 PM
ok as i expected previously i was missing something tiny.
one of the node, 'Parameters',  was set to Max Occurs = Unbound and thats
why i had to use the actual position and index value of the element.. i was
just not setting it right.


so this is how it was done eventually.

xpath(msgOraCreateTicket,
// "firstname.lastname@server.com";
xpath(msgOraCreateTicket,
strSubject; // "COmputer is Not Connected to Network";



i did read thru Stephen's response to someother post...Thanks Dan for ur
reponse....appreciate it.