Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,17 @@ Would you like to overwrite the existing file or 

create a new file? (o=overwrite, n=new)"
validargs="o,n"
defaultvalue="n"/>

<!-- If overwriting, we'll make sure a backup is created first
in case something goes wrong. -->
<if>
<equals arg1="${outputStrategy}" arg2="o"/>
<then>
<copy file="${ssBaseDir.converted}/${ssConfig}" tofile="${ssBaseDir.converted}/${ssConfig}.BAK"/>
<echo message="A backup of your config file has been created: ${ssBaseDir.converted}/${ssConfig}.BAK"/>
</then>
</if>

<!--<echo message="${outputStrategy}"/>-->
<java classpath="${ssSaxon}" classname="net.sf.saxon.Transform" failonerror="true" fork="true">
<arg value="-xsl:${ssBaseDir.converted}/xsl/convert_v1_to_v2.xsl"/>
Expand Down
16 changes: 10 additions & 6 deletions xsl/convert_v1_to_v2.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -245,21 +245,24 @@
<xd:desc>Function to create boolean string values from unreliable or absent input.</xd:desc>
<xd:param name="input" as="item()?">May be an element, attribute, or text node
which contains the original value if it exists.</xd:param>
<xd:param name="default" as="xs:string">The default value to use if the input does
<xd:param name="default" as="xs:boolean">The default value to use if the input does
not provide anything usable.</xd:param>
</xd:doc>
<xsl:function name="hcmc:getStrBoolean" as="xs:string">
<xsl:param name="input" as="item()?"/>
<xsl:param name="default" as="xs:string"/>
<xsl:param name="default" as="xs:boolean"/>
<xsl:choose>
<xsl:when test="$input and matches($input, $reBooleanTrue, 'i')">
<xsl:sequence select="'true'"/>
</xsl:when>
<xsl:when test="$input and matches($input, $reBooleanFalse, 'i')">
<xsl:sequence select="'false'"/>
</xsl:when>
<xsl:when test="$default">
<xsl:sequence select="'true'"/>
</xsl:when>
<xsl:otherwise>
<xsl:sequence select="$default"/>
<xsl:sequence select="'false'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>
Expand All @@ -268,14 +271,15 @@
<xd:desc>Function to create string values from unreliable or absent input.</xd:desc>
<xd:param name="input" as="item()?">May be an element, attribute, or text node
which contains the original value if it exists.</xd:param>
<xd:param name="default" as="xs:string">The default value to use if the input does
<xd:param name="default" as="xs:string?">The default value to use if the input does
not provide anything usable.</xd:param>
</xd:doc>
<xsl:function name="hcmc:getString" as="xs:string">
<xsl:param name="input" as="item()?"/>
<xsl:param name="default" as="xs:string"/>
<xsl:param name="default" as="xs:string?"/>
<xsl:message select="xs:string($input)"/>
<xsl:choose>
<xsl:when test="$input and string-length($input) gt 0">
<xsl:when test="xs:string($input) and string-length($input) gt 0">
<xsl:sequence select="xs:string($input)"/>
</xsl:when>
<xsl:otherwise>
Expand Down