Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Format of serialized XML
Format of serialized XML [message #75302] Mon, 18 August 2008 13:26 Go to next message
Eclipse UserFriend
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 13:41 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Format of serialized XML [message #603233 is a reply to message #75302] Mon, 18 August 2008 13:41 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Format of serialized XML
Next Topic:Facets retrieving - getFacetContents
Goto Forum:
  


Current Time: Fri Apr 19 18:33:30 GMT 2024

Powered by FUDForum. Page generated in 0.03601 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top