RE: [xsl] cross document id idref pair checks

Subject: RE: [xsl] cross document id idref pair checks
From: DPawson@xxxxxxxxxxx
Date: Tue, 9 Jan 2001 15:47:56 -0000
> > <xsl:template match="par/a">
> > <xsl:variable name="x" select="substring-after(@href,'#')"/>
> > <xsl:for-each select="document(substring-before(@href,'#'))">
> >   <xsl:if test="id($x)/parent::par">
> >     yes
> > 
> 
> yes, thats it. 
> 
> id()/axis ! Thats a first for me!


Except it isn't, because I'm not using ID, I'm using id... if that makes
sense :-)
<xsl:variable name="ref" select="substring-after(@href,'#')"/>
<xsl:variable name="smil-file-el" 
  select="document(@href)/smil/body//*[@id=$ref]"/>
<xsl:variable name="lineNo" select="saxon:lineNumber()"/>
<xsl:for-each select="$smil-file-el">
  <xsl:if test="not(name()='par' or name()='text')">
TN 76: Line <xsl:value-of select="$lineNo"/>.  <xsl:value-of
select="$msg/TN76"/></xsl:if>
</xsl:for-each>

eventually did it.

Which leaves me with another problem.

When using well formed, as apposed to valid, input,
How to use the fact that a node-set removes duplicates to
check if there is more than one attribute named 'id'?

count(id(@id)) would be ideal, except... as above :)
[Damn, I knew there was a use for DTD's]

Regards DaveP





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread