473,406 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

creating xml within java app

TP
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.

tP
Jul 20 '05 #1
4 1741
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 dtd)
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" <tp******@hotmail.com> wrote in message
news:59*************************@posting.google.co m...
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

Jul 20 '05 #2
TP
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" <pr****@hotmail.com> wrote in message news:<40**********************@news.rcn.com>...
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 dtd)
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" <tp******@hotmail.com> wrote in message
news:59*************************@posting.google.co m...
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

Jul 20 '05 #3
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" <tp******@hotmail.com> wrote in message
news:59**************************@posting.google.c om...
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" <pr****@hotmail.com> wrote in message

news:<40**********************@news.rcn.com>...
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 dtd) 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" <tp******@hotmail.com> wrote in message
news:59*************************@posting.google.co m...
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

Jul 20 '05 #4
TP
The xslt transform does catch malformed xml. So I think I am going to
be staying with stringbuffer. thanks for the comments.

"Martin SChukrazy" <pr****@hotmail.com> wrote in message news:<40**********************@news.rcn.com>...
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" <tp******@hotmail.com> wrote in message
news:59**************************@posting.google.c om...
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" <pr****@hotmail.com> wrote in message

news:<40**********************@news.rcn.com>...
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 dtd) 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" <tp******@hotmail.com> wrote in message
news:59*************************@posting.google.co m...
> 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

Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Greg Scharlemann | last post by:
I am attempting to upload a picture to a webserver and create a thumbnail from the picture uploaded. The problem comes in when I attempt to create an Image object from the File object (which is...
1
by: andthen | last post by:
If I have a Class object, serialized or somehow stored, is there any way I can use it to create a .class file?
0
by: Brett Selleck | last post by:
We have an issue where the JAXB generated classes are creating an interface which references itself. The Schema is valid, and I have not seen this ran into before. The code is below. What is...
1
by: Vishuonline | last post by:
Guys, I have had some experience in working with webservices created in .NET but this is the first time I am trying out one made in Java. When I run the wsdl exe to create a proxy class for...
2
by: astolpho | last post by:
I am using a slightly outdated reference book on J2EE programming. It gives 2 methods of creating a database used in its casestudies. The first is an ANT script that gives the following output: ...
3
by: millz | last post by:
I am trying to create a tree map within a TreeMap. Any help would be great. goes a bit like this: public class ChessImpl implements CHESS { private Map<String, Integer> name; ...
0
by: kjkrudh | last post by:
Hi, I have a problem. I am creating an order form in Netbeans 5.5.1 with Java. I need to clear the entire screen when the order is submitted (including the radio buttons' entry. I am told I need to...
1
by: stevedub | last post by:
I am having some trouble configuring my array to read from a sequential file, and then calling on that to fill an array of interests. I think I have the class set up to read the file, but when I run...
5
by: herenbdy | last post by:
I've been working on a Java based game in order to learn Java, but the game is functional only within my IDE (Eclipse). This image shows the file structure of my project:...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.