[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Classpathx-xml] Aelfred2 problem with whitespace
From: |
Maarten Coene |
Subject: |
[Classpathx-xml] Aelfred2 problem with whitespace |
Date: |
Fri, 06 Aug 2004 12:20:35 +0200 |
User-agent: |
Mozilla Thunderbird 0.7.2 (Windows/20040707) |
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
- [Classpathx-xml] Aelfred2 problem with whitespace,
Maarten Coene <=