[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] double indirection with keys?


Subject: [xsl] double indirection with keys?
From: Tobias.Grundmann@xxxxxxxxxxxxxxxxx (Tobias Grundmann)
Date: Fri, 02 Feb 2001 17:23:53 +0100

Hello everybody,

I have the problem to access (actually to test
the existence of) an attribute via doubly linked references.
Ideally this would be done with an xsl:key like the following:
(a key would simplify my code significantly)

<xsl:key name="ttStyle"
match="/office:document/*/style:style/style:properties/@fo:font-name
       [/office:document/office:font-decls/style:font-decl
          [style:font-pitch='fixed']/@style:name=.]"
use="../../@style:name"
/>

But the XPath-Spec seems to indicate that predicates are not allowed
inside predicates. I've also tried to use another key to index the
first one but this doesn't work either.

The relevant pieces of the my source-document 
(from StarOffice-XML):

<office:document>
 <office:font-decls>
  <style:font-decl style:name="Courier" style:font-pitch="fixed"/>
 </office:font-decls>
 <office:automatic-styles>
   <style:style style:name="P4">
    <style:properties style:font-name="Courier"/>
   </style:style>
 </office:automatic-styles>
 <office:body>
  <text:p text:style-name="P4">typewriter</text:p>
 </office:body>
</office:document>

Now, with text:p as context-node, I would like to use 
key(ttStyle,@text:style-name) to test if typewriter 
has a fixed-width font.

Any Ideas?

regards
        Tobias

PS: The use-attribute my be flawed also but I haven't testet it.

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



Current Thread