We have xml documents that contain lots of flagged nodes like isProduct, isActive , isMandatory where the node text may be True or False.
It is needed to manipulate the documents and keep their structure but convert the above nodes into a verbal representation like below:
< isProduct >True</ isProduct > ===> <Type>Product<Type>
< isProduct >False</ isProduct > ===> <Type/>
And the same for other flag nodes.
We are seeking an extensible and scalable solution that can be configured with minimum friction after deployment.
By extensible; we mean that there will be more cases; like 2 flags that represent a status; i.e. isEmployee and isCustomer is used in the document to represent 4 different named things.; hence the 4 possible combinations should only be translate into one string like "Employee", "Customer", "Customer-Employee" or "None"
By scalable; we mean that it can be used to process any XML document without a prior understanding of its schema and no restriction on the document size
We do understand that this might be done using XSLT, can we write an XSLT that an accept any document and produce the same document with additional nodes added or update ?