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><head> & <body></root>
the spaces before and after the "&" are lost!!
Here is some code that illustrates the problem:
public void testWhitespace() throws Exception {
String xml = "<root><head> & <body></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