Page 1 of 1

<keyref> not finding all bad data elements at once

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

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

Posted: Tue Apr 29, 2008 11:10 am
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

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

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

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

Posted: Thu May 01, 2008 2:11 pm
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

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

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

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

Posted: Fri May 02, 2008 9:01 am
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

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

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

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

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

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

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

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

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