Re: [xsl] Applied attribute error

Subject: Re: [xsl] Applied attribute error
From: "Imsieke, Gerrit, le-tex" <gerrit.imsieke@xxxxxxxxx>
Date: Sat, 22 Jan 2011 14:28:03 +0100
On 22.01.2011 07:03, JS rawat wrote:
Hi Team,
Can anyone help me to find out the error(s) I am doing in the below XSL. I
want to do it by variable methodology by which i am getting<xref ref=""/>.


This is because when processing @rid, the document being processed is the variable $incidence whose root element is sc2. Since there is no fig with, e.g., @id='FileName_fig1' below sc2, key() returns the empty sequence (in XSLT2 terms).


If you are using XSLT2, you may introduce a global variable
  <xsl:variable name="root" select="/" as="document-node(element(doc))" />
and replace
  key('ids',.)
with
  key('ids',., $root)

My general impression is that your stylesheet looks more verbose than necessary, but I didn't look into this very thoroughly.

-Gerrit

Current Thread