Validating element content

  • 1 reply.
  • This is not yet resolved.
  • This question was started by Trevor.
  • Last post by Sjoerd Visscher.
Trevor
member
August 6th 2010
I have found that Xopus has a tendency to leave empty elements in the source document if the user is less than fastidious about checking the effects of what they are doing. I can easily delete such elements in a post-save XSL transform, but I would prefer the user to see a validation error while they are editing the document. Is there a set of methods/events which would allow me to do this?

For example, suppose my schema has a "title" element which has a simple content model (in DTD form for brevity) of

(#PCDATA|em|bold|sup|sub)*

The schema can't mandate this "mixed" element to contain something more than nothing, so Xopus allows the user to insert an empty title. I would like Xopus to object (somehow!) to anything the user does which produces an empty title element. (And I have a short list of other elements with similar semantic restrictions too.)

Is there something I can do here, or am I barking up the wrong tree?

Cheers
T
Sjoerd Visscher
Xopus Team
August 9th 2010
Since you are saying "somehow", what you could do is to put warning messages in placeholders:
http://xopus.com/documentation/configuration/elements/placeholder.html

You could a add a CSS rule
.xopus-placeholder { color: red !important }
to show the placeholders more prominently.

React

HTML will be shown as HTML code.
Linebreaks and Links starting with http:// are automatically resolved