quick and easy way to parse XML
From: luca passani (passani_at_eunet.no)
Date: 09/27/04
- Next message: Paul Lutus: "Re: quick and easy way to parse XML"
- Previous message: Paul Lutus: "Re: java 1.5 - generics "unchecked cast" suppression"
- Next in thread: Paul Lutus: "Re: quick and easy way to parse XML"
- Reply: Paul Lutus: "Re: quick and easy way to parse XML"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 27 Sep 2004 17:21:04 +0100
I am building a servlet that needs to parse XHTML files (with DTD and everything),
in order to figure out the link to the pictures (<img src="getmeifyoucan.gif" />)
I thought I had already solved the problem elegantly when I realized that
the package to parse XML would automatically open a connection to
the a website on the internet to retrieve the DTD!
Since this happens at every request to to the servlets, this behaviour
is unacceptable for my application.
Apparently, there is no simple way to disable this behavior, since
the XML spec demands that the DTD is retrieved.
I tried to treat the XML as a string and remove the DTD reference,
but, unfortunately, the library will fail if an entity is encountered
( for example).
I am puzzled. If I treat the XML as a string, String methods and
regexps are hardly powerful enough to achieve the task.
On the other hand, XML parsing turns up to introduce
even more problems than I am trying to solve (as an aside, wasn't
XML supposed to be simple?)
Is there an easy way to achieve my goal? XML parsing or regexps?
thanks
Luca
- Next message: Paul Lutus: "Re: quick and easy way to parse XML"
- Previous message: Paul Lutus: "Re: java 1.5 - generics "unchecked cast" suppression"
- Next in thread: Paul Lutus: "Re: quick and easy way to parse XML"
- Reply: Paul Lutus: "Re: quick and easy way to parse XML"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|