|
Re: option to prohibit mixed contents [message #528462 is a reply to message #528449] |
Tue, 20 April 2010 15:27 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Henrik,
You'll need to specialize how XMLHandler.characters deals with this case.
Henrik Rentz-Reichert wrote:
> Hi,
>
> is it possible to prohibit mixed contents when reading XML? Is there
> maybe an option to control this behavior?
>
> In my situation I have an editor which exposes a sub-tree of the model
> as plain XML text. The allowed elements are sort of a subset of XHTML.
> But the top level elements are paragraph items.
>
> For validation and conversion I transform this text using the
> XMLResourceImpl of my model to create model elements from text and vice
> versa. (To have a valid model against the schema I add extra XML
> surrounding my text.)
>
> Now a valid text is e.g.
>
> "<p>Some text</p><p>More text</p>"
>
> but mixed contents on the top level like
>
> "text <p>more text</p> and even more"
>
> or
>
> "some text"
>
> should be forbidden.
>
> Currently this sort of text is valid but dropped.
>
> Any hints?
>
> Thanks,
> Henrik
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03573 seconds