You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lisa van Gelder <li...@wirestation.co.uk> on 2000/06/12 16:12:45 UTC

external entities in xsl

Is there a way to reference external entities from within an xsl page? Or is
there another way of including outside files (xml files, not other xsl
pages) within an <xsl:template>? I've tried defining the external entities
in the dtd of the xml page that calls the template, but I just get a "The
entity was referenced, but not declared" error message. It won't let me
define the entities within the xsl page itself either. Any ideas?

I've read through the archive and can't see any mention of this - apologies
if I've missed it!

thanks

Lisa


RE: external entities in xsl

Posted by Lisa van Gelder <li...@wirestation.co.uk>.
Thanks - that works!

-----Original Message-----
From: Mark Washeim [mailto:esalon@canuck.com]
Sent: 12 June 2000 16:15
To: cocoon-users@xml.apache.org
Subject: Re: external entities in xsl


on 12/6/00 5:10 pm, Lisa van Gelder at lisa@wirestation.co.uk wrote:

> Actually the file I'm trying to include is valid xml. It seems to be
choking
> on the <!DOCTYPE declaration itself, which I have just included at the top
> of my xsl page (under the usual xsl:stylesheet bit)
>
> Sorry if this is a stupid question but the "stylesheet" part of "<!DOCTYPE
> stylesheet [" - is this the stylesheet itself, the root element of the
> stylesheet or the root element of the page I'm trying to include?
>

Ok, I'm not sure why you would include the xml in the final output from the
xsl processing stage (which is what will happen, it will be in the output,
not processed) . . . but, the answer is:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE stylesheet [
 <!ENTITY ads SYSTEM "ads.js">
 <!ENTITY js SYSTEM "shared.js">
]>

The doctype (internal DTD, to be exact) must follow the xml declaration and
preceed the stylesheet element . . . the stylesheet is the document type you
are defining by virtue of the DTD (internal) . . .*

--
Mark (Poetaster) Washeim

'On the linen wrappings of certain mummified remains
found near the Etrurian coast are invaluable writings
that await translation.

Quem colorem habet sapientia?'

Evan S. Connell





---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: external entities in xsl

Posted by Mark Washeim <es...@canuck.com>.
on 12/6/00 5:10 pm, Lisa van Gelder at lisa@wirestation.co.uk wrote:

> Actually the file I'm trying to include is valid xml. It seems to be choking
> on the <!DOCTYPE declaration itself, which I have just included at the top
> of my xsl page (under the usual xsl:stylesheet bit)
> 
> Sorry if this is a stupid question but the "stylesheet" part of "<!DOCTYPE
> stylesheet [" - is this the stylesheet itself, the root element of the
> stylesheet or the root element of the page I'm trying to include?
> 

Ok, I'm not sure why you would include the xml in the final output from the
xsl processing stage (which is what will happen, it will be in the output,
not processed) . . . but, the answer is:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE stylesheet [
 <!ENTITY ads SYSTEM "ads.js">
 <!ENTITY js SYSTEM "shared.js">
]>

The doctype (internal DTD, to be exact) must follow the xml declaration and
preceed the stylesheet element . . . the stylesheet is the document type you
are defining by virtue of the DTD (internal) . . .*

-- 
Mark (Poetaster) Washeim

'On the linen wrappings of certain mummified remains
found near the Etrurian coast are invaluable writings
that await translation.

Quem colorem habet sapientia?'

Evan S. Connell

 



RE: external entities in xsl

Posted by Lisa van Gelder <li...@wirestation.co.uk>.
Actually the file I'm trying to include is valid xml. It seems to be choking
on the <!DOCTYPE declaration itself, which I have just included at the top
of my xsl page (under the usual xsl:stylesheet bit)

Sorry if this is a stupid question but the "stylesheet" part of "<!DOCTYPE
stylesheet [" - is this the stylesheet itself, the root element of the
stylesheet or the root element of the page I'm trying to include?

thanks for all your help!

Lisa

-----Original Message-----
From: Mark Washeim [mailto:esalon@canuck.com]
Sent: 12 June 2000 16:04
To: cocoon-users@xml.apache.org
Subject: Re: external entities in xsl


on 12/6/00 4:57 pm, Lisa van Gelder at lisa@wirestation.co.uk wrote:

> Put CDATA tags round where? If I put that round the
>
> <!DOCTYPE stylesheet [
>> <!ENTITY ads SYSTEM "ads.js">
>> <!ENTITY js SYSTEM "shared.js">
>> ]>
>
> bit it won't recoginise the entity.
>


Sheesh. No. I meant around the content of the file you want to include:

for instance, this is the contents of the shared.js file (trimmed), where
the script tags, being valid are outside the cdata block, but the rest,
being YECH, is inside . . .

<SCRIPT language="Javascript">
<![CDATA[ 

var section
if (location.href.indexOf("page=home")) { section = "home" }
else if (location.href.indexOf("page=Competition")) { section =
"competition" }
else if (location.href.indexOf("page=Commentary")) { section = "commentary"
}
else if (location.href.indexOf("page=Quiz")) { section = "quiz" }
else { section = "other" }

if ( getCookie( "lang") == "sv" ) {
 var home = 151065
 var other = 151066
 var competition = 151064
 var commentary = 151063
 var quiz = 151068

}

tag = '<IFRAME WIDTH="468" HEIGHT="60" SCROLLING="No" FRAMEBORDER="0"
MARGINHEIGHT="0" MARGINWIDTH="0"
SRC="http://adforce.imgis.com/?adiframe|2.0|44|' + eval(section) +
'|1|1|ADFORCE;"><a href="http://adforce.imgis.com/?adlink|2.0|44|' +
eval(section) + '|1|1|ADFORCE;loc=300;" target="_top"><img
src="http://adforce.imgis.com/?adserv|2.0|44|' + eval(section) +
'|1|1|ADFORCE;loc=300;" border="0" width="468"
height="60"></img></a></IFRAME>'

document.write(tag)

]]>
</SCRIPT>


> 
> -----Original Message-----
> From: Mark Washeim [mailto:esalon@canuck.com]
> Sent: 12 June 2000 15:42
> To: cocoon-users@xml.apache.org
> Subject: Re: external entities in xsl
> 
> 
> on 12/6/00 4:36 pm, Lisa van Gelder at lisa@wirestation.co.uk wrote:
> 
>> Thanks, but I still get an error message:
>> 
>> org.xml.sax.SAXParseException: The markup in the document following the
> root
>> element must be well-formed.
> 
> 
> Use a
> <![CDATA[
> 
> code
> 
> ]]>
> 
> 
> approach. works well. . .
> 
>> -----Original Message-----
>> From: Mark Washeim [mailto:esalon@canuck.com]
>> Sent: 12 June 2000 15:24
>> To: cocoon-users@xml.apache.org
>> Subject: Re: external entities in xsl
>> 
>> 
>> on 12/6/00 4:12 pm, Lisa van Gelder at lisa@wirestation.co.uk wrote:
>> 
>>> Is there a way to reference external entities from within an xsl page? Or
>> is
>>> there another way of including outside files (xml files, not other xsl
>>> pages) within an <xsl:template>? I've tried defining the external
> entities
>>> in the dtd of the xml page that calls the template, but I just get a "The
>>> entity was referenced, but not declared" error message. It won't let me
>>> define the entities within the xsl page itself either. Any ideas?
>>> 
>>> I've read through the archive and can't see any mention of this -
>> apologies
>>> if I've missed it!
>>> 
>>> thanks
>> 
>> <!DOCTYPE stylesheet [
>> <!ENTITY ads SYSTEM "ads.js">
>> <!ENTITY js SYSTEM "shared.js">
>> ]>
>> 
>> then
>> 
>> &ads;
>> 
>> within a tag within the xsl . . .
>> 
>> you can even do this with xsl stylesheets included in other xsl
> stylesheets
>> .. . . I also use this method to embed larger blocks of logic in xsp pages
> to
>> keep the java out of the xml . . . that is, I place class level methods
> and
>> member fields in a external enti
ty and include them in a
>> <xsp:logic>&include;</xsp:logic>, way :)
>>
>>
>>
>>> Lisa
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>>> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>>>
>>
>> --
>> Mark (Poetaster) Washeim
>>
>> 'On the linen wrappings of certain mummified remains
>> found near the Etrurian coast are invaluable writings
>> that await translation.
>>
>> Quem colorem habet sapientia?'
>>
>> Evan S. Connell
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>>
>
> --
> Mark (Poetaster) Washeim
>
> 'On the linen wrappings of certain mummified remains
> found near the Etrurian coast are invaluable writings
> that await translation.
>
> Quem colorem habet sapientia?'
>
> Evan S. Connell
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>

--
Mark (Poetaster) Washeim

'On the linen wrappings of certain mummified remains
found near the Etrurian coast are invaluable writings
that await translation.

Quem colorem habet sapientia?'

Evan S. Connell





---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: external entities in xsl

Posted by Mark Washeim <es...@canuck.com>.
on 12/6/00 4:57 pm, Lisa van Gelder at lisa@wirestation.co.uk wrote:

> Put CDATA tags round where? If I put that round the
> 
> <!DOCTYPE stylesheet [
>> <!ENTITY ads SYSTEM "ads.js">
>> <!ENTITY js SYSTEM "shared.js">
>> ]>
> 
> bit it won't recoginise the entity.
> 


Sheesh. No. I meant around the content of the file you want to include:

for instance, this is the contents of the shared.js file (trimmed), where
the script tags, being valid are outside the cdata block, but the rest,
being YECH, is inside . . .

<SCRIPT language="Javascript">
<![CDATA[ 

var section
if (location.href.indexOf("page=home")) { section = "home" }
else if (location.href.indexOf("page=Competition")) { section =
"competition" }
else if (location.href.indexOf("page=Commentary")) { section = "commentary"
}
else if (location.href.indexOf("page=Quiz")) { section = "quiz" }
else { section = "other" }

if ( getCookie( "lang") == "sv" ) {
 var home = 151065
 var other = 151066
 var competition = 151064
 var commentary = 151063
 var quiz = 151068

}

tag = '<IFRAME WIDTH="468" HEIGHT="60" SCROLLING="No" FRAMEBORDER="0"
MARGINHEIGHT="0" MARGINWIDTH="0"
SRC="http://adforce.imgis.com/?adiframe|2.0|44|' + eval(section) +
'|1|1|ADFORCE;"><a href="http://adforce.imgis.com/?adlink|2.0|44|' +
eval(section) + '|1|1|ADFORCE;loc=300;" target="_top"><img
src="http://adforce.imgis.com/?adserv|2.0|44|' + eval(section) +
'|1|1|ADFORCE;loc=300;" border="0" width="468"
height="60"></img></a></IFRAME>'

document.write(tag)

]]>
</SCRIPT>


> 
> -----Original Message-----
> From: Mark Washeim [mailto:esalon@canuck.com]
> Sent: 12 June 2000 15:42
> To: cocoon-users@xml.apache.org
> Subject: Re: external entities in xsl
> 
> 
> on 12/6/00 4:36 pm, Lisa van Gelder at lisa@wirestation.co.uk wrote:
> 
>> Thanks, but I still get an error message:
>> 
>> org.xml.sax.SAXParseException: The markup in the document following the
> root
>> element must be well-formed.
> 
> 
> Use a
> <![CDATA[
> 
> code
> 
> ]]>
> 
> 
> approach. works well. . .
> 
>> -----Original Message-----
>> From: Mark Washeim [mailto:esalon@canuck.com]
>> Sent: 12 June 2000 15:24
>> To: cocoon-users@xml.apache.org
>> Subject: Re: external entities in xsl
>> 
>> 
>> on 12/6/00 4:12 pm, Lisa van Gelder at lisa@wirestation.co.uk wrote:
>> 
>>> Is there a way to reference external entities from within an xsl page? Or
>> is
>>> there another way of including outside files (xml files, not other xsl
>>> pages) within an <xsl:template>? I've tried defining the external
> entities
>>> in the dtd of the xml page that calls the template, but I just get a "The
>>> entity was referenced, but not declared" error message. It won't let me
>>> define the entities within the xsl page itself either. Any ideas?
>>> 
>>> I've read through the archive and can't see any mention of this -
>> apologies
>>> if I've missed it!
>>> 
>>> thanks
>> 
>> <!DOCTYPE stylesheet [
>> <!ENTITY ads SYSTEM "ads.js">
>> <!ENTITY js SYSTEM "shared.js">
>> ]>
>> 
>> then
>> 
>> &ads;
>> 
>> within a tag within the xsl . . .
>> 
>> you can even do this with xsl stylesheets included in other xsl
> stylesheets
>> .. . . I also use this method to embed larger blocks of logic in xsp pages
> to
>> keep the java out of the xml . . . that is, I place class level methods
> and
>> member fields in a external entity and include them in a
>> <xsp:logic>&include;</xsp:logic>, way :)
>> 
>> 
>> 
>>> Lisa
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>>> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>>> 
>> 
>> --
>> Mark (Poetaster) Washeim
>> 
>> 'On the linen wrappings of certain mummified remains
>> found near the Etrurian coast are invaluable writings
>> that await translation.
>> 
>> Quem colorem habet sapientia?'
>> 
>> Evan S. Connell
>> 
>> 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>> 
> 
> --
> Mark (Poetaster) Washeim
> 
> 'On the linen wrappings of certain mummified remains
> found near the Etrurian coast are invaluable writings
> that await translation.
> 
> Quem colorem habet sapientia?'
> 
> Evan S. Connell
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 

-- 
Mark (Poetaster) Washeim

'On the linen wrappings of certain mummified remains
found near the Etrurian coast are invaluable writings
that await translation.

Quem colorem habet sapientia?'

Evan S. Connell

 



RE: external entities in xsl

Posted by Lisa van Gelder <li...@wirestation.co.uk>.
Put CDATA tags round where? If I put that round the

<!DOCTYPE stylesheet [
> <!ENTITY ads SYSTEM "ads.js">
> <!ENTITY js SYSTEM "shared.js">
> ]>

bit it won't recoginise the entity.



-----Original Message-----
From: Mark Washeim [mailto:esalon@canuck.com]
Sent: 12 June 2000 15:42
To: cocoon-users@xml.apache.org
Subject: Re: external entities in xsl


on 12/6/00 4:36 pm, Lisa van Gelder at lisa@wirestation.co.uk wrote:

> Thanks, but I still get an error message:
>
> org.xml.sax.SAXParseException: The markup in the document following the
root
> element must be well-formed.


Use a
<![CDATA[

code

]]>


approach. works well. . .

> -----Original Message-----
> From: Mark Washeim [mailto:esalon@canuck.com]
> Sent: 12 June 2000 15:24
> To: cocoon-users@xml.apache.org
> Subject: Re: external entities in xsl
>
>
> on 12/6/00 4:12 pm, Lisa van Gelder at lisa@wirestation.co.uk wrote:
>
>> Is there a way to reference external entities from within an xsl page? Or
> is
>> there another way of including outside files (xml files, not other xsl
>> pages) within an <xsl:template>? I've tried defining the external
entities
>> in the dtd of the xml page that calls the template, but I just get a "The
>> entity was referenced, but not declared" error message. It won't let me
>> define the entities within the xsl page itself either. Any ideas?
>>
>> I've read through the archive and can't see any mention of this -
> apologies
>> if I've missed it!
>>
>> thanks
>
> <!DOCTYPE stylesheet [
> <!ENTITY ads SYSTEM "ads.js">
> <!ENTITY js SYSTEM "shared.js">
> ]>
>
> then
>
> &ads;
>
> within a tag within the xsl . . .
>
> you can even do this with xsl stylesheets included in other xsl
stylesheets
> .. . . I also use this method to embed larger blocks of logic in xsp pages
to
> keep the java out of the xml . . . that is, I place class level methods
and
> member fields in a external entity and include them in a
> <xsp:logic>&include;</xsp:logic>, way :)
>
>
>
>> Lisa
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>>
>
> --
> Mark (Poetaster) Washeim
>
> 'On the linen wrappings of certain mummified remains
> found near the Etrurian coast are invaluable writings
> that await translation.
>
> Quem colorem habet sapientia?'
>
> Evan S. Connell
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>

--
Mark (Poetaster) Washeim

'On the linen wrappings of certain mummified remains
found near the Etrurian coast are invaluable writings
that await translation.

Quem colorem habet sapientia?'

Evan S. Connell





---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: external entities in xsl

Posted by Mark Washeim <es...@canuck.com>.
on 12/6/00 4:36 pm, Lisa van Gelder at lisa@wirestation.co.uk wrote:

> Thanks, but I still get an error message:
> 
> org.xml.sax.SAXParseException: The markup in the document following the root
> element must be well-formed.


Use a 
<![CDATA[

code

]]>


approach. works well. . .

> -----Original Message-----
> From: Mark Washeim [mailto:esalon@canuck.com]
> Sent: 12 June 2000 15:24
> To: cocoon-users@xml.apache.org
> Subject: Re: external entities in xsl
> 
> 
> on 12/6/00 4:12 pm, Lisa van Gelder at lisa@wirestation.co.uk wrote:
> 
>> Is there a way to reference external entities from within an xsl page? Or
> is
>> there another way of including outside files (xml files, not other xsl
>> pages) within an <xsl:template>? I've tried defining the external entities
>> in the dtd of the xml page that calls the template, but I just get a "The
>> entity was referenced, but not declared" error message. It won't let me
>> define the entities within the xsl page itself either. Any ideas?
>> 
>> I've read through the archive and can't see any mention of this -
> apologies
>> if I've missed it!
>> 
>> thanks
> 
> <!DOCTYPE stylesheet [
> <!ENTITY ads SYSTEM "ads.js">
> <!ENTITY js SYSTEM "shared.js">
> ]>
> 
> then
> 
> &ads;
> 
> within a tag within the xsl . . .
> 
> you can even do this with xsl stylesheets included in other xsl stylesheets
> .. . . I also use this method to embed larger blocks of logic in xsp pages to
> keep the java out of the xml . . . that is, I place class level methods and
> member fields in a external entity and include them in a
> <xsp:logic>&include;</xsp:logic>, way :)
> 
> 
> 
>> Lisa
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>> 
> 
> --
> Mark (Poetaster) Washeim
> 
> 'On the linen wrappings of certain mummified remains
> found near the Etrurian coast are invaluable writings
> that await translation.
> 
> Quem colorem habet sapientia?'
> 
> Evan S. Connell
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 

-- 
Mark (Poetaster) Washeim

'On the linen wrappings of certain mummified remains
found near the Etrurian coast are invaluable writings
that await translation.

Quem colorem habet sapientia?'

Evan S. Connell

 



RE: external entities in xsl

Posted by Lisa van Gelder <li...@wirestation.co.uk>.
Thanks, but I still get an error message:

org.xml.sax.SAXParseException: The markup in the document following the root
element must be well-formed.

-----Original Message-----
From: Mark Washeim [mailto:esalon@canuck.com]
Sent: 12 June 2000 15:24
To: cocoon-users@xml.apache.org
Subject: Re: external entities in xsl


on 12/6/00 4:12 pm, Lisa van Gelder at lisa@wirestation.co.uk wrote:

> Is there a way to reference external entities from within an xsl page? Or
is
> there another way of including outside files (xml files, not other xsl
> pages) within an <xsl:template>? I've tried defining the external entities
> in the dtd of the xml page that calls the template, but I just get a "The
> entity was referenced, but not declared" error message. It won't let me
> define the entities within the xsl page itself either. Any ideas?
>
> I've read through the archive and can't see any mention of this -
apologies
> if I've missed it!
>
> thanks

<!DOCTYPE stylesheet [
 <!ENTITY ads SYSTEM "ads.js">
 <!ENTITY js SYSTEM "shared.js">
]>

then

&ads;

within a tag within the xsl . . .

you can even do this with xsl stylesheets included in other xsl stylesheets
. . . I also use this method to embed larger blocks of logic in xsp pages to
keep the java out of the xml . . . that is, I place class level methods and
member fields in a external entity and include them in a
<xsp:logic>&include;</xsp:logic>, way :)



> Lisa
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>

--
Mark (Poetaster) Washeim

'On the linen wrappings of certain mummified remains
found near the Etrurian coast are invaluable writings
that await translation.

Quem colorem habet sapientia?'

Evan S. Connell





---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: external entities in xsl

Posted by Mark Washeim <es...@canuck.com>.
on 12/6/00 4:12 pm, Lisa van Gelder at lisa@wirestation.co.uk wrote:

> Is there a way to reference external entities from within an xsl page? Or is
> there another way of including outside files (xml files, not other xsl
> pages) within an <xsl:template>? I've tried defining the external entities
> in the dtd of the xml page that calls the template, but I just get a "The
> entity was referenced, but not declared" error message. It won't let me
> define the entities within the xsl page itself either. Any ideas?
> 
> I've read through the archive and can't see any mention of this - apologies
> if I've missed it!
> 
> thanks

<!DOCTYPE stylesheet [
 <!ENTITY ads SYSTEM "ads.js">
 <!ENTITY js SYSTEM "shared.js">
]>

then

&ads;

within a tag within the xsl . . .

you can even do this with xsl stylesheets included in other xsl stylesheets
. . . I also use this method to embed larger blocks of logic in xsp pages to
keep the java out of the xml . . . that is, I place class level methods and
member fields in a external entity and include them in a
<xsp:logic>&include;</xsp:logic>, way :)



> Lisa
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 

-- 
Mark (Poetaster) Washeim

'On the linen wrappings of certain mummified remains
found near the Etrurian coast are invaluable writings
that await translation.

Quem colorem habet sapientia?'

Evan S. Connell