[Petal] Re: Petal requires invalid XHTML documents

patricka at mkdoc.com patricka at mkdoc.com
Wed Oct 8 23:46:49 BST 2003


William McKee writes: 

> Jean-Michel, 
> 
> In the process of fixing my html docs to be xhtml valid for use with the
> new MKDoc::XML parser, I have discovered that the W3C validator does not
> like the xmlns:petal nor the petal: attributes. Try passing the attached
> file through the validator to see the output. 
> 
> This document is successfully processed by Petal despite being invalid
> XHTML. Is there any way we can make Petal templates be valid XHTML or is
> this beyond the realm of possibility because Petal is designed to
> process XML documents rather than XHTML documents?

there are two levels of validation. "well-formed", means all elements are 
paired (a requirement of xml). strong validation further checks your 
document against it's grammar (dtd or schema). 

(the w3 validator does strong dtd based validation. i don't know of any 
schema validators.) 

Masayasu Ishikawa sums the problem up nicely[1]: 

 ---8<---
> The validator recognized the additional namespace (shown in the
> header of the validator output), but marked these attributes as
> erroneous.  In my second attempt I moved xmlns="..." up to the
> <head> resp. <address>, but the validator still didn't like the
> xmlns=, base=, and align= attributes.

DTD-based validation and namespaces are not really compatible.
If you really want to perform DTD-based validation, whatever
namespaces you want to add, you have to declare necessary
elements and attributes appropriately in the internal or
external DTD subset, including the xmlns attribute. 

If your REALLY have to do so, you might want to look at
"Modularization of XHTML", at: 

   http://www.w3.org/TR/xhtml-modularization/ 

Otherwise, you'd better consider schema-based validation or
live with "well-formed but not valid" for now. 

Regards,
-- 
Masayasu Ishikawa / mimasa at w3.org
W3C - World Wide Web Consortium
 --->8--- 

 - p 

1.
http://lists.w3.org/Archives/Public/www-validator/2002Jan/0088.html 




More information about the Petal mailing list