Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Format of serialized XML
Format of serialized XML [message #75302] Mon, 18 August 2008 09:26 Go to next message
Eclipse User
Originally posted by: moriz.eysholdt.de

Hi,

I'm looking for ways to control the XMLResource's output format, my aim
is to improve readability. I've found XMLResource.OPTION_FORMATTED and
XMLResource.OPTION_LINE_WIDTH which claim do exactly what I'm looking for...

Formating, especially indentation, seems not to be enabled for mixed
elements, though. I agree that this is a useful default behavior since
the text, which would be changed for formating, is actually part of the
model and not just something what gets thrown away while parsing.

But is there a way to enable formating for mixed elements, too?

Some of the files I want to format don't have an XML Schema and are
therefore loaded using AnyTypeImpl, which considers all it's children as
mixed.

thanks,
Moritz
Re: Format of serialized XML [message #75320 is a reply to message #75302] Mon, 18 August 2008 09:41 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25999
Registered: July 2009
Senior Member
Moritz,

Comments below.

Moritz Eysholdt wrote:
> Hi,
>
> I'm looking for ways to control the XMLResource's output format, my
> aim is to improve readability. I've found XMLResource.OPTION_FORMATTED
> and XMLResource.OPTION_LINE_WIDTH which claim do exactly what I'm
> looking for...
>
> Formating, especially indentation, seems not to be enabled for mixed
> elements, though.
That's by design. The mixed content is echoed exactly as specified in
the model itself.
> I agree that this is a useful default behavior since the text, which
> would be changed for formating, is actually part of the model and not
> just something what gets thrown away while parsing.
>
> But is there a way to enable formating for mixed elements, too?
Nope.
>
> Some of the files I want to format don't have an XML Schema and are
> therefore loaded using AnyTypeImpl, which considers all it's children
> as mixed.
Yes, it doesn't know any better. I could imagine coming up with yet
another formatting option that handle white space in mix content as
being meaningless and hence changeable. It would be quite a bit of work...
>
> thanks,
> Moritz
Re: Format of serialized XML [message #603233 is a reply to message #75302] Mon, 18 August 2008 09:41 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25999
Registered: July 2009
Senior Member
Moritz,

Comments below.

Moritz Eysholdt wrote:
> Hi,
>
> I'm looking for ways to control the XMLResource's output format, my
> aim is to improve readability. I've found XMLResource.OPTION_FORMATTED
> and XMLResource.OPTION_LINE_WIDTH which claim do exactly what I'm
> looking for...
>
> Formating, especially indentation, seems not to be enabled for mixed
> elements, though.
That's by design. The mixed content is echoed exactly as specified in
the model itself.
> I agree that this is a useful default behavior since the text, which
> would be changed for formating, is actually part of the model and not
> just something what gets thrown away while parsing.
>
> But is there a way to enable formating for mixed elements, too?
Nope.
>
> Some of the files I want to format don't have an XML Schema and are
> therefore loaded using AnyTypeImpl, which considers all it's children
> as mixed.
Yes, it doesn't know any better. I could imagine coming up with yet
another formatting option that handle white space in mix content as
being meaningless and hence changeable. It would be quite a bit of work...
>
> thanks,
> Moritz
Previous Topic:Format of serialized XML
Next Topic:Facets retrieving - getFacetContents
Goto Forum:
  


Current Time: Wed Aug 20 20:33:42 EDT 2014

Powered by FUDForum. Page generated in 0.01548 seconds