I have added judgement document type support to the translator .. and
everything is working fine.
I just have a small problem. From within the minixslt template i am
unable to access XPaths in the global metalex document ...
for e.g. in the judgement ref.xsl, i cannot access the //root/@id
xpath ... it always returns blank (not just for that one... but for
anything else outside @name='ref' ...
<xsl:template match="*[@name='ref']">
......
<xsl:variable name="rootId" select="//root/@id" />
......
</xsl:template>
Am i missing something ? How do i access global xpaths from the minixslt ?
Ashok
I have added judgement document type support to the translator .. and
everything is working fine.
Here you go ...
In the ref.xsl for the judgement -- i am processing references
selectively ... in the example below i am filtering by @class and
generating a <party> element ... all that works fine.
<xsl:template match="*[@name='ref']">
.....
<xsl:when test="@class='BungeniPartyName'">
<party>
<!-- we use the tokenize() function to extract the refersTo attrib
from the reference href the id is a generated one -->
<xsl:variable name="strHref"><xsl:value-of select="@href"
/></xsl:variable>
<xsl:variable name="tokenizedHref" select="tokenize($strHref,';')"/>
<xsl:variable name="metadataRefRole"
select="//meta[@id='$tokenizedHref[1]']/@inrole" />
<xsl:attribute name="id">
<xsl:value-of select="generate-id()" />
</xsl:attribute>
<xsl:attribute name="refersTo">
<xsl:text>#</xsl:text><xsl:value-of select="$tokenizedHref[1]" />
</xsl:attribute>
<xsl:attribute name="as">
<xsl:text>#</xsl:text><xsl:value-of select="$metadataRefRole" />
</xsl:attribute>
<xsl:value-of select="."/>
</party>
</xsl:when>
the problematic part is this line :
<xsl:variable name="metadataRefRole"
select="//meta[@id='$tokenizedHref[1]']/@inrole" />
I try to get the inrole attribute of the meta[@id=something]
element (which is not in the matched node ... but is part of the meta
block of the metalex xml document... however this always returns an
empty...
After a bit of testing i realized this happens for every node outside
the matched node ..... why is this happening ?
is the minixslt applied only on the matched node ?
xsl:exclude-result-prefixes="#all"
to the element using the global xpath variable ... otherwise it emits
the metalex namespace attribute in the output AN document.
Ashok