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

Illegal ID values (was: DTD help!)

Subject: Illegal ID values (was: DTD help!)
From: Joerg Pietschmann <joerg.pietschmann@xxxxxx>
Date: Thu, 12 Apr 2001 12:10:17 +0200
illegal id
Mike Kay wrote:
> > XML file
> >
> > <!DOCTYPE test [
> > <!ELEMENT test EMPTY>
> > <!ATTLIST test id ID #REQUIRED>
> > ]>
> > <test id="100"/>
> 
> The rule that an ID value must be an XML Name is a validity error, not a
> well-formedness error. Saxon by default runs with a non-validating parser;
> if you run it with a validating parser, the error will be reported.

Yes. Sorry for being misleading, the point was actaully that the following template
works without any comments from the processor. After all, i supply a formally
illegal value to the function.
> >
> >   <xsl:template match="id('100')">
> >     ok
> >   </xsl:template>

A quick glance at the XPath spec does not reveal any real advice how to
handle this. So there is still the question: is this a bug or a feature?
(I didn't try very hard, so this may be specified somewhere).

I also miss some advice how to handle the case if the ID-attributes matched
are not unique, as they should. Saxon appears to pick the first matching
element from the document, Xalan picks the last.

> > I also noted that Saxon 6.1 does not output the linefeed before
> > the "ok" line (Xalan did).
> 
> That surprises me greatly.

Ooops, probably my fault.
The output from Saxon is

<?xml version="1.0" encoding="ASCII"?>
    ok
  <--------------end (including this line up to the "<")

Xalan outputs

<?xml version="1.0" encoding="ASCII"?>

    ok
  <--------------end (including this line up to the "<")


The result is not well formed XML (or is it?), therefore it can be
argued whether the processor is allowed to insert a line feed after the
XML declaration on its own, as Xalan apparently does. Is there any
Language Lawyer out there who tells what's Right or Wrong (or whatever)?

Regards
J.Pietschmann

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


Current Thread

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