Skip to main content
Question

using xml configuration file


pruiter
Contributor
Forum|alt.badge.img
Hi all,

 

 

I'm currently working on a project where the customer wants to use an existing configuration xml file, where they can enable / disable custom validations and store some validation properties (such as allowed feature class names).

 

 

I'm struggling to find a proper way to do this, can anyone point me in the right direction?

 

4 replies

david_r
Celebrity
  • April 29, 2013
Hi,

 

 

I have solved the same thing using a Python startup script that reads and parses the XML into a global (Python) dictionary. The dictionary items are then referenced by scripted (Python, again) parameters so that they can be easily referenced in the workspace in e.g. Testers, etc.

 

 

To read and parse the XML configuration, I recommend either xml.minidom or ElementTree.

 

 

It is a little bit of work to implement, but it works very well.

 

 

David

takashi
Influencer
  • April 29, 2013
Hi Serio,

 

 

Alternatively, using Published Parameters and WorkspaceRunner can be another approach. In the main workspace, fetch and use the values which should be determined based on the configuration through Published Parameters. Then make another workspace which reads the xml document with XML reader, parses the configuration by some transformers, passes the parsed values to the main workspace and runs it by WorkspaceRunner.

 

 

Takashi

fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • April 29, 2013
Hi Serio,

 

 

If you mean updating by  " ...enable / disable custom validations and store some validation properties..." The XML updater might be what you are looking for.This demo shows some of the possibilities of the transformer.

 

Hope this helps

 

 


pruiter
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • May 2, 2013
thx for your replies.

 

 

I'm currently working on an implementation using python (Using ElemenTree) to create some Published Parameters as triggers that indicate if a validation should be done or not (just a simple true false).

 

For the validation itself I will probably just use additional python scripts in combination with Testers.

 

 

Serio

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings