Problems with Mixed Content and XMLOutputter

"Grimm, Markus" <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>
Hi,

 

We handle with XML-Documents including elements with mixed-content.

 

an easy example:

=============

...

<text>

            <Content><P>Hello <B>World</B> how are you?</P></Content>

</text>

...

 

I have to use Compact-Format to output the document as string. Later
this output is used to create a html-view of the content.

But the outputter-result looks like:  <Content><P>Hello<B>World</B>how
are you?</P></Content>

The space befor <B>World and after World</B> is deleted.

The reason is simple, if you look in the XMLOutputter. But I think it's
a fault?!

In Mixed-Content perhaps I need a single space at those positions. In
such cases of mixed-content they should be handled as spaces in a
string.

They shouldn't be trimed.

 

So,  I had to pimp the XMLOutputter for my needs. Now he knows what kind
of node a) follows to a text-node or b) follows to an Element.

When it's a) an Element, the text-node isn't right-trimed and it's b) a
text-node so the same text-node isn't left-trimmed. So far so good.

 

What do the developers think about a own solution in the jdom-package
for this problem?

 

Bye,

Markus

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.