XHTML-XForms NVDL: spurious ID/IDREF errors

Issues related with the oNVDL implementation of NVDL.
madde001
Posts: 80
Joined: Fri Apr 23, 2004 5:24 pm
Location: Durham, NC, USA

XHTML-XForms NVDL: spurious ID/IDREF errors

Post by madde001 »

Hi George et al,

I'm working on some XHTML with embedded XForms. I noticed the NVDL script for this combination ("xhtml-xforms.nvdl") in the oxygen distribution under the "samples" directory, which looks like a modification of the script in the ISO NVDL spec document.
It seems to do what I need, but I'm getting one odd problem, relating to ID/IDREF checking within the XForms code.

In my XHTML+XFORMS instance document:
(1) In the xhtml header within the xforms:model, I place one or more named xforms:bind elements, e.g. <xforms:bind id="xyz" nodeset="foo" readonly="true()"/>
(2) Down in the xhtml body, I have an xforms control that I want to assign a nodeset using a @bind (an IDREF) to the @id (an ID) in my bind element from (1). So I write something like this: <xforms:input bind="xyz">...</xforms:bind>

I would expect that this would validate fine, but using the supplied script, I invariably get

Engine name: Jing
Severity: error
Description: cvc-id.1: There is no ID/IDREF binding for IDREF 'xyz'.

Here's a link to an instance document that gives this error: http://db.tt/WKHiqGx

Any ideas?

John
madde001
Posts: 80
Joined: Fri Apr 23, 2004 5:24 pm
Location: Durham, NC, USA

Re: XHTML-XForms NVDL: spurious ID/IDREF errors

Post by madde001 »

whoops. in (2) I mean <xforms:input bind="xyz"....>....</input>
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: XHTML-XForms NVDL: spurious ID/IDREF errors

Post by george »

Hi John,

I corrected an issue in Jing - it did not check ID/IDREF constrains from XML Schema validation, see
http://code.google.com/p/jing-trang/iss ... ail?id=114
and the XForms NVDL script splits each XForms section in a separate validation candidate, that is there are multiple validate operation, each on an XForms section, validations that are separate from each other. What happens is that the ID is defined in one section and referred in another and as these sections are validated separately there is no way for the reference to see the definition.

There are some ways forward:
- use an XForms schema that does not define ID/IDREF contraints and possibly add also a Schematron in the NVDL script that can be applied on the whole document and can perform the same checks
- change the NVDL script to place all the XForms content in a single validation candidate and validate that with an appropriate schema (that validation candidate needs to contain also the initial XHTML section, so the schema should handle this content)
- I can get back to Jing and add an option to switch off the ID/IDREF checking (but this is what you get if you modify the schema to replace ID and IDREF types with NMTOKEN)

I was aware of this as another user reported the problem the other days via twitter. I will try to update the sample, probably taking the first approach.

Best Regards,
George
George Cristian Bina
madde001
Posts: 80
Joined: Fri Apr 23, 2004 5:24 pm
Location: Durham, NC, USA

Re: XHTML-XForms NVDL: spurious ID/IDREF errors

Post by madde001 »

Thanks, George!
madde001
Posts: 80
Joined: Fri Apr 23, 2004 5:24 pm
Location: Durham, NC, USA

Re: XHTML-XForms NVDL: spurious ID/IDREF errors

Post by madde001 »

Hi George,

I suspected that was the issue. Based on what you say, I think that it isn't, strictly speaking, an oNVDL/Jing problem. Unless that NVDL script actually <attaches> all the separate xforms sections into a single section before validating them (your option #2), it's pretty much what you'd expect from the NVDL spec.

It's twisting my brain trying to figure out exactly how to script the NVDL to make that happen.

But if I can't manage it, I'll just modify the xforms schema to remove the check (your option #1).

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

Re: XHTML-XForms NVDL: spurious ID/IDREF errors

Post by george »

Hi John,

The NVDL script can attach all the XForms sections if you take also the initial XHTML section in that validation candidate. That means that you need a schema that accepts the initial XHTML section and the XForms content.

Best Regards,
George
George Cristian Bina
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: XHTML-XForms NVDL: spurious ID/IDREF errors

Post by george »

We will provide a solution for this, a new NVDL script that will extract all XHTML and it will validate it with the XHTML schema and then it will extract all the XForms content inside the root html element and validate this with a wrapper schema that defines only the root html element and as content allows only XForms elements. This will be available soon in oXygen 12.1.

Best Regards,
George
George Cristian Bina
Post Reply