You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by v - Michael James <vm...@punchnetworks.com> on 2000/03/31 00:16:33 UTC

Better way to generate XML?

We have legacy code which creates XML by doing
stuff like:

StringBuffer result = new StringBuffer( "<?xml version =\"1.0\"?>\n" );
result.append("<xml ID=\"xmlTree\">\n");
result.append("<tree>\n<root>\n");
result.append("  <accountinfo loginid=\"" + getUser().getLoginID());
(and so forth)

I downloaded Xerces-J because I wanted to replace this
with a more formal method of generating XML, in the hopes
this would guarantee it to be well formed.  But I was
disappointed to discover examples such as DOMWriter.java
are doing it the same way we are.

Is there a different tool I should be using to
generate XML output?

RE: Better way to generate XML?

Posted by Linda Derezinski <li...@interfacecontrol.com>.
Did you look at the serialize functions ??


Linda Derezinski
Interface & Control Systems

 -----Original Message-----
From: 	v - Michael James [mailto:vmjames@punchnetworks.com] 
Sent:	Thursday, March 30, 2000 5:17 PM
To:	'xerces-j-dev@xml.apache.org'
Subject:	Better way to generate XML?

We have legacy code which creates XML by doing
stuff like:

StringBuffer result = new StringBuffer( "<?xml version =\"1.0\"?>\n" );
result.append("<xml ID=\"xmlTree\">\n");
result.append("<tree>\n<root>\n");
result.append("  <accountinfo loginid=\"" + getUser().getLoginID());
(and so forth)

I downloaded Xerces-J because I wanted to replace this
with a more formal method of generating XML, in the hopes
this would guarantee it to be well formed.  But I was
disappointed to discover examples such as DOMWriter.java
are doing it the same way we are.

Is there a different tool I should be using to
generate XML output?

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org