This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

double indirection with keys?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]