NVDL and nested fragments

Post here issues about NVDL, not specifically linked to the oNVDL implementation.
martindholmes
Posts: 176
Joined: Wed Apr 20, 2005 5:43 pm
Location: Victoria, BC, Canada

NVDL and nested fragments

Post by martindholmes »

IN a couple of projects, I'm producing documents with content from multiple namespaces, usually as part of a larger processing chain. For instance, I might have a TEI document which inside its body element contains an XHTML table:

Code: Select all


[...]
<tei:text>
<tei:body>
<tei:div>
<xhtml:table>
....
</xhtml:table>
</tei:div>
</tei:body>
</tei:text>
[...]
I'd like to use NVDL to validate these sorts of document, and I can see how to set up validation for the TEI namespace and the NVDL namespace; what I can't figure out (maybe it's impossible) is how to tell the validation action for the XHTML namespace that the root element for the purposes of validation should be <xhtml:table>, not <xhtml:html>, which is what the XHTML schema expects. What I'd like to do is validate the table and its descendants according to the XHTML schema, but on the basis that it's a fragment and not a complete document, so its root element is not <xhtml:html>.

Is this feasible with NVDL? If so, how can it be done?
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: NVDL and nested fragments

Post by Radu »

Hi Martin,

I found a similar question here (along with workaround posted by George Bina):

http://www.oxygenxml.com/forum/topic6158.html#p18868

Maybe another workaround would be to use an XML Schema to validate the XHTML parts, for example the one at:

http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd

which is already mapped through our XML catalogs to a local copy.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
martindholmes
Posts: 176
Joined: Wed Apr 20, 2005 5:43 pm
Location: Victoria, BC, Canada

Re: NVDL and nested fragments

Post by martindholmes »

Thanks Radu, that's helpful. I'll need a portable solution (some of this validation happens on a server without Oxygen), so I think I might have to follow George's suggested workaround.

This seems a fairly severe limitation of NVDL. Surely it's more common to embed fragmentary content from another namespace rather than complete documents, in most use-cases.

Cheers,
Martin
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: NVDL and nested fragments

Post by george »

Hi Martin,

In this case the problem is not NVDL but the schema for XHTML - it was constructed to allow only html as root element.
Alternatively, you may consider using XProc, that will allow you to wrap the XHTML fragment in the missing elements and then trigger the validation step.

Best Regards,
George
George Cristian Bina
Post Reply