Convert code list master list to Ant


Table of Contents

1. Convert code list master list to Ant - Crane-list2ant.xsl
1.1. Invocation parameters and input file
1.2. Create the output
2. Index

Available invocation parameters ('**' indicates a required parameter)

Available specialization parameter

1. Convert code list master list to Ant - Crane-list2ant.xsl

Filename: Crane-list2ant.xsl

$Id: Crane-list2ant.xsl,v 1.16 2017/09/25 23:16:35 admin Exp $

To automate the process, an Ant script is created from the list of code lists and their sources

Copyright (C) - Crane Softwrights Ltd.
              - http://www.CraneSoftwrights.com/links/res-dev.htm

Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
 this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation 
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors 
may be used to endorse or promote products derived from this software without 
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
POSSIBILITY OF SUCH DAMAGE.


Note: for your reference, the above is the "BSD-3-Clause license"; this text
      was obtained 2017-07-24 at https://opensource.org/licenses/BSD-3-Clause

THE COPYRIGHT HOLDERS MAKE NO REPRESENTATION ABOUT THE SUITABILITY OF THIS
CODE FOR ANY PURPOSE.

1.1. Invocation parameters and input file

The input file is a list of lists of genericode identification elements with indications of how the information is processed.

<lists>
  <list outuri="OutputName-2.2.gc" method="XSD"
        reviewuri="http://www.unece.org/cefact/xml_schemas/index">
   <Identification>
   </Identification>
  </list>
</lists>

The output file is an Ant script to be invoked to create the code list outputs.

raw-uri-prefix required="yes" as="xsd:string" (xsl:param)

Prefix (such as a directory name, including the trailing slash) for raw input file for hand-written.

intermediate-uri-prefix required="yes" as="xsd:string" (xsl:param)

Prefix (such as a directory name, including the trailing slash) for intermediate file generation.

output-uri-prefix required="yes" as="xsd:string" (xsl:param)

Prefix (such as a directory name, including the trailing slash) for output file generation.

c:baseURI as="xsd:string" select="replace(document-uri(/),'((^file:)|([^/]+$))','')" (xsl:variable)

The base URI of the input file

1.2. Create the output

match="/" (xsl:template)

The identity template is used to copy all nodes not already being handled by other template rules.

match="list" priority="2" (xsl:template)

match="list[@method='Copy']" (xsl:template)

Copy the genericode file from the raw directory to the output.

match="list[@method='Country']" (xsl:template)

Convert a country code HTML file to genericode

match="list[@method='Currency']" (xsl:template)

Convert a currency XML file into genericode

match="list[@method='Language']" (xsl:template)

Convert a language HTML file into genericode

match="list[@method='Mime']" (xsl:template)

Convert a unit XML file into genericode

match="list[@method='Packaging']" (xsl:template)

Convert a packaging XLS file into genericode

match="list[@method='Unit']" (xsl:template)

Convert a unit of measurement XLS file into genericode

match="list[@method='XSD']" (xsl:template)

Convert a UN/CEFACT XSD file into genericode

match="list" (xsl:template)

Catch-all for unfinished (or invalid) business

2. Index

B I O R

B

I

O

R