![]() |
Reading Data From An XML File
Since this obviously changes over time what is currently the most effective
way to read parts of am XML file? Thanks!! |
Re: Reading Data From An XML File
mich schrieb:
> Since this obviously changes over time what is currently the most effective > way to read parts of am XML file? > > > Thanks!! > > The SAX parser is up to date and one of the current best parsing solutions when XML streams are analyzed with saving heap. http://sax.sourceforge.net/ regards Torsten Jenkner |
Re: Reading Data From An XML File
On Jul 27, 4:27 pm, "mich" <s...@doo.what> wrote:
> Since this obviously changes over time what is currently the most effective > way to read parts of am XML file? > > Thanks!! It depends on your need. If you are fine with reading the whole XML file into memory, you can use DocumentBuilder, and pass it the URL to your XML file, you'll get back a Document object which implements the DOM. |
Re: Reading Data From An XML File
On Jul 27, 7:27 pm, "mich" <s...@doo.what> wrote:
> Since this obviously changes over time what is currently the most effective > way to read parts of am XML file? > > Thanks!! It depends what you're doing with the XML. If you need simple, quick processing go with SAX. If you want to build a tree structure of the XML, check out JDOM. |
Re: Reading Data From An XML File
<jen.spinney@gmail.com> wrote in message news:1185593512.155533.262470@19g2000hsx.googlegro ups.com... > On Jul 27, 7:27 pm, "mich" <s...@doo.what> wrote: >> Since this obviously changes over time what is currently the most >> effective >> way to read parts of am XML file? >> >> Thanks!! > > It depends what you're doing with the XML. If you need simple, quick > processing go with SAX. If you want to build a tree structure of the > XML, check out JDOM. Thanks both, and it looks like I'll be going with SAX, since I'm only reading the data. While the data will occasionally change I will just do it manually. |
Re: Reading Data From An XML File
On Jul 28, 7:27 am, "mich" <s...@doo.what> wrote:
> Since this obviously changes over time what is currently the most effective > way to read parts of am XML file? > > Thanks!! There three choices: SAX, DOM, JDOM SAX: use less memory, faster, but not easy to use DOM: use more menory as it reads all the XML tree when initialize, easy to use JDOM: use less menory and faster than DOM as it only reads which it needs, and more easy to use |
Re: Reading Data From An XML File
>Since this obviously changes over time what is currently the most effective
>way to read parts of am XML file? See http://mindprod.com/jgloss/xml.html for your options. You DON'T have to write your own parser. Java has them built in now. -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com |
Re: Reading Data From An XML File
"JTL.zheng" <jtl.zheng@gmail.com> wrote in message news:1185603742.486068.168650@m37g2000prh.googlegr oups.com... > On Jul 28, 7:27 am, "mich" <s...@doo.what> wrote: >> Since this obviously changes over time what is currently the most >> effective >> way to read parts of am XML file? >> >> Thanks!! > > There three choices: SAX, DOM, JDOM > > SAX: use less memory, faster, but not easy to use > DOM: use more menory as it reads all the XML tree when initialize, > easy to use > JDOM: use less menory and faster than DOM as it only reads which it > needs, and more easy to use Since I'm just going to be reading the XML file to get some data - no updating - it should be better if create a singleton class to read it. The XML file will hold product information, but since the business will not have many products an XML file makes sence. Another aspect that I'm looking at is simulating an index by giving a different node name to each product, example below: <catalog> <largeWatermelon/> <organicWatermelon/> </catalog> If the catalog gets too big I can also just have different XML files for different produc groups, such as one file for vegetables, one for fruits, |
Re: Reading Data From An XML File
JTL.zheng wrote:
> On Jul 28, 7:27 am, "mich" <s...@doo.what> wrote: >> Since this obviously changes over time what is currently the most effective >> way to read parts of am XML file? >> >> Thanks!! > > There three choices: SAX, DOM, JDOM > > SAX: use less memory, faster, but not easy to use > DOM: use more menory as it reads all the XML tree when initialize, > easy to use > JDOM: use less menory and faster than DOM as it only reads which it > needs, and more easy to use Four: StAX. -- Lew |
| All times are GMT. The time now is 10:25 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.