As an IIQ Developer, you often need to copy XML objects (e.g., Rule, Workflow) and commit them to a Version Control system like GIT. To ensure the XML is clean and free of environment-specific IDs and dates before committing, there are several methods available:
- IIQ Console Export: Use the
--clean=id,created,modified
option. - XML Exporter: Similar cleaning options are available.
However, the most common scenario involves copy-pasting XMLs via Debug Pages, which lacks an automated way to clean environment-specific data. To address this, I have created a short RegEx expression that can be easily used in any IDE’s “Search and Replace” function to remove these attributes from the XML.
RegEx Snippet
Use the following RegEx pattern to remove created
, id
, and modified
attributes along with any trailing spaces:
regex
Copy code
created="\d+" |id="[a-zA-Z0-9]+" |significantModified="\d+" |modified="\d+"
Before Cleaning
Here is an example of XML before executing the regex:
Attributes Detection
Here you can see which attributes were detected by IDE as the ones which should be removed
After Cleaning Detection
Here is the same XML after executing the regex:
This approach ensures that your XML files are clean and ready for safe version control, without carrying over unnecessary environment-specific details