[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How to handle "newline" characters in an XML parser.

  • From: Liam Quin <liam@w...>
  • To: Redefined Horizons <redefined.horizons@g...>
  • Date: Sat, 9 Dec 2006 11:26:39 -0500

Re:  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

-- 
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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.