Reading XML file
Hi,
Is there any way to read XML file with Java if i do not have a schema file? SAX?
Hi,
Is there any way to read XML file with Java if i do not have a schema file? SAX?
>> Is there any way to read XML file with Java if i do not have a schema file?
yes.
>> SAX?
for example.
I was thinking of using StAX or SAX to read XML files. However, i'm not too sure if they require me to provide schema files (which i'm not provided).
If i'm not wrong, JDOM's cpu and memory is not as efficient as SAX and StAX right? I need one that is efficient in cpu and memory.
> If i'm not wrong, JDOM's cpu and memory is not as
> efficient as SAX and StAX right? I need one that is
> efficient in cpu and memory.
Why do you think you need one that's "efficient"?
The XML files i'm using are quite large. I saw DOM in memory footprint up to 10x the document size. So i'm not too sure if JDOM is similar in this way.
If i just need to read (and don't need to write), is it ok if i use SAX instead of STAX?
> The XML files i'm using are quite large. I saw DOM in
> memory footprint up to 10x the document size. So i'm
> not too sure if JDOM is similar in this way.
Depends how you read it in. JDom can use either SAX or DOM, it's up to you
> If i just need to read (and don't need to write), is
> it ok if i use SAX instead of STAX?
If you're just reading, and your document is large, SAX may be better. There is no rule about it, and no way to determine which is better for you other than trying it out
http://www.c-sharpcorner.com/UploadFile/mahesh/ReadingXmlFile11142005002137AM/ReadingXmlFile.aspx
> http://www.c-sharpcorner.com/UploadFile/mahesh/Reading
> XmlFile11142005002137AM/ReadingXmlFile.aspx
Any reason you're posting links to C# sites in reply to Java questions?
dom4j -- this is the fastest way to read an XML.
Its pretty simple to learn too.
http://www.dom4j.org/index.html
> >
> http://www.c-sharpcorner.com/UploadFile/mahesh/Reading
>
> > XmlFile11142005002137AM/ReadingXmlFile.aspx
>
> Any reason you're posting links to C# sites in reply
> to Java questions?
... And a pretty shtty article at that.