DTD

1. Where can I find the XSLT DTD
2. Mathml and XHTML in IE browser

1.

Where can I find the XSLT DTD

John E Simpson

There can't be one for all cases.

>I'll never be able to validate ANY of my XSL doc?

No... unless you do as suggested, and create an application-specific DTD for use in validating your stylesheet. This can be quite complicated; if XHTML were the result tree's vocabulary, for instance, you'd have to allow for the appearance of just about any XHTML element as a child of just about any XSLT element.

As someone else said, almost no one bothers checking XSLT stylesheets for validity -- well-formedness is all right, as long as the XSLT processor (XT, SAXON, whatever) detects syntax and other XSLT-specific errors. Validity in the XML sense is not critical for XSLT. Actually, I'd guess that absolutely no one bothers to check validity of stylesheets; the "almost" is just a hedge. :)

Joe English adds

Validators usually give better error messages than XSLT processors, which is helpful for catching gross structural errors.

Plus, in cases where the stylesheet makes heavy use of literal result elements, this can go a long way towards semantically validating the stylesheet (that is, making sure that the stylesheet produces valid result documents).

However, constructing a DTD against which to validate the stylesheet in this case can be a bit tricky. It's usually not hard to customize the XSLT DTD fragment:

<!ENTITY % xsl.dtd SYSTEM "xslt.dtd">
<!ENTITY % html.dtd PUBLIC 
    "-//W3C//DTD XHTML 1.0 Strict//EN" "/dev/null">
    %html.dtd;
    <!ENTITY % result-elements "%inline; |  %block;" >
    %xsl.dtd;

but the target DTD *also* has to be parameterized in order to allow XSL instructions inside literal result elements! This isn't difficult either if you "cheat" and use an SGML parser for validation; inclusion exceptions fit the bill nicely here.

2.

Mathml and XHTML in IE browser

David Carlisle



  Well afaict there is something wrong with the dtd - but its far too big
  to dicpher :)

hey watch it, that's "my" DTD:-)

Actually there is something wrong with the DTD (and IE wouldn't read that one anyway as there is something wrong with IE)

the correct URI is http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd


> The xhtml will display in your browser because most likely it makes no 
> attempt to get the dtd (I don't know about Mozilla but IE certainly 
> doesn't use an xml parser for xhtml).

IE will only render XHTML+MathML if it is served with an XML mime type and if it is so served it will use an XML parser and will use the specified DTD. For this reason it iis a good idea not to specify the DTD on teh files that are being served as the XHTML+MathML DTD is rather large and teh time taken to download that can have a very significant effect on rendering time.


> Are you sure that the dtd really is an xml dtd?

That was addressed to the original poster, but _I'm_ sure of that:-)

The error message in the subject line is in fact caused by a bug in IEs parser not being able to read the original version. The version at the specified location has an "equivalent" setup of parameter entities that does work in IE although you have to have IE6 SP1 otherwise you get a different error as older versions of IE used an XML parser that would not accept any character references above hex FFFF.

As I say above, the simple solution is not to reference the DTD at all.