You are viewing limited content. For full access, please sign in.

Question

Question

Workflow Read XML Activity not working?

asked on November 8, 2021 Show version history
<repository xmlns="http://laserfiche.com/namespaces/cr/" version="1.1" app="admin.10.2">
  <props xmlns="http://laserfiche.com/namespaces/cr/" version="1.1" app="admin.10.2" onconflict="CO">
    <pset id="106" name="HR-CHI - HR Memo" description="" color="" />
    <pset id="107" name="HR-Chronology" description="" color="" />
    <pset id="108" name="HR-Clearance Form" description="" color="" />
  </props>
</repository>

Referencing the XML snippet, I am trying to find the elements with name attributes that contain "HR-" using the workflow layout in the image.

I ran the workflow and both the Find and Retrieve activities work. It is the Read XML that is having issues.

The XML Source for the Read XML activity is:
     %(RetrieveDocumentText_Text)

The XPATH expression that I am using is:
     repository/props/pset[contains(@name,'HR-')]/@name

I am using sites like https://www.freeformatter.com/xpath-tester.html to verify that both XML document and XPATH expression are valid.

When I use the tester inside the expression editor token, the result is blank.

The XPATH documentation on https://www.laserfiche.com/support/webhelp/Laserfiche/10/en-US/administration/#../Subsystems/LFWorkflow/Content/Resources/Activities/ReadXML.htm%3FTocPath%3DWorkflow%7CWorkflow%2520Designer%7CBuilding%2520Workflows%2520and%2520Business%2520Processes%7CActivities%7CH-R%7C_____13  states that Workflow only supports XPATH 1.0. I checked and confirmed to the best of my ability that the expression that I made is in XPATH 1.0.

I am stuck.

Any ideas to get the activity to actually function?

0 0

Answer

SELECTED ANSWER
replied on November 9, 2021

That's because your XML has namespaces. So you would have to indicate that you want to ignore the namespace.

Something like this might work:

/*[local-name()='repository']/*[local-name()='props']/*[local-name()='pset'][contains(@name,'HR-')]/@name

(courtesy of this thread)

1 0
replied on November 9, 2021

It worked!

Thank you for providing the reference as well. It took me abit to understand but it wasn't as intimidating as it seemed.

0 0
replied on November 9, 2021 Show version history

@████████would you mind if I ask a follow-up question?

I was having trouble getting this to work on the full xml file(instead of the small xml example I included in the post).

The Read XML activity couldn't read the .xml source file being provided.

I made a copy of the source file but saved it as a .txt file this time and it worked.

Would you happen to be able to explain why?

0 0
replied on November 9, 2021

How were you providing the XML doc? Was it still from Retrieve Document Text?

How big was the source doc?

0 0
replied on November 10, 2021

Yes I am using the Retrieve Document Text activity. Should I be using the Download Electronic Document activity?

The XML file size is 82KB.

I exported the XML file from the Admin Console and saved the file (as an XML) in the Web Repository client before running the Workflow layout pictured above.

 

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.