Trying to create a build system that processes xml file with an xsl file and provides an output file.
The simplest build example at the command line is as follows:
transform example.xml -xsl:example.xsl -o:out.txt
The SaxonicaHE10.9N is the build I am trying to incorporate since it is license free.
I am open to any ideas that would help make this happen.
I think my biggest stumbling block is passing multiple parameters to the build system and opening the output file after the transformation.
Are there any packages I can leverage?
***example.xml***
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="example.xsl"?>
<Article>
<Title>My Article</Title>
<Authors>
<Author>Mr. Foo</Author>
<Author>Mr. Bar</Author>
</Authors>
<Body>This is my article text.</Body>
</Article>
***example.xsl***
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
Article - <xsl:value-of select="/Article/Title"/>
Authors: <xsl:apply-templates select="/Article/Authors/Author"/>
</xsl:template>
<xsl:template match="Author">
- <xsl:value-of select="." />
</xsl:template>
</xsl:stylesheet>
***out.txt***
Article - My Article
Authors:
- Mr. Foo
- Mr. Bar