[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [xliff-comment] Section 2.5.4 Validating Documents with Extensions - needs revision
Doug, all, (for us reading the comments list, this is a reply to http://www.oasis-open.org/archives/xliff/200610/msg00027.html ) On 10/26/06, Doug Domeny <ddomeny@ektron.com> wrote: > After analysis, I now recommend processContents="strict" for the strict > schema. All modified files are attached. > > strict lax w/ xsd lax w/o xsd > valid invalid valid invalid valid > StylusStudio 2006 correct correct correct valid correct > MSXML 4 DOM correct correct correct valid correct > MSXML 6 DOM correct correct correct valid correct > Saxonica 8.7 correct correct correct valid correct > .NET XML correct correct correct correct error > Xerces-J 2.5.1 correct correct correct valid correct > XSV 2.10-1 correct correct correct valid error† > > † if URI returns error 404 > > As you can see, "lax" for most of the parsers is the same as "skip" and > therefore useless except in .NET parser, which acts like "strict". I'm not sure these tests serves 'lax' the full justice it deserves. This might be because you are using StylusStudio to validate files using the above validators? I did some further investigation and came up with 16 test cases based on the following 4 (boolean) attributes: 1) Invalid Content - If the <any> type contains elements defined in foreign schema 'other' and the contents of the element is not valid according to its specification. 2) Undeclared Elements - If the <any> type contains elements *NOT* defined in foreign schema 'other'. 3) schemaLocation - If the XML contains a schemaLocation hint for the foreign schema 'other' 4) Schema available - If the foreign schema 'other' is available in the file system path Please see the attachment for the test data and results (CompareValidators.xls). Before starting this test, I had a hypothesis that attribute 2 (undeclared elements) above should not affect 'lax' validation, and the majority of validators tested proved this true. If an element which is not declared in a foreign namespace occurs in an <any> type, even if *a* schema for this namespace is resolved, it will pass 'lax' validation. This seems to be the common interpretation of the Schema specification. I was however unable to find a good reference to a discussion on this. I have a personal theory that this is because of the way namespaces are resolved - they do not according to the Schema spec have to be from a single file or location, a schema can e.g. use the <xsd:include /> element and if this second file is not available, the xml processor would 'laxly' ignore this and still validate 'if it can'. But as I said, this is just a theory. Some notes: XSV: - Produces an error when schemaLocation is available for a namespace processed with 'lax' when the schema file could not be found in the file system. This is most probably a bug in the validator, or a rather strict interpretation of the schemaLocation attribute. Validating in StylusStudio: - The tool does not report schema validity errors correctly, as it simply prints out all messages and does not distinguish between informational messages, warnings and errors. It is practically impossible to interpret if a schema is valid or invalid based on this. This is evident particularly in the xerces and xsv validator, as I have these tools also outside of StylusStudio. I cannot comment on the .NET validator used in StylusStudio, as I do not have a .NET 1.x validator readily available - but I suspect some of the 'errors' in this validator are really warnings, hence the question mark in the test results. I hope this helps clear up a few things, and bring my good friend Lax some justice. regards, asgeir -- Asgeir Frimannsson PhD Candidate School of Software Engineering and Data Communications Queensland University of Technology 126 Margaret Street, Level 3 Brisbane QLD 4001, Australia Phone: (+61) 7 3138 9332 Mob: (+61) 405 412 696 Email: a.frimannsson@qut.edu.au -- Asgeir Frimannsson PhD Candidate School of Software Engineering and Data Communications Queensland University of Technology 126 Margaret Street, Level 3 Brisbane QLD 4001, Australia Phone: (+61) 7 3138 9332 Mob: (+61) 405 412 696 Email: a.frimannsson@qut.edu.au
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]