This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: id() doesn't work!?


On Sun, Aug 25, 2002 at 12:16:56PM -0500, W. Eliot Kimber wrote:

> Aaron Optimizer Digulla wrote:
> 
> > Not having used xpointer to date, I don't know of the implications of it
> > and how hard it would be to solve the warning problem (maybe id() can
> > "throw an exception" somehow and xpointer() can discard it while the
> > normal use would display it or somesuch - I would have to look at the
> > sources to say that) but my guess is that it would be a simple thing
> > for you to do.
> 
> When we were formulating XML, there was a lot of discussion of whether
> we should codify "id" and "idref" as the attributes for ids and
> references to them--the argument for was that it would avoid exactly the
> problem that we see with the id() function (and, by extension, bare
> names interpreted by the XPointer rules). The argument against was that
> it intruded on the document author's name space, a cardinal sin. I
> honestly don't remember which way I voted, but I probably voted against
> codifying "id" because I was, at the time, firmly steeped in the
> sanctity of the author's right to name.
>...

Actually, that's not what I ask but thanks a lot for the long explanation :-)

>From my point of view, things look like this:

Currently, id() works along these lines:

    id(String name)
	return currentDocument->idHash[name];

What I want is this:

    id(String name):
	if (!currentDocument->isValid())
	    warn ("Sorry, id() only works with valid documents.");
	
	return currentDocument->idHash[name];

See? Just add a check in the code which implements id() if the
current document (infoset or whatever you call it right now) is
valid. If not, then id() will never work and then you should print
a warning because that is *never* what the user wants (no matter
if he uses XPointer or whatever).

It's just something which is hard to spot manually and probably very easy
to add the the processor.

-- 
==============================================
Sowatec AG,       CH-8330 Pfäffikon (ZH)
Witzbergstr. 7,   http://www.sowatec.com
Tel: +41-(0)1-952 55 55
Fax: +41-(0)1-952 55 66
----------------------------------------------
Aaron "Optimizer" Digulla, digulla@sowatec.com
==============================================

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]