style/textIndexer/common/preFilterCommon.xsl get-dc-meta template bug

15 views
Skip to first unread message

Steven D. Majewski

unread,
Jun 18, 2013, 5:24:33 PM6/18/13
to xtf-...@googlegroups.com

We don't use the .dc.xml files for metadata with our ead files, so I'm not completely sure about this, 
(or sure about the diagnosis) but I think I found a bug while stepping thru the Oxygen debugger for another problem. 

Since the change in the EAD textindexer to handle schema valid files and strip namespaces,
many of the templates are operating on the modified node tree in variable $dtdVersion rather
than directly on the actual input file. 

In template:  get-dc-meta in file: style/textIndexer/common/preFilterCommon.xsl, 
   <xsl:variable name="docpath" select="saxon:system-id()"/>

saxon:system-id() seems to be called with that variable as the current context and returns a null or empty value,
so the following lines attempting to construct a  .dc.xml file path are failing. 

This can be fixed by moving the resolution of the pathname outside outside of that template:


+
+   <xsl:param name="rootdocpath" select="base-uri(/)" />
+
    <!-- Fetch meta-data from a Dublin Core record, if present -->
    <xsl:template name="get-dc-meta">
-      <xsl:variable name="docpath" select="saxon:system-id()"/>
+      <xsl:variable name="docpath" select="$rootdocpath"/>
       <xsl:variable name="base" select="replace($docpath, '(.*)\.[^\.]+$', '$1')"/>
       <xsl:variable name="dcpath" select="concat($base, '.dc.xml')"/>
       <xsl:if test="FileUtils:exists($dcpath)">



I used base-uri(/) instead of saxon:system-id() . 
Why saxon:system-id() in the original instead of base-uri() ? 

-- Steve Majewski / UVA Alderman Library

Reply all
Reply to author
Forward
0 new messages