Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] entity in attribute value

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Luca Passani <passani AT eunet.no>
  • To: 'xom-interest' <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] entity in attribute value
  • Date: Wed, 14 Jan 2009 00:49:05 +0100

Michael Kay wrote:

You can write it as &amp;euro; if you really want to. But why on earth would
you want to use something that looks just like an entity reference but isn't
one?

because, in this framework (WURFL), an XML file is the core of a simple DB to store strings. Usually those strings are not entities, but yesterday I happened to need to store a string which looked identical to an XML entity.

Every technology sucks if you misuse it.
what should I have done in 2002 when I started the project? decide that XML was not good for me because maybe one day this XML file may have to contain a string which could be confused with an XML entity?


I've got a brand new digital camera
and it's no good at hammering nails. Perhaps the problem is with the user,
not with the technology?
WURFL is a very successful project in its field. Thousands of developers around the planet have been able to download it and use it out of the box without much trouble. Anyway, the problem is solved. I now know how to escape those "things". I always knew that &amp; escapes &, but for some reason I was assuming that the XML parser would return "&amp;euro;" as "&amp;euro;" (and not as "&euro;" which is what I want).
Please observe that declaring the entity is not possible, because the WURFL model is such that a developer can throw any kind of property inside WURFL without changing anything else, and legitimately expect to find it at a later stage.

Thank you for your interest in the problem.

Luca






Archive powered by MHonArc 2.6.24.

Top of Page