[oXygen-user] XHTML 2 validation, revisited
Paul Everitt
Thu Jun 7 17:23:58 CDT 2007
13 months ago I posted here then rng-users for help on XHTML 2
validation using the RNG schemas. I am revisiting the problem and
running into a snap that has me quite perplexed.
I'm using the experimental schemas located here:
http://www.w3.org/People/mimasa/test/schemas/rng/xhtml2.rng
Everything is fine when I don't use any form controls:
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen
RNGSchema="http://www.w3.org/People/mimasa/test/schemas/rng/xhtml2.rng"
type="xml"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2/">
<head>
<title>Hello World</title>
</head>
<body>
<p>Hello World</p>
</body>
</html>
This validates in both oXygen 8.2 and xmllint. However, any attempt to
introduce a form element leaves me in an "Unfinished element" status on
the body:
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen
RNGSchema="http://www.w3.org/People/mimasa/test/schemas/rng/xhtml2.rng"
type="xml"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2/"
xmlns:q="http://foo.org">
<head>
<title>Hello World</title>
<model>
<instance>
<q:x/>
</instance>
</model>
</head>
<body>
<input ref="q:x">
<label>x</label>
</input>
</body>
</html>
oXygen 8.2 reports "E [oNVDL] unfinished element" on the closing
</body>. xmllint reports:
Untitled4.xml:13: element input: Relax-NG validity
error : Element body has extra content: input
Wrapping the <input> in a <div> simply moves the error to the <div>. I
spent a couple of hours hacking around in the pile of schemas, trying to
figure out what was missing.
I downloaded the schemas from the July 2006 working draft of XHTML 2:
http://www.w3.org/TR/xhtml2/xhtml2.html
But these don't even work out-of-the-box. I supplied the 2 missing RNGs
(xforms.rng and xforms-nons-11.rng) and wound up with the same error.
I'd be interested to find an XHTML 2 example that includes form elements
*and* validates against some known schema, RNG or otherwise.
And yes, I know XHTML2 doesn't work in browsers. This is for the early
stage of an XProc pipeline, with a later stage that converts to XHTML 1.
--Paul
More information about the oXygen-user
mailing list