<keyref> not finding all bad data elements at once

This should cover W3C XML Schema, Relax NG and DTD related problems.
mlcook
Posts: 67
Joined: Thu Jan 24, 2008 4:52 pm

<keyref> not finding all bad data elements at once

Post by mlcook »

I've successfully defined some keys and keyrefs in a schema for my data.

One section of data has several out-of-bounds data values in it, but the appropriate keyref and Oxygen 9.1 only gives an error on the first occurance of an error.

When I fix that error, the next one is flagged with an error message. And so on, one by one, as they get fixed.

Is there anyway to get a keyref in Oxygen to flag all the bad data elements at once with error messages for each instance?

Thanks, Mike
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Re: <keyref> not finding all bad data elements at once

Post by Dan »

Hello Mike,
oXygen is using as XML Schema validator the Xerces parser. Unfortunately the validator stops after each error. We will try to force it to continue to the end of the document.
Regards,
Dan
mlcook
Posts: 67
Joined: Thu Jan 24, 2008 4:52 pm

Re: <keyref> not finding all bad data elements at once

Post by mlcook »

Thanks for looking into it. I was concerned that I wasn't doing things quite right in the schema, or had some tool setting wrong.

Hope it isn't too bad to work on.

Thanks again,
Mike
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: <keyref> not finding all bad data elements at once

Post by george »

Hi Mike,

Can you post a sample to reproduce the problem.
I tried changing the personal-schema.xml from the oXygen samples putting some wrong values for the manager attribute in two link elements and I can see both errors when the document is validated.

Best Regards,
George
George Cristian Bina
mlcook
Posts: 67
Joined: Thu Jan 24, 2008 4:52 pm

Re: <keyref> not finding all bad data elements at once

Post by mlcook »

George,

Would you mind letting me know how to send you a private email so I don't have to post my files in public?

I'll try to send a reduced pair of files to demonstrate the problem.

Thanks, Mike
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: <keyref> not finding all bad data elements at once

Post by Radu »

Dear Mike,

You can zip and send the test files to the email specified on our technical support page or directly from the form located there:
http://www.oxygenxml.com/techSupport.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: <keyref> not finding all bad data elements at once

Post by george »

Dear Mike,

Thank you for sending the sample files.
oXygen supports multiple XML Schema processors Xerces being the default.
Most XML Schema processors report only one error in this case but LIBXML reports all the errors [1]. You can use it to validate your file either from the Custom Validation combo box from the toolbar or by configuring a custom validation scenario and setting LIBXML as the validation engine.

If you encounter difficulties in configuring a transformation scenario or using LIBXML as a custom engine let us know.

[1] The errors reported by LIBXML on the sample file:

SystemID: C:\george\test\keyref-prob.xml
Location: 25:0
Description: Schemas validity error : Element '{http://mycompany.com/SystemTest/Test}B': No match found for key-sequence ['101017'] of keyref '{http://mycompany.com/SystemTest/Test}Unique-Value'.

SystemID: C:\george\test\keyref-prob.xml
Location: 27:0
Description: Schemas validity error : Element '{http://mycompany.com/SystemTest/Test}B': No match found for key-sequence ['101018'] of keyref '{http://mycompany.com/SystemTest/Test}Unique-Value'.

SystemID: C:\george\test\keyref-prob.xml
Location: 29:0
Description: Schemas validity error : Element '{http://mycompany.com/SystemTest/Test}B': No match found for key-sequence ['100001'] of keyref '{http://mycompany.com/SystemTest/Test}Unique-Value'.

SystemID: C:\george\test\keyref-prob.xml
Location: 31:0
Description: Schemas validity error : Element '{http://mycompany.com/SystemTest/Test}B': No match found for key-sequence ['100002'] of keyref '{http://mycompany.com/SystemTest/Test}Unique-Value'.

Best Regards,
George
George Cristian Bina
mlcook
Posts: 67
Joined: Thu Jan 24, 2008 4:52 pm

Re: <keyref> not finding all bad data elements at once

Post by mlcook »

Thanks!

I was able to setup the LIBXML validation engine, and got all the error messages.

Since LIBXML is a custom validation engine, it appears that I have to setup the custom validation for each XML file I want to validate.

Is there a way to make LIBXML the automatic default for future XML files and schemas?

Thanks again for your help,
Mike
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: <keyref> not finding all bad data elements at once

Post by Radu »

Hi Mike,

Unfortunately there is no way to make a custom validator(such as LIBXML) the default validator. We will consider adding this feature to a future version of Oxygen.

As a workaround you can use the custom validator toolbar and choose LIBXML.
See this link http://www.oxygenxml.com/doc/ug-oxygen/ ... ation.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
mlcook
Posts: 67
Joined: Thu Jan 24, 2008 4:52 pm

Re: <keyref> not finding all bad data elements at once

Post by mlcook »

I have been able to set LIBXML as the custom validator for several XML files. It's pretty much a one time thing for each file, but I'll have to remember it for each new file. Not a big problem.

Thanks to George, Radu, Dan, and any others behind the scenes.

Things are better now. I also know I hadn't done the key checking wrong.

-- Mike
Post Reply