Aelfred2 problem with whitespace

Maarten Coene <[email protected]>
Newsgroups gmane.comp.java.classpath.extensions.xml
Message-ID <[email protected]>
Hi,

thanks for fixing my previous problems, however I'm having a new 
problem: the Aelfred2 parser removes the whitespace in my element content.

For instance, if I parse the following document:
    <root>&lt;head&gt; &amp; &lt;body&gt;</root>
the spaces before and after the "&amp;" are lost!!

Here is some code that illustrates the problem:

    public void testWhitespace() throws Exception {
        String xml = "<root>&lt;head&gt; &amp; &lt;body&gt;</root>";
        InputStream in = new ByteArrayInputStream(xml.getBytes());
       
        SAXParserFactory factory = new JAXPFactory();
        factory.newSAXParser().parse(in, new DefaultHandler2() {
            public void characters(char[] ch, int start, int end) {
                System.out.print(new String(ch, start, end));
            }
        });
    }

This is the output I'm getting:
<head>&<body>

but I was expecting this output:
<head> & <body>


regards,
Maarten
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.