Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] How to handle "newline" characters in an XML parser.

From: Liam Quin <liam@--.--->
To: Redefined Horizons <redefined.horizons@-----.--->
Date: 12/9/2006 4:27:00 PM
On Fri, Dec 08, 2006 at 04:21:00PM -0800, Redefined Horizons wrote:
> My parser is actually for a subset of XML, with no attributes,
> comments, or CDATA. I looked at existing XML pull-parsers, but didn't
> find one that made use of an event broadcasting mechanism like I
> wanted.

Please don't call it XML, then.  Call it "RHML" if you want, or
"Kotzcii" or something.  The value of the XML brand (and yes,
we (w3C) own it) is that every XML document is accepted by
every XML tool.

> The only reason I'm interested in counting lines is for the error
> reporting. After reading the messages I think I've got more of a Java
> problem than an XML problem. It really doesn't matter what the XML
> Specs say in this particular case. What I need to figure out is how to
> count the lines in text files created in different operating systems.

This turns out to be very rarely what users want.  If you are writing
a server that sends error messages back to remote clients, have the
client applications normalize the data first.  If the files are all
local, people will presumably use a text editor to fix them, and
what they will need to know is the line number as a text editor on
the local system would report it, not the line number as it would
be on the computer on which the document was created.

Of course, if you actually used XML, people could use XML editors
in the first place.  It's rarely a big overhead and there are
fairly fast XML parsers.  It's perfectly OK for you to ignore the
things you don't want to use (e.g. attributes, processing
instructions), but not OK to make a subset of XML.

Liam

-- 
Liam Quin, W3C XML Activity Lead, http://www.w3.org/People/Quin/
http://www.holoweb.net/~liam/ * http://www.fromoldbooks.org/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent