On 26 Oct 2004, at 7:03 PM, James Clark wrote:
> On Tue, 2004-10-26 at 10:55, Rohan Lloyd wrote:
>
>> I was wondering about the possibility of displaying annotations in
>> nxml-mode. For instance, imagine that we have a RELAX NG schema
>> containing:
>>
>> element config {
>> ## Maximum foo count
>> element max-foo { xsd:integer minInclusive="3" maxInclusive="10"
>> }
>> }
>>
>> When editing such an XML file, it would be nice to be able to view the
>> annotation somehow.
>
> Yes, this would be nice. It's in the TODO list I think.
> Unfortunately,
> it would be a substantial implementation effort, so don't hold your
> breath.
Is that what "Take advantage of a:documantation. Needs change to schema
format." means?
>> Also nxml-mode nicely handles the validation, and gives me an error if
>> I enter something not in the range [3..10], but the error is not very
>> specific. It just says "Invalid Data"
>>
>> It would be a big improvement if it could provide something a little
>> more specific like "Invalid data - must be integer between 3 and 10"
>> Would that be possible, at least for some of the simpler standard data
>> types?
>
> What about just using RNC itself to describe what is required, eg
>
> Data must match: xsd:integer { minInclusive="3" maxInclusive="10" }
Isn't that what I've done (if you forgive the missing "{ ... }" in my
example).
The problem is that although nxml-mode correctly uses the constraint to
validate the document, if it fails validation the user is not told what
the problem is other than "Invalid Data".
A savvy user will then look at the RNC schema, and see what they should
be entering. But it would be better if the error told them that.
> ? I don't like the idea of trying to devise a natural language
> representation of (a presumably fairly arbitrary subset of) RNC,
Good point about trying to do it in natural language.
What about just appending the constraint that failed. For instance in
the above example, the error would become:
Invalid Data - must match: xsd:integer { minInclusive="3"
maxInclusive="10" }
--
Rohan Lloyd
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/2U_rlB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/emacs-nxml-mode/
<*> To unsubscribe from this group, send an email to:
emacs-nxml-mode-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|