rng "required attributes missing"

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Chris Lilley
Posts: 10
Joined: Fri Aug 06, 2004 8:59 am

rng "required attributes missing"

Post by Chris Lilley »

Firstly, nice product. Easy to install and use, looks and feels good.

My main reason for investigating Oxygen is because I need an XML editor that can validate using RNG and give editing help using RNG.

The error messages when validation fails could be more helpful. For example,

E required attributes missing template.svg file:/E:/cygwin/home/Chris/newsvg/svg/testsuite/1.2/status/template.svg 5:1

Ok, there is a required attribute missing (I can't see one myself but perhaps the schema is wrong, or I am working too late) .... telling me which attribute is missing would be a big help though. Otherwise i have to go read the RNG myself, its large and split over multiple modules, and that is what computers are for.

Or maybe I missed a configuration option that would do this?

(and yes, SVG 1.2 will have a Relax NG schema)
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Chris,

Thanks for your appreciation.
Oxygen uses Jing for validating XML documents against Relax NG schemas and that error message is what Jing gives. We will see if there is something that we can improve in this direction. One thing that is already on our todo list is a better support for the content completion driven by Relax NG schemas. This should enable also showing the required attributes so that even if the error message will not tell what attribute is required the users should be able to see it in the content completion popup or in the schema model view.

Best Regards,
George
Chris Lilley
Posts: 10
Joined: Fri Aug 06, 2004 8:59 am

Post by Chris Lilley »

Yes that was the next thing I tried: place cursor after the last attribute, type a space, do control-space to trigger completion ( I assume that attributes already present on the element are not re-suggested).

But it seems that autocomplete (required elements and attributes, prompting on optional ones) is not as fully featured using rng as, say, a dtd.

I look forward to improvements in this area. Should I bug James about it as well? :P

One short term improvement that might be possible - in the pop-up autocompete menu for attributes, distinguish required and optional attributes by color.
Chris Lilley
Posts: 10
Joined: Fri Aug 06, 2004 8:59 am

Post by Chris Lilley »

I'm happy to note that editing support is working much better in oXygen 5.1, typing the first few letters of an attribute brings up a popup to select the attribute.

However, validation seems to have the same problem - if an attribute is missing, the error is merely
E: required attributes missing

I can move to the relevant element, type a space and get a drop down nof all the possible attributes. Hwever, it does not ndicate which attributes are required.

So, I still feel the validator is hiding information from me and making me do a mental validation in my head, in parallel with the machine ... if the validator knows an attribute is required and not present, it could tell me the name of that attribute.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Chris,

We are using Jing and that is all we get.
Hmm... the things are not always easy with Relax NG. Consider the case when you have a choice between 3 attributes:

Code: Select all


start =
element test {
attribute a { text }
| attribute b { text }
| attribute c { text }
}
If test does not have attributes the error message is the same, required attributes missing but there is not one required attribute.
What attributes shall the editor flag as required in this case?
One thing that I think is possible is to present the attributes also in the model presented in the Model View eventually in addition to the current model that serializes the pattern after the element attributes were processed.

Best Regards,
George
Chris Lilley
Posts: 10
Joined: Fri Aug 06, 2004 8:59 am

Post by Chris Lilley »

I agree its not easy, although in that example the choice of a | b | c would be better than 'an attribute'. I also agree that you only get what Jing gives you, which is why I suggested that some liaison with James might be fruitful.

Dropping him an email and suggesting the problem is hard or even insoluble is likely to produced revised code proving it isn't :lol:
Post Reply