RE: Unparsed entities (was RE: Special entity characters in Shift -JIS XSL).

Subject: RE: Unparsed entities (was RE: Special entity characters in Shift -JIS XSL).
From: Jonathan Asbell <jonathana@xxxxxxxxxxxxxx>
Date: Mon, 20 Dec 1999 11:38:31 -0500
Me Too.  I want to put "&nbsp;" elements into the xsl stylesheet.  How do I
do that?  Internal DTD? 

-----Original Message-----
From: Ian Brockbank [mailto:ian@xxxxxxxxxxxxxx]
Sent: Friday, December 17, 1999 5:15 AM
To: 'xsl-list@xxxxxxxxxxxxxxxx'
Subject: RE: Unparsed entities (was RE: Special entity characters in
Shift-JIS XSL).


Hi all,

on a related question to whether a mechanism should be available for
entities to be left unprocessed, how can I include entities in the
stylesheet?  I've tried reading the spec and the XML Bible, and the
only way I've seen to include entities is in the doctype, but the
doctype is surely XSL - can I specify a DOCTYPE in my stylesheet?

The problem I am trying to solve is to generate an index for an API,
where the name of the API is stored in an entity.  I have a stylesheet
which will do the formatting, so I want to generate an xml file to
process with this stylesheet.  So ideally I would use something like:

<?xml version="1.0"?>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

    <xsl:output
	method="xml"
	doctype-system="..\..\docs\dtds\general.dtd"/>

    <xsl:template match="/index">
    <general>
        <title>&API; Index</title>
        <body>
            <P>
            The &API; contains the following functions:
            </P>
            <list>
                <xsl:for-each select="link[function]">
                    <xsl:sort select="apiref"/>
                    <item>
                        <xsl:copy-of select="apiref"/>
                    </item>
                </xsl:for-each>
            </list>
        </body>
    </general>
    </xsl:template>
</xsl:stylesheet>

If I hard-code the &API; it works fine, but if I throw this at xt
it complains about undefined entity &API; (understandable, really).
So how do I go about referencing this entity, defined in the above
DTD, from within the stylesheet?  Alternatively, how do I generate
the entity in my XML output file?

Cheers,

Ian
--
Ian Brockbank, Indigo Active Vision Systems, The Edinburgh Technopole,
Bush Loan, Edinburgh EH26 0PJ   Tel: 0131-475-7234  Fax: 0131-475-7201
work: ian@xxxxxxxxxxxxxx           personal: Ian.Brockbank@xxxxxxxxxxx
web: ScottishDance@xxxxxxxxxxx           http://www.scottishdance.net/
              Feed the World  http://www.hungersite.com/              


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


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


Current Thread