Skip to content

Perl script to parse a given XSD file, and conforming XML file, and then inject UID attributes into the XML elements, of the Complex Types flagged with a Processor Instruction in the XSD.

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
in
 
 
out
 
 
 
 
xmlInjectUids.pl README

Please see the inline comments for a detailed explanation of the logic.

The script parses a given XSD file, and an accompanying, conforming XML file. If any processor instructions are found in the XSD file, then XML elements of the types flagged are identified, and are given an attribute that stores their enumerated uid.

The purpose of this is to allow the design of data in an object-oriented manner (XML), but then to store the static data in a data-oriented manner at run-time. The linkage is maintained through the uid attribute of XML elements. At run-time, these uids can be used to access data structures indexed by them (e.g. an array).

The files in this repository were created using the following command:
xmlInjectUids.pl --xsdIn ./in/gameXml.xsd --xmlIn ./in/gameConfig.xml --xmlOut ./out/gameConfig.xml

About

Perl script to parse a given XSD file, and conforming XML file, and then inject UID attributes into the XML elements, of the Complex Types flagged with a Processor Instruction in the XSD.

Resources

Releases

No releases published

Packages

No packages published

Languages