Skip to content

Commit 09d5be3

Browse files
committed
Allow passing in the "meta" parameter as a nodeset, rather than via a filename - much easier to use from code
1 parent c637403 commit 09d5be3

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

JATS2CrossRef_web.xsl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,16 @@
3131
indent="yes"
3232
encoding="UTF-8"/>
3333

34-
<xsl:param name="meta" as="xs:string" required="yes"/>
35-
<!-- <xsl:variable name="metafile" select="parse-xml($meta)"/> --> <!-- use this for command line testing/requires saxon 9.3 or greater -->
36-
<xsl:variable name="metafile" select="document($meta)"/> <!-- use this for systemp processing/works with 8.5.1 curently in CS -->
34+
<!-- One of these two fields must be populated -->
35+
<xsl:param name="metaContents" as="node()*" />
36+
<xsl:param name="meta" as="xs:string" select="''"/>
37+
<xsl:variable name="metafile">
38+
<xsl:if test="empty($metaContents) and $meta=''">
39+
<xsl:message terminate="yes">Must specify meta information - either as a nodeset in 'metaContents' or as a filename via 'meta'</xsl:message>
40+
</xsl:if>
41+
<xsl:sequence select="if (not(empty($metaContents))) then $metaContents else document($meta)"/>
42+
</xsl:variable>
43+
3744
<xsl:variable name="date" select="adjust-date-to-timezone(current-date(), ())"/>
3845
<xsl:variable name="time" select="format-time(current-time(),'[H01][m01][s01]')"/>
3946
<xsl:variable name="tempdatetime" select="concat($date,'',$time)"/>

0 commit comments

Comments
 (0)