Page 1 of 1

NVDL and nested fragments

Posted: Fri Aug 28, 2015 1:28 am
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?

Re: NVDL and nested fragments

Posted: Fri Aug 28, 2015 3:56 pm
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

Re: NVDL and nested fragments

Posted: Fri Aug 28, 2015 11:38 pm
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

Re: NVDL and nested fragments

Posted: Sun Aug 30, 2015 11:59 pm
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