Format of serialized XML [message #75302] |
Mon, 18 August 2008 13:26  |
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 13:41  |
Eclipse User |
|
|
|
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 13:41  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03070 seconds