[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Loading an external file of index

Subject: Loading an external file of index
From: Pierre Attar <patt@xxxxxxxxx>
Date: Thu, 22 Jun 2000 09:55:45 +0200
xsl load external xml
Hi,

I have a lot fo files that are using a shared common index for managing references. Something like :

1) lot of files with contents like :

<xmlfile><p>Here I want to define the <keyref linkend="xml"/> standard</p></xmlfile>

2) an other file called shared.xml with :

<keysbase>
<key name="xml"><acronym>xml</acronym><title>eXtended Markup Language</title></key>
<key name="xsl"><acronym>xsl</acronym><title>eXtended Style Sheet Language</title></key>
</keysbase>



What I want to do is, while formatting my xml files to HTML, is to load first the shared.xml file for getting as a set of keys in order to be able to use it for formatting all files.


In XSL T, it is something like :

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
        <xsl:output method="html" indent="no"/>

<xsl:template match="/">
<xsl:apply-templates select="document('../shared/shared.xml')"/>
<xsl:apply-templates/>
</xsl:template>


....

<xsl:template match="keyref">
<b><xsl:value-of select="key('mysetofkeys',@name)/ACRONYM"/></b>
</xsl:template>


....

</xsl:stylesheet >

My problem is that the standard says that the <xsl:key> declaration needs to be at the top root node level of a stylesheet and that at this time, the key elements coming from the imported file are unknown.

So, the question is where do I declare <xsl:key name="mysetofkeys" match="key" use="@name"/> for being able to fill the table with all keys from the imported file ?

Regards,

Pierre

PS : By the way, an other subconsequent question is how is it possible, for debugging purpose, to output the content of a key table ? Something like print(key("mysetofkeys')) ... ?


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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.