xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierpaolo Fumagalli <p...@apache.org>
Subject Re: SAX Handler Question
Date Sat, 29 Jan 2000 01:44:14 GMT
James McCarthy wrote:
> 
> I am trying to parse an XML file and then reproduce it (or a portion of it)
> from the handler events, how do you tell the difference between a />
> terminated tag and an empty one.
> 
> For example, how do I know the difference between "<MYTAG ATTRIBUTE="DATA"
> />" and "<MYTAG ATTRIBUTE="DATA"></MYTAG>" from the SAX events.
> 
> I would like to keep the exact content of the input file or portions of the
> input file that I am sending on.

I think that, if you use sax, you can use the locator to exactly
differentitate those. If you have <ELEM></ELEM> the values for
getColumnNumber() and getLineNumber() are different, while if you have
<ELEM/> they (should) be the same...
Check it out...

	Pier

-- 
--------------------------------------------------------------------
-          P              I              E              R          -
stable structure erected over water to allow the docking of seacraft
<mailto:pier@betaversion.org>    <http://www.betaversion.org/~pier/>
--------------------------------------------------------------------
- ApacheCON Y2K: Come to the official Apache developers conference -
-------------------- <http://www.apachecon.com> --------------------

Mime
View raw message