whitespace causes incorrect XSL conversion of eml2beta6 to eml2 in <unit>
The attribute dialogs in Morpho 1.4 allowed a researcher to enter a freetext
'unit' for typing a specific data column for tabular data. Morpho 1.4 seems to
introduce a leading whitespace in the value of the unit tag like:
On XSL transformation using $MORPHO_HOME/xsl/eml2attr.xsl, the unit value is
compared to the standard unit dictionary that ships with EML2.0.0. If the
standard unit name is found, a <standardUnit> tag is created with the previous
value. If not, the default is to produce a <customUnit> tag.
Because of the introduced leading whitespace, ' ton' != 'ton', and therefore an
orphaned <customUnit> ton</customUnit> tag is generated, with no reference to
it's STMML unit definition.
Updated by Chris Jones almost 19 years ago
In order to do correct comparisons of STMML unit dictionary strings with
units that have incorrectly introduced leading or trailing whitespace, I've
used the normalize-space() XSLT function to strip the offending whitespace
in an otherwise identifiable unit string.