<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 » Mon Apr 28, 2008 5:52 pm

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: 484
Joined: Mon Feb 03, 2003 10:56 am

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

Post by Dan » Tue Apr 29, 2008 11:10 am

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 » Tue Apr 29, 2008 4:24 pm

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: 2102
Joined: Thu Jan 09, 2003 2:58 pm

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

Post by george » Thu May 01, 2008 2:11 pm

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 » Thu May 01, 2008 4:33 pm

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: 7529
Joined: Fri Jul 09, 2004 5:18 pm

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

Post by Radu » Fri May 02, 2008 9:01 am

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: 2102
Joined: Thu Jan 09, 2003 2:58 pm

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

Post by george » Fri May 02, 2008 4:07 pm

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 » Fri May 02, 2008 4:52 pm

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: 7529
Joined: Fri Jul 09, 2004 5:18 pm

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

Post by Radu » Fri May 02, 2008 5:33 pm

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 » Fri May 02, 2008 5:50 pm

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