Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: Empty element match >Thread Next - Re: Empty element match Re: Empty element matchTo: NULL Date: 7/1/2005 2:16:00 PM David Carlisle wrote: >>I'm sending it as html now, with output method set to html, >>but then my document is not valid anymore, > > > XSLT does not ensure its output is valid, it is the responsibility of > the stylesheet author to do that. If the stylesheet generates an > element foobar then xslt will happily write <foobar>..</foobar> > and the resulting html will not validate. > > If you were writing valid xhtml and you change the method to html and > change the doctype to specify an html dtd then it is very unlikely that > the result is invalid html. What validation error do you get? > > Errors like this: line 11 column 5 - Warning: <meta> element not empty or not closed line 25 column 5 - Warning: <link> element not empty or not closed line 2 column 1 - Warning: <html> proprietary attribute "xmlns:menu" A piece of the generated html page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html xmlns:r="http://www.wolterinkwebdesign.com/xml/roles" xmlns:menu="http://www.wolterinkwebdesign.com/xml/menu" xmlns:page="http://www.wolterinkwebdesign.com/xml/page" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Scharenborg :: Assurantien en hyptheken</title> <!-- ! Wolterink Webdesign ! (C) Tjerk Wolterink ! tjerk@w... ! 2005 --> <meta name="keywords" content="Scharenborg Assurantien"> <meta name="description" content="Berendsen Meubelen"> <meta name="author" content="Tjerk Wolterink;tjerk@w..."> <meta name="publisher" content="Scharenborg Assurantien"> <meta name="language" content="nl"> <meta name="robots" content="all"> <script type="text/javascript" src="http://localhost/webapps/scharenborg/js/standard.js"></script> <script type="text/javascript" src="http://localhost/webapps/scharenborg/js/xmlhttprequest.js"></script> <script type="text/javascript" src="http://localhost/webapps/scharenborg/js/xmlsax.js"></script> <script type="text/javascript" src="http://localhost/webapps/scharenborg/js/xmlw3cdom.js"></script> <script type="text/javascript" src="http://localhost/webapps/scharenborg/js/vcXMLRPC.js"></script> <script type="text/javascript" src="http://localhost/webapps/scharenborg/js/fck_editor/fckeditor.js"></script> <script type="text/javascript" src="http://localhost/webapps/scharenborg/js/xcm.js"></script> <script type="text/javascript" src="http://localhost/webapps/scharenborg/js/submenu.js"></script> <link rel="stylesheet" type="text/css" media="screen" href="http://localhost/webapps/scharenborg/css/style.css"> > > >>elements like <meta and <br> are not closed now, >>does html transitional force you to close them?? > > > They are declared EMPTY in the HTML DTD so they are never opened and > don't need (and can't be) closed. With closing i also mean: <br/> (properly closed empty tag) > HTML is not an XML language and doesn't > use XML syntax. <br> is the correct syntax for the element (or <BR> as > html is not case sensitive) <br></br> is a syntax error, <br/> is > legal syntax but equivalent to <br>> and should (on a conformant system) > typeset a > after the newline. (Most browsers though don't do this, but > then they don't use conformant html parsers, they use purpose built > parsers aimed to do "something sensible" even in the face of incorrect > markup) > Ok i understand, but html transitional and html strict are not xml languages? Or am i interchanging xhtml and html wrongly? > >>But the processor at the hostingprovider does not understand it. >>It makes me crazy > > > The XSLt spec specifies that <xsl:output method="html" must be > understood (that is, not generate an xslt error) but any xslt system may > always ignore the xsl:output instruction and use its own system > specific methods to output the file. (For example in cocoon the output > from xslt is always piped to another trandformation process or > serialiser and so not serialised under the control of the stylesheet and > xsl:output is ignored. > > >>I thought xsl was a standard, but each processor handles that standard >>differently > > > At places where the standard explictly authorises this difference. > So the conclusion of this is: IF your writing an html application that uses xsl transformation to output the html, then you have to change the xsl for each xsltransformer-implementation, and sometimes it just doest work, for example with those <br><br/> tags, Is there no possibility to enforce the parser to use <br/> for empty tags? | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
