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

Discussion in 'XML' started by C.W.Holeman II, May 27, 2007.

  1. 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.

    --
    C.W.Holeman II | -5 http://JulianLocals.com/cwhii
    To only a fraction of the human race does God give the privilege of
    earning one's bread doing what one would have gladly pursued free, for
    passion. I am very thankful. The Mythical Man-Month Epilogue/F.P.Brooks
     
    C.W.Holeman II, May 27, 2007
    #1
    1. Advertising

  2. C.W.Holeman II wrote:
    > 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.)

    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
     
    Joe Kesselman, May 27, 2007
    #2
    1. Advertising

  3. * 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).
    --
    Björn Höhrmann · mailto: · http://bjoern.hoehrmann.de
    Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
    68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
     
    Bjoern Hoehrmann, May 27, 2007
    #3
  4. 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
    --
    http://dpcarlisle.blogspot.com
     
    David Carlisle, May 27, 2007
    #4
  5. Joe Kesselman wrote:
    > C.W.Holeman II wrote:
    >> 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.


    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.


    --
    C.W.Holeman II | -5 http://JulianLocals.com/cwhii
    To only a fraction of the human race does God give the privilege of
    earning one's bread doing what one would have gladly pursued free, for
    passion. I am very thankful. The Mythical Man-Month Epilogue/F.P.Brooks
     
    C.W.Holeman II, May 27, 2007
    #5
  6. > Where do I find it? The closest I have found is in
    > http://www.w3.org/TR/XHTMLplusMathMLplusSVG/


    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.


    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
     
    Joe Kesselman, May 29, 2007
    #6
  7. David Carlisle wrote:
    >
    >
    > 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.W.Holeman II | -5 http://JulianLocals.com/cwhii
    To only a fraction of the human race does God give the privilege of
    earning one's bread doing what one would have gladly pursued free, for
    passion. I am very thankful. The Mythical Man-Month Epilogue/F.P.Brooks
     
    C.W.Holeman II, May 30, 2007
    #7
  8. Correction to mis-sent previous posting.

    David Carlisle wrote:
    >
    >
    > 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

    --
    C.W.Holeman II | -5 http://JulianLocals.com/cwhii
    To only a fraction of the human race does God give the privilege of
    earning one's bread doing what one would have gladly pursued free, for
    passion. I am very thankful. The Mythical Man-Month Epilogue/F.P.Brooks
     
    C.W.Holeman II, May 30, 2007
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nicolas Stern
    Replies:
    2
    Views:
    2,771
    Dimitre Novatchev
    Aug 13, 2003
  2. Arne Nordmann
    Replies:
    0
    Views:
    527
    Arne Nordmann
    Jun 28, 2004
  3. Usha2009
    Replies:
    0
    Views:
    1,138
    Usha2009
    Dec 20, 2009
  4. Michael Tan
    Replies:
    32
    Views:
    989
    Ara.T.Howard
    Jul 21, 2005
  5. VK
    Replies:
    15
    Views:
    1,174
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page