XML help

(imported topic written by jpeppers91)

Is there a way to nest these two?

node values of child nodes of selects “/XpediteConfig/BranchName” of xml document of file “C:\Sierra Xpedite\PRD_XP_Front\Data\xFrontCounterConfig.xml” as trimmed string

node values of child nodes of selects “/XpediteConfig/BranchName” of xml document of file “C:\Sierra Xpedite\PRD_XP_Back\Data\xFrontCounterConfig.xml” as trimmed string

(imported comment written by NoahSalzman)

What do you want the desired output to look like?

(imported comment written by jpeppers91)

Currently each individual relevance returns the Branch Name of the XML. I want to test both and if one is true return the Branch Name instead of creating separate properties for each.

(imported comment written by NoahSalzman)

You mean something like this? This assumes that it is OK to immediately end the process of checking branches if the first branch is found.

if

(the first branch exists)

then

(return the branch name)

else if

(the other branch exists)

then

(return the other branch name)

else

(return “nothing found”)

That is pseudo-code, of course.

(imported comment written by jpeppers91)

Will this work parsing an xml?

(imported comment written by NoahSalzman)

“IF/THEN/ELSE” works with anything in relevance, XML included. You just need to make sure your IF clauses return true/false values.

Here is an example of how it might look. You may need to tweak this a little depending on the exact behavior you desire. Also, this snippet assumes that the files are always present.

if

(exists node values of child nodes of selects “/XpediteConfig/BranchName” of xml document of file “C:\Sierra Xpedite\PRD_XP_Front\Data\xFrontCounterConfig.xml”)

then

(node values of child nodes of selects “/XpediteConfig/BranchName” of xml document of file “C:\Sierra Xpedite\PRD_XP_Front\Data\xFrontCounterConfig.xml” as trimmed string)

else if

(exists node values of child nodes of selects “/XpediteConfig/BranchName” of xml document of file “C:\Sierra Xpedite\PRD_XP_Back\Data\xFrontCounterConfig.xml”)

then

(node values of child nodes of selects “/XpediteConfig/BranchName” of xml document of file “C:\Sierra Xpedite\PRD_XP_Back\Data\xFrontCounterConfig.xml” as trimmed string)

else

“nothing found”