Altova Mailing List Archives

Re: creating xml within java app

From: "Martin SChukrazy" <prak24@-------.--->
Date: 2/27/2004 2:00:00 PM
The only reason you would want to use DOM or SAX etc would be to ensure a
well-formed XML (conformant to a Schema). So if you dont need this then why
bother ? what you are doing with the string buffer is quite sufficient for
now. However if you want the absolute correct way to do is to validate your
XML document once you create it, sort of an error checking for debugging...

The advantage of validating the xml you just created would be to make sure
all the elements required are present and that the XSLT transformation does
not fail for that purpose (kinda like a debugging step).
The disadvantage is that it requires additional processing & work (again
dependent on the system) to get this working.
So the question is do you think the advantages outweigh the disadvantages?
Is your system able to catch errors in the data flow before and after the
XSLT transformation?

"TP" <tpass001@h...> wrote in message
> Martin,
> Thanks for replying. As of this point, validation is not required. So
> in my case is it wise to move towards actually creating an xml
> document using the DOM or SAX OR what I am doing with StringBuffer is
> enough for my needs. Basically the xml created is passed through an
> XSLT transformation.
> Thanks.
> TP.
> "Martin SChukrazy" <prak24@h...> wrote in message
> > Validation of an xml document is not required when parsing (you can use
> > non-validating parser's).
> > So the question is do you need to validate the xml document (against a
> > you just created or not for a particular reason.
> > If the xml document is used for external interfacing (process or system)
> > then it would be wise to validate the xml you created.
> > If it is not intended for that purpose then you must decide whether its
> > worth the extra processing step...
> >
> > Hope this helps...
> >
> > "TP" <tpass001@h...> wrote in message
> > news:5947ff63.0402260716.2a3b92a@p......
> > > Hi,
> > >
> > > I have reached a situation where I have to create small pieces of xml
> > > (around 8k characters) within my java app. Right now I am using
> > > stringbuffer to create the xml which does not go against a dtd. This
> > > is working for now, since I do not have to read in the xml again.
> > >
> > > But if I wanted to use some other xml utility like xerces or jdom, is
> > > it recommended for my use of xml or would it be an overkill. Please
> > > let me know.
> > >
> > > Thanks.
> > >
> > > t


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.