OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] How to handle "newline" characters in an XML parser.

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 Quin, W3C XML Activity Lead, http://www.w3.org/People/Quin/
http://www.holoweb.net/~liam/ * http://www.fromoldbooks.org/

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS