Pages

Tags

Validation (9) XML (9) Geeky (3) Java (3) Android (2) Business IT (1) Chromecast (1) Devfest (1) Web (1)

Thursday, May 27, 2010

New version of NVDL available


JNVDL 20071112 ..download latest version here.

I have created a new version of the JNVDL suite for compound document validation. The new version reflects the latest Murata Makoto's chnages in the NVDL specification including big changes in attribute section handling.
A major usability enhancement was validation debug outputs. Now the outputs correspond to how examples are shown in the specification. You will find in he output only what you are really interested in. Using the -d for validation the XFroms example from the specification shows the following output. You see exactly what JNVDL did, all the element and attribute sections it has created, interpretations it assigned to each section and finally fragments and what schema has been used to validate them. This may significatly help with debugging of your validation but also of JNVDL.

Example 1. Example JNVDL debug output
petr@alfa-pn-3:~/dev/project/nvdl/impl/dist$ ./jnvdl.sh -s ./example/primary/spec-xf-html.nvdl.xml -d ./example/primary/spec-xf-html.instance.xml
Round tripping: false
Keep line numbers: false
Stage 1 - Decomposing Sections -
        <{http://www.w3.org/2002/06/xhtml2} ES1(table)>
                <{http://www.w3.org/2002/xforms} ES2(repeat)>
                  AS{}(id nodeset )
                        <{http://www.w3.org/2002/06/xhtml2} ES3(tr)>
                                <{http://www.w3.org/2002/xforms} ES4(input)>
                                  AS{}(ref )
                                        <{http://www.w3.org/2002/06/xhtml2} ES5(p)>
                                                <{http://www.w3.org/2002/xforms} ES6(label)>
                                                </ES6(label)>
                                        </ES5(p)>
                                </ES4(input)>
                        </ES3(tr)>
                </ES2(repeat)>
        </ES1(table)>

Stage 2 - Building Interpretations -

Interpretation 1

                AS{}(ref )
                                 [ATTACH]
                ES1(table)
                                 [VALIDATE against '../secondary/xhtml2/xhtml2.rng']
                ES4(input)
                                 [ATTACH]
                AS{}(id nodeset )
                                 [ATTACH]
                ES2(repeat)
                                 [VALIDATE against '../secondary/xforms/xforms.rng']
                ES5(p)
                                 [UNWRAP]
                ES6(label)
                                 [ATTACH]
                ES3(tr)
                                 [UNWRAP]

Interpretation 2

                AS{}(ref )
                                 [ATTACH]
                ES1(table)
                                 [VALIDATE against '../secondary/xhtml2/xhtml2.rng']
                ES4(input)
                                 [UNWRAP]
                AS{}(id nodeset )
                                 [ATTACH]
                ES2(repeat)
                                 [UNWRAP]
                ES5(p)
                                 [ATTACH]
                ES6(label)
                                 [UNWRAP]
                ES3(tr)
                                 [ATTACH]

Stage 3 and 4 - Combining Sections and Filtering -
        Validation candidate overwritten by a larger fragment:
 [1 < 4]<table xmlns="http://www.w3.org/2002/06/xhtml2" xmlns:xforms="http://www.w3.org/2002/xforms">  <tr>  <td>  <p>    </p>  </td>  </tr>  </table>

Stage 5 - Validation -

        Schema 'file:/home/petr/dev/project/nvdl/impl/dist/./example/primary/../secondary/xhtml2/xhtml2.rng'
        Namespace 'http://relaxng.org/ns/structure/1.0'
        Fragment: '<table xmlns="http://www.w3.org/2002/06/xhtml2" xmlns:xforms="http://www.w3.org/2002/xforms">  <tr>  <td>  <p>    </p>  </td>  </tr>  </table>'
ERROR: line 1 column 94, tag name "table" is not allowed. Possible tag names are: <html>

        Schema 'file:/home/petr/dev/project/nvdl/impl/dist/./example/primary/../secondary/xforms/xforms.rng'
        Namespace 'http://relaxng.org/ns/structure/1.0'
        Fragment: '<xforms:repeat xmlns:xforms="http://www.w3.org/2002/xforms" id="lineset" nodeset="/my:lines/my:line">  <xforms:input ref="my:price">  <xforms:label>Line Item</xforms:label>  </xforms:input>  </xforms:repeat>'

1 comment:

  1. Thank you for putting this together. This information will help me to be more effective. I enjoyed reading the article above, really explains everything in detail. Thank you and good luck for the next articles

    DedicatedHosting4u.com

    ReplyDelete