[jdom-interest] XMLOutputter generates weird chars

Ivo Jánský linux4life at seznam.cz
Tue Jul 26 09:48:31 PDT 2005


Hi,

when I run the following code:

	//in the xml variable (java.lang.String) is the actual XML code

	SAXBuilder builder = new SAXBuilder("org.apache.xerces.parsers.SAXParser", false);
	Document document = builder.build(new ByteArrayInputStream(xml.toBytes()));

	Format format = Format.getPrettyFormat();
	XMLOutputter fmt = new XMLOutputter(format);
	xml = fmt.outputString(document);
	System.out.println(xml);

I see this in the console:

<cXML payloadID="9949494-196 at ariba.com" xml:lang="en-US" timestamp="2000-02-04T18:39:49-08:00" version="1.2.013">
	<Response>
		<Status code="200" text="OK"/>
		<ProfileResponse effectiveDate="2000-01-01T05:24:29-08:00" a-dtype="effectiveDate dateTime.tz lastRefresh dateTime.tz">
			<Transaction requestName="OrderRequest" a-dtype="requestName NMTOKEN">
				<URL>http://service.ariba.com/cgi/orders.cgi</URL>
			</Transaction>
			<Transaction requestName="PunchOutSetupRequest" a-dtype="requestName NMTOKEN">
				<URL>http://service.ariba.com/cgi/PunchOut.cgi</URL>
			</Transaction>
		</ProfileResponse>
	</Response>
</cXML>

but I should see this:

<cXML payloadID="9949494-196 at ariba.com" xml:lang="en-US" timestamp="2000-02-04T18:39:49-08:00" version="1.2.013">
	<Response>
		<Status code="200" text="OK"/>
		<ProfileResponse effectiveDate="2000-01-01T05:24:29-08:00">
			<Transaction requestName="OrderRequest">
				<URL>http://service.ariba.com/cgi/orders.cgi</URL>
			</Transaction>
			<Transaction requestName="PunchOutSetupRequest">
				<URL>http://service.ariba.com/cgi/PunchOut.cgi</URL>
			</Transaction>
		</ProfileResponse>
	</Response>
</cXML>

the difference?
a-dtype=... should not be there

I just can't figure out what is wrong. Any ideas?


More information about the jdom-interest mailing list