Closed gsautter closed 2 years ago
Also, Line 46 (
) is a bit finicky, as the docSource attribute can very well also contain the URL that a article was downloaded from ... it might be safer to go for the DOI in the MODS header.
see #34
Problem apply-templates doesn't seem to work (compile) in XSLT 1 if the select attribute evaluates to a string (Lines 42-46). Also, I cannot seem to spot which template this is supposed to defer to ... sure this shouldn't simply be a value-of instead of an apply-templates?
@gsautter I'm not seeing a problem. Could you describe what errors you are encountering? I'm expecting the behavior of the XSLT built-in template rule is to output the text of a text node in the absence of a specific template in the stylesheet.
@gsautter I'm not seeing a problem. Could you describe what errors you are encountering? I'm expecting the behavior of the XSLT built-in template rule is to output the text of a text node in the absence of a specific template in the stylesheet.
Java's on-board Xalan engine basically complains "Error checking type of the expression 'com.sun.org.apache.xalan.internal.xsltc.compiler.ApplyTemplates@select
attribute of apply-templates
...
So, since you expect a plain string in the output anyway, could you just use value-of
instead of apply-templates
?
Yes, I see now that in oxygen using xalan (not saxon) I get an error:
System ID: C:\Users\Terry\Github\ggxml2taxpub-treatments\xslt\gg2tp_l1.xsl
Scenario: gg2tp_l1
XML file: C:\Users\Terry\Github\ggxml2taxpub-treatments\ggxml\0A1D87A8FF3AFF51FDCEFD32FEEFFC4A.xml
XSL file: C:\Users\Terry\Github\ggxml2taxpub-treatments\xslt\gg2tp_l1.xsl
Engine name: Xalan (Deprecated)
Severity: fatal
Description: Can not convert #STRING to a NodeList!
I'll change to value-of
seems to be working now on ggserver. See:
seems to be working now on ggserver. See:
That looks pretty good indeed, thanks. Also loads nicely in my local test.
Also got the pretty printing in place (https://github.com/plazi/ggxml2taxpub-treatments/issues/29), so I should be able to roll this out in the search portal in tonight's maintenance window.
seems to be working now on ggserver. See:
Now also available as https://tb.plazi.org/GgServer/taxPubL1/21095E52CF76C310FE5556E8609BEC92 (and any other treatment as well).
@tcatapano thanks for making those changes so quickly. Really happy to have this one sorted out.
Subject: https://github.com/plazi/ggxml2taxpub-treatments/blob/main/xslt/gg2tp_l1.xsl
Problem
apply-templates
doesn't seem to work (compile) in XSLT 1 if theselect
attribute evaluates to a string (Lines 42-46). Also, I cannot seem to spot which template this is supposed to defer to ... sure this shouldn't simply be avalue-of
instead of anapply-templates
?Also, Line 46 (
<uri content-type="publication-doi"><xsl:apply-templates select="//document/@docSource"/></uri>
) is a bit finicky, as thedocSource
attribute can very well also contain the URL that a article was downloaded from ... it might be safer to go for the DOI in the MODS header.