Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Assign Value to XML Element using XPATH in orchestration

1,259 views
Skip to first unread message

KK

unread,
Jan 26, 2009, 10:39:01 AM1/26/09
to
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,
"/ESMSTicketCreateRequestRequest/Operation1/ESMS_CREATE_TICKET/Parameters/PW_EMAIL") = "firstname...@server.com";

2. xpath(msgOraCreateTicket, "//*[local-name()='PW_EMAIL']") =
"firstname...@server.com";

3. xpath(msgOraCreateTicket, "//PW_EMAIL") = "firstname...@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

unread,
Jan 26, 2009, 11:21:33 AM1/26/09
to
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

KK

unread,
Jan 26, 2009, 11:26:01 AM1/26/09
to
OK I generated instance of my schema and got a schema and found that
Operation1 is Unbounded.

<ns0:ESMSTicketCreateRequestRequest
xmlns:ns0="http://schema.hdsupply.com/Biztalk/ESMSCreateTicketORA">
<ns0:Operation1>
<ns0:ESMS_CREATE_TICKET>
<ns0:Parameters>
<ns0:PW_TICKET_TYPE>PW_TICKET_TYPE_0</ns0:PW_TICKET_TYPE>
<ns0:PW_CREATED_BY>PW_CREATED_BY_0</ns0:PW_CREATED_BY>
<ns0:PW_BRANCH_NUMBER>PW_BRANCH_NUMBER_0</ns0:PW_BRANCH_NUMBER>
<ns0:PW_LOGIN_ID>PW_LOGIN_ID_0</ns0:PW_LOGIN_ID>
<ns0:PW_FIRST_NAME>PW_FIRST_NAME_0</ns0:PW_FIRST_NAME>
<ns0:PW_LAST_NAME>PW_LAST_NAME_0</ns0:PW_LAST_NAME>
<ns0:PW_EMAIL>PW_EMAIL_0</ns0:PW_EMAIL>
<ns0:PW_PHONE>PW_PHONE_0</ns0:PW_PHONE>
<ns0:PW_AFFECTED_ITEM>PW_AFFECTED_ITEM_0</ns0:PW_AFFECTED_ITEM>
<ns0:PW_CATEGORY_NAME>PW_CATEGORY_NAME_0</ns0:PW_CATEGORY_NAME>
<ns0:PW_PRODUCT_NAME>PW_PRODUCT_NAME_0</ns0:PW_PRODUCT_NAME>

<ns0:PW_PROBLEM_TYPE_NAME>PW_PROBLEM_TYPE_NAME_0</ns0:PW_PROBLEM_TYPE_NAME>
<ns0:PW_SEVERITY_ID>100</ns0:PW_SEVERITY_ID>
<ns0:PW_PRIORITY_ID>100</ns0:PW_PRIORITY_ID>

<ns0:PW_ASSIGNMENT_GROUP_NAME>PW_ASSIGNMENT_GROUP_NAME_0</ns0:PW_ASSIGNMENT_GROUP_NAME>
<ns0:PW_SUBJECT>PW_SUBJECT_0</ns0:PW_SUBJECT>
<ns0:PW_DESCRIPTION>PW_DESCRIPTION_0</ns0:PW_DESCRIPTION>

<ns0:PW_CONTACT_METHOD_NAME>PW_CONTACT_METHOD_NAME_0</ns0:PW_CONTACT_METHOD_NAME>
<ns0:PW_SOURCE_NAME>PW_SOURCE_NAME_0</ns0:PW_SOURCE_NAME>
</ns0:Parameters>
<ns0:Parameters>
<ns0:PW_TICKET_TYPE>PW_TICKET_TYPE_0</ns0:PW_TICKET_TYPE>
<ns0:PW_CREATED_BY>PW_CREATED_BY_0</ns0:PW_CREATED_BY>
<ns0:PW_BRANCH_NUMBER>PW_BRANCH_NUMBER_0</ns0:PW_BRANCH_NUMBER>
<ns0:PW_LOGIN_ID>PW_LOGIN_ID_0</ns0:PW_LOGIN_ID>
<ns0:PW_FIRST_NAME>PW_FIRST_NAME_0</ns0:PW_FIRST_NAME>
<ns0:PW_LAST_NAME>PW_LAST_NAME_0</ns0:PW_LAST_NAME>
<ns0:PW_EMAIL>PW_EMAIL_0</ns0:PW_EMAIL>
<ns0:PW_PHONE>PW_PHONE_0</ns0:PW_PHONE>
<ns0:PW_AFFECTED_ITEM>PW_AFFECTED_ITEM_0</ns0:PW_AFFECTED_ITEM>
<ns0:PW_CATEGORY_NAME>PW_CATEGORY_NAME_0</ns0:PW_CATEGORY_NAME>
<ns0:PW_PRODUCT_NAME>PW_PRODUCT_NAME_0</ns0:PW_PRODUCT_NAME>

<ns0:PW_PROBLEM_TYPE_NAME>PW_PROBLEM_TYPE_NAME_0</ns0:PW_PROBLEM_TYPE_NAME>
<ns0:PW_SEVERITY_ID>100</ns0:PW_SEVERITY_ID>
<ns0:PW_PRIORITY_ID>100</ns0:PW_PRIORITY_ID>

<ns0:PW_ASSIGNMENT_GROUP_NAME>PW_ASSIGNMENT_GROUP_NAME_0</ns0:PW_ASSIGNMENT_GROUP_NAME>
<ns0:PW_SUBJECT>PW_SUBJECT_0</ns0:PW_SUBJECT>
<ns0:PW_DESCRIPTION>PW_DESCRIPTION_0</ns0:PW_DESCRIPTION>

<ns0:PW_CONTACT_METHOD_NAME>PW_CONTACT_METHOD_NAME_0</ns0:PW_CONTACT_METHOD_NAME>
<ns0:PW_SOURCE_NAME>PW_SOURCE_NAME_0</ns0:PW_SOURCE_NAME>
</ns0:Parameters>
</ns0:ESMS_CREATE_TICKET>
</ns0:Operation1>
</ns0:ESMSTicketCreateRequestRequest>


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,
"//*[local-name()='Operation1'][1]/*[local-name()='PW_EMAIL'][1]") =
"firstname...@server.com";


Biztalk Beginner

KK

unread,
Jan 26, 2009, 3:37:09 PM1/26/09
to
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,
"//*[local-name()='Parameters'][1]/*[local-name()='PW_EMAIL'][1]") = strFrom;
// "firstname...@server.com";
xpath(msgOraCreateTicket,
"//*[local-name()='Parameters'][1]/*[local-name()='PW_SUBJECT'][1]") =
strSubject; // "COmputer is Not Connected to Network";

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


0 new messages