[jdom-interest] Removing default encoding.

Tasso Angelidis TassoA at trustmarque.ca
Thu Aug 9 12:02:33 PDT 2001


Worked perfectly ;)

-----Original Message-----
From: Rick Nucci [mailto:rick_nucci at boomi.com]
Sent: Thursday, August 09, 2001 3:07 PM
To: Tasso Angelidis
Cc: jdom-interest at jdom.org
Subject: RE: [jdom-interest] Removing default encoding.


Hi Tasso,

try --> XMLOutputter.setOmitEncoding(boolean omit)

-Rick

-----Original Message-----
From: jdom-interest-admin at jdom.org
[mailto:jdom-interest-admin at jdom.org]On Behalf Of Tasso Angelidis
Sent: Thursday, August 09, 2001 2:47 PM
To: 'jdom-interest at jdom.org'
Subject: [jdom-interest] Removing default encoding.


Hi I am creating a document...

  public String createErrorMessage(String code, String message)
  {
      Element root = new Element("TMSTN");
      Element error = new Element("Error");
      Element errCode = new Element("Code");
      Element errMessage = new Element("Message");

      root.addContent(error);
      error.addContent(errCode);
      error.addContent(errMessage);
      errCode.addContent(code);
      errMessage.addContent(message);

      Document doc = new Document(root);


      XMLOutputter output = new XMLOutputter();
      StringWriter writer = new StringWriter();

      try
      {
        output.output(doc, writer);
      }
      catch(Exception e)
      {}

      return(writer.toString());
  }

The output...

<?xml version="1.0" encoding="UTF-8" ?>
<TMSTN>
	<Error>
		<Code>100</Code>
		<Message>Insert successfull.</Message>
	</Error>
</TMSTN>

Is it possible to not print the default encoding >>>> encoding="UTF-8"
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com



More information about the jdom-interest mailing list