Convert language HTML to genericode


Table of Contents

1. Convert language HTML to genericode - Crane-language2gc.xsl
1.1. Main logic for columns and rows
2. Common functionality for code list conversion - Crane-common4codelists.xsl
2.1. Invocation parameters
2.2. Main logic
2.3. Identification manipulation logic
2.4. ODS table, row and cell access
3. Index

Import/include tree (in order of importance; reverse import order)

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

1. Convert language HTML to genericode - Crane-language2gc.xsl

Filename: Crane-language2gc.xsl

Import statement:

$Id: Crane-language2gc.xsl,v 1.5 2017/09/22 17:01:09 admin Exp $

Convert an instance of country code HTML (converted to XML) from http://www.loc.gov/standards/iso639-2/php/code_list.php to OASIS genericode using metadata supplied by the list of lists.

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. Main logic for columns and rows

The input is the HTML already converted to XML (as if by Tidy) as a well-formed XML document with no DOCTYPE and no named entities.

c:version(0) as="xsd:string" (xsl:function)

Return a version value

c:columnsAndRows (xsl:template)

Create the columns and rows as needed.

Parameter filtered as="xsd:boolean"

Indication that the columns and rows are to be filtered. For this code list there is no filtering.

2. Common functionality for code list conversion - Crane-common4codelists.xsl

Path: Crane-common4codelists.xsl

$Id: Crane-common4codelists.xsl,v 1.5 2019/03/24 01:19:21 admin Exp $

Support the suite of stylesheets converting code lists to genericode.

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.

2.1. Invocation parameters

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

Where to open the list of lists?

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

Which of the lists in the lists of lists is being created?

indent="yes" (xsl:output)

Indent the results

2.2. Main logic

match="/" (xsl:template)

Check nothing is wrong with the inputs and then invoke the generation process once or twice (twice if there is also filtered output).

2.3. Identification manipulation logic

c:version(0) as="xsd:string" (xsl:function)

Return a version value placebo to be overridden by invoking ss

match="text()" mode="c:identification" priority="1" (xsl:template)

Replace all occurrences of $VERSION in a text string

match="@*|node()" mode="c:identification" (xsl:template)

Preserve all other nodes

2.4. ODS table, row and cell access

c:columnNumbers(1) as="xsd:integer+" (xsl:function)

Return a cell's column numbers as a sequence

Parameter cell as="element(table:table-cell)"

The cell to calculate the number of

c:cellValue(1) as="xsd:string" (xsl:function)

Return a cell's text value

Parameter cell as="element(table:table-cell)?"

The cell to calculate the value of

3. Index

C L O V

C

L

O

V