XSL Doctype with entities

T

Tjerk Wolterink

Hello,

i've a xsl document that should also allow xhtml entities like  

The top of the document looks like this;

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE xsl:stylesheet [
<!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
%xhtml;
]>

<xsl:stylesheet version="1.0" ...


But my editor can not find the dtd of xsl now, how should i include the dtd of xsl?
I think like this:


<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE xsl:stylesheet PUBLIC "http://doctypeofxsl" [
<!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
%xhtml;
]>

<xsl:stylesheet version="1.0" ...


Is that right? And then: what is the url of the dtd for xsl?? I cannot find it on w3c.org
Please help
 
M

Martin Honnen

Tjerk Wolterink wrote:

i've a xsl document that should also allow xhtml entities like &nbsp;

The top of the document looks like this;

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE xsl:stylesheet [
<!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
%xhtml;
]>

<xsl:stylesheet version="1.0" ...


But my editor can not find the dtd of xsl now, how should i include the
dtd of xsl?
Is that right? And then: what is the url of the dtd for xsl?? I cannot
find it on w3c.org


Well think about, a DTD statically defines the grammar/structure of your
XML document while an XSLT stylesheet contains all sort of dynamic
content, namely the literal result elements and attributes that differ
from stylesheet to stylesheet so there can't be a DTD for XSLT as XSLT
allows you to include literal result elements of any kind.
 
T

Tjerk Wolterink

Martin said:
Tjerk Wolterink wrote:

i've a xsl document that should also allow xhtml entities like &nbsp;

The top of the document looks like this;

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE xsl:stylesheet [
<!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
%xhtml;
]>

<xsl:stylesheet version="1.0" ...


But my editor can not find the dtd of xsl now, how should i include
the dtd of xsl?

Is that right? And then: what is the url of the dtd for xsl?? I cannot
find it on w3c.org



Well think about, a DTD statically defines the grammar/structure of your
XML document while an XSLT stylesheet contains all sort of dynamic
content, namely the literal result elements and attributes that differ
from stylesheet to stylesheet so there can't be a DTD for XSLT as XSLT
allows you to include literal result elements of any kind.

yes that's true, didnt think of that.

Well i solved my problem by now, is
it possible to write a xsd for xsl?
I do think is is possible.
 
M

Martin Honnen

Tjerk Wolterink wrote:

Well i solved my problem by now, is
it possible to write a xsd for xsl?
I do think is is possible.

W3C XML schemas allow you to specify that elements of any kind are
contained in another element and that validation for unknown elements is
skipped so using that feature it should be possible to write an XML
schema for XSLT.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top