Validate client-side XSLT result of xhtml-math-svg

C

C.W.Holeman II

For info on the context of my question see the end of this posting.

From http://www.w3.org/TR/XHTMLplusMathMLplusSVG/:
> This profile enables mixing XHTML, MathML and SVG in a same document
> using XML namespaces [XMLNS]mechanism, while allowing validation of
> such a mixed-namespace document.

How can I validate the result of client-side XSLT transform which has
the following?

<xsl:eek:utput
method="xml"
media-type="application/xhtml-math-svg"
encoding="UTF-8"
indent="yes"
doctype-public=
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
doctype-system=
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"/

The example is here:

http://emle.sourceforge.net/emle020000/ng20070527_emle_lab_009.xml
http://emle.sourceforge.net/emle020000/ng20070527_emle_lab_009.xsl
http://emle.sourceforge.net/emle020000/ng20070527_emle_lab_009.js
http://emle.sourceforge.net/emle020000/ng20070527_emle_lab_009.css
http://emle.sourceforge.net/emle020000/ng20070527_emle_lab_009.xsd


--------------------------------------------------------------------
Context:

I am working on the second generation of a collection of applets that
use the interactive aspect of a computer with graphics to provide an
experience for internalizing low level math concepts. For the current
state of this project see:

Electronic Mathematics Laboratory Equipment
http://emle.sourceforge.net/index.shtml

The first generation uses TCL/Tk applets embedded in web pages. I am
continuing from the first generation proof of concept. Those applets
were hand coded with cut and paste of TCL/Tk snippets in a poor style.
See:

Introduction - Emle V1.0.0
http://emle.sourceforge.net/index_010000.shtml

I am now working on a frame work for creating the applets that does not
require the level of programming skills needed in the first generation
proof of concept. I am learning some newer technologies for this
purpose: XML, XML Schema, XPath, XSLT, XHTML, MathML, SVG, Javascript,
DOM, CSS, HTML 4.01 and others. I have already found that by using XML I
can create simple documents that are transformed by XSLT into web pages
with XHTML controls that have Javascript code displaying SVG graphics.
With this an author will be able to create XML files without having to
write much XHTML nor Javascript.

Currently I am using:

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3)
Gecko/20070309 Firefox/2.0.0.3

with the intent of keeping to standards based features. I am not
concerned about poor functionality on other browsers unless the feature
being used is standards based. At time time, I may even ignore all other
browsers in order to focus on other issues.
 
J

Joe Kesselman

C.W.Holeman II said:
How can I validate the result of client-side XSLT transform

Question: Why do you need to explicitly validate it?

If you've written your stylesheet correctly, the document should be
correct. If you haven't, a validation failure in the user's machine
isn't helpful to them; all they can do is complain to you.

(I'd also suggest you consider moving to schema-based validation rather
than DTD-based. XSLT is namespace-aware, and DTD validation doesn't
always "play nice" with full namespace-aware processing.)
 
B

Bjoern Hoehrmann

* C.W.Holeman II wrote in comp.text.xml:
Currently I am using:

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3)
Gecko/20070309 Firefox/2.0.0.3

with the intent of keeping to standards based features. I am not
concerned about poor functionality on other browsers unless the feature
being used is standards based. At time time, I may even ignore all other
browsers in order to focus on other issues.

http://lists.w3.org/Archives/Public/www-validator/2006Nov/0000.html is a
JavaScript-based DTD Validator. It's incomplete as noted in the message,
but if you'd like to use it I could generate the appropriate DTD for you
(the format should be easy to understand and recreate though).
 
D

David Carlisle

I don't think firefox uses a validating parser so I'm not sure that you
can validate in the browser. For debugging purposes you can of course
execute the stylesheet with an external xslt engine, saving the results
to a file, and validate that file.

The styesheet currently has several templates like

<xsl:template match="emle:value">
<emleo:value>

which generate elements in the emleo namespace, the presence of such
elements in the result will mean that the result is not valid to the
xhtml+mathml+svg DTD, which only allows eleemnts from those three
namespaces.

David
 
C

C.W.Holeman II

Joe said:
Question: Why do you need to explicitly validate it?

If you've written your stylesheet correctly, the document should be
correct.

That causes me to believe you have not looked at a lot of what I have
written. :)
If you haven't, a validation failure in the user's machine
isn't helpful to them; all they can do is complain to you.

At this point I am still working on learning how to use these
technologies so I need the feedback.
(I'd also suggest you consider moving to schema-based validation rather
than DTD-based. XSLT is namespace-aware, and DTD validation doesn't
always "play nice" with full namespace-aware processing.)

Where do I find it? The closest I have found is in
http://www.w3.org/TR/XHTMLplusMathMLplusSVG/
> An XHTML 1.1 + MathML 2.0 + SVG 1.1 DTD driver is provided in
> section 2.1. The possibility of combining those modules written in XML
> Schema [XMLSchema] might be explored when XML Schemas for XHTML
> [XHTMLMODSchema] and others become available and mature.
 
J

Joe Kesselman

Where do I find it? The closest I have found is in

I think what you want is something more recent such as
http://www.w3.org/TR/MathML/appendixa.html#parsing.usingxsd
Caveat: I haven't checked the XHTML schema for exactly where this would
and wouldn't be permitted.

SVG is more of a problem, since I'm not sure there is an official XML
Schema for SVG yet. So if you want to validate SVG you may indeed be
forced to use DTDs as a stopgap.

And if you want to use the MathML entities, you do need to bring in the
DTD even if your main validation is against schemas.
 
C

C.W.Holeman II

David said:
I don't think firefox uses a validating parser so I'm not sure that you
can validate in the browser. For debugging purposes you can of course
execute the stylesheet with an external xslt engine, saving the results
to a file, and validate that file.

I used CookTop 2.5. XML->Run XSLT-and-Save-to-File.
http://validator.w3.org/
Saving the results to:

http://emle.sourceforge.net/emle020000/ng20070530_emle_lab_010.html
The styesheet currently has several templates like

<xsl:template match="emle:value">
<emleo:value>

which generate elements in the emleo namespace, the presence of such
elements in the result will mean that the result is not valid to the
xhtml+mathml+svg DTD, which only allows eleemnts from those three
namespaces.

I replaced all of the emleo namespace prefix elements with <div> for
the elements and <span> for the attributes. Then removed the MathML
namespace prefixes from all of the <math> and nested elements. That
all or most of the errors.

Then the results from the validaotr were "This Page Is Valid XHTML 1.1
plus MathML 2.0 plus SVG 1.1!"

http://emle.sourceforge.net/emle020000/ng20070530_emle_lab_010.html
http://emle.sourceforge.net/emle020000/ng20070530_emle_lab_010.html
 
C

C.W.Holeman II

Correction to mis-sent previous posting.

David said:
>
>
> I don't think firefox uses a validating parser so I'm not sure that
> you can validate in the browser. For debugging purposes you can of
> course execute the stylesheet with an external xslt engine, saving the
> results to a file, and validate that file.

I used CookTop 2.5. XML->Run XSLT-and-Save-to-File placing the saved
results at:

http://emle.sourceforge.net/emle020000/ng20070530_emle_lab_010.html

Then used http://validator.w3.org/ for the validation.
> The styesheet currently has several templates like
>
> <xsl:template match="emle:value">
> <emleo:value>
>
> which generate elements in the emleo namespace, the presence of such
> elements in the result will mean that the result is not valid to the
> xhtml+mathml+svg DTD, which only allows eleemnts from those three
> namespaces.

I replaced all of the emleo namespace prefix elements with <div> for
the elements and <span> for the attributes. Then removed the MathML
namespace prefixes from all of the <math> and nested elements. That
corrected all or most of the errors.

Then the results from the validaotr were "This Page Is Valid XHTML 1.1
plus MathML 2.0 plus SVG 1.1!"

http://emle.sourceforge.net/emle020000/ng20070530_emle_lab_010.xsd
http://emle.sourceforge.net/emle020000/ng20070530_emle_lab_010.xml
http://emle.sourceforge.net/emle020000/ng20070530_emle_lab_010.xsl
http://emle.sourceforge.net/emle020000/ng20070530_emle_lab_010.js
http://emle.sourceforge.net/emle020000/ng20070530_emle_lab_010.css

http://emle.sourceforge.net/emle020000/ng20070530_emle_lab_010.html
 

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

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top