Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Using process variables in XPath

Avatar

Former Community Member
I am trying to use a variable (/process_data/@Division) to identify an xml node to determine the person for a task:

/process_data/DivisionRolesXML/divisions/division[Division='string(/process_data/@Division)' and Position='Div Executive']/LDAPId



I get no value returned (e.g. result is 'null'). The log shows that @Division has a string value.



It works if the actual value (not variable) is specified:

/process_data/DivisionRolesXML/divisions/division[Division='division_name' and Position='Div Executive']/LDAPId



Thoughts anyone ?
3 Replies

Avatar

Former Community Member
This is a sample of the xml data (observed in LC log) being referenced by xpath:

<divisions>

<division>

<Division type="varchar">Brakes</Division>

<Position type="varchar">Div Executive</Position>

<LDAPId type="varchar">swf</LDAPId>

</division>

Avatar

Former Community Member
try the following /processData/DivisionRolesXml/divisions/Division

Avatar

Level 9
Hi

I'm reasonably sure that you need to remove the single quotes in your expression. The single quotes mean that your entire sub-clause is being treated as a string, rather than as an expression.

i.e.

...[Division='string(/process_data/@Division)' ...

change to



...[Division=string(/process_data/@Division) ...



Howard

http://www.avoka.com