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

entities out of scope in included xsl file

Subject: entities out of scope in included xsl file
From: Jens Schriver <jens@xxxxxxxxxxxx>
Date: Tue, 10 Sep 2002 12:35:20 +0200
jens schriver
Hi everyone,

I am having a problem with entities needed in included .xsl files. I need to include several entity files and several xsl files from one main xsl file. In the included xsl files, I want to be able to use the already included entities, but I cannot get it to work.

The only way I can get this to work, is if I also include the .ent file in the includedfile.xsl, but defining the same entities in the main xsl file and also the "include"ed xsl file seems wrong. If there a way to just include the entities once so they become usable to all included xsl files?

I am running sablotron 0.9 and expat 1.95.4. I first thought this was a Sablotron issue, but after consulting the sablotron list, this does not seem to be the case.

Example and files below.
--------------------
# sabcmd test.xsl test.xml
Error [code:2] [URI:file:includedfile.xsl] [line:5]
XML parser error 11: undefined entity
---------------------

--- test.xml --------------
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<document>
<page/>
</document>
---------------------------

--- test.xsl --------------
<!DOCTYPE xsl:stylesheet [
<!ENTITY % myents1 SYSTEM "entities.ent"> %myents1;
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:include href='includedfile.xsl'/>
<xsl:template match="page">
test.xsl: Where is my entity? &myentity;
</xsl:template>
</xsl:stylesheet>
---------------------------


--- includedfile.xsl ------
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" encoding="iso-8859-1" />
<xsl:template match="document">
includedfile.xsl: start<br/>
includedfile.xsl: where is my entity? &myentity;<br/>
<xsl:apply-templates select="//page"/>
includedfile.xsl: end<br/>
</xsl:template>
</xsl:stylesheet>
---------------------------


--- entities.ent ----------
<!ENTITY myentity "Here I am!">
---------------------------






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.