Subject: Re: [xsl] I wrote an XSLT program that converts a mapping XML file into a large, powerful XSLT program From: "Lizzi, Vincent vincent.lizzi@xxxxxxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Wed, 30 Oct 2024 17:01:57 -0000 |
Hi Roger, This sounds like really useful generalized solution! It also shows benefits of doing up analysis and tooling work up front. Thank you for sharing! Does the mapping file have a way to express things that might be context or content dependent, such as variations in how a particular element may have been used (or misused) in different ways? Best regards, Vincent _____________________________________________ Vincent M. Lizzi Head of Information Standards | Taylor & Francis Group vincent.lizzi@xxxxxxxxxxxxxxxxxxxx<mailto:vincent.lizzi@xxxxxxxxxxxxxxxxxxxx> Information Classification: General From: Piez, Wendell A. (Fed) wendell.piez@xxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Sent: Wednesday, October 30, 2024 11:55 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] I wrote an XSLT program that converts a mapping XML file into a large, powerful XSLT program Hey Roger -- You are so right about XSLT as a transpiler and support framework for DSLs. All the files in an OSCAL release, such as https://github.com/usnistgov/OSCAL/releases/tag/v1.1.2<https://github.com/usn istgov/OSCAL/releases/tag/v1.1.2>, are produced using XSLT. (Currently. That may change!) This includes XSDs, JSON Schemas, and XSLTs. Look at src/metaschema in that repository if you wish to see the transformation sources. Regards, Wendell -----Original Message----- From: Roger L Costello costello@xxxxxxxxx<mailto:costello@xxxxxxxxx> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list-service@xxxxxxxxxxxx rytech.com>> Sent: Wednesday, October 30, 2024 7:46 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: [xsl] I wrote an XSLT program that converts a mapping XML file into a large, powerful XSLT program Hi Folks, I created an XML file (a "mapping file") that describes how to convert a legacy XML format into a new XML format. To implement the conversion, I used a pipeline approach. The first step is an XSLT program that converts the mappings (in the mapping file) into a bunch of template rules, one template rule per mapping. In other words, the output of the first XSLT program is another XSLT program. (Cool! Dynamically generated XSLT program) The second step ran the generated XSLT program on a legacy XML file to produce XML in the new format. Here are some statistics on file sizes: Size of the mapping file: 383 KB Size of the XSLT program that converts the mappings (in the mapping file) to template rules: 154 KB Size of the XSLT program that was generated: 204622 KB <-- Huge! Lesson Learned: With a good description document (e.g., a good mappings document) and a few lines of XSLT code, you can dynamically generate a huge XSLT program that can do an enormous amount of work. I love this approach to programming. It harkens back to my time writing parsers and compilers. /Roger
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] I wrote an XSLT program t, Piez, Wendell A. (Fe | Thread | Re: [xsl] I wrote an XSLT program t, Dimitre Novatchev dn |
Re: [xsl] I wrote an XSLT program t, Piez, Wendell A. (Fe | Date | Re: [xsl] I wrote an XSLT program t, Dimitre Novatchev dn |
Month |