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]

Re: DTD help!



Mike Kay wrote:
> Someone else wrote
> > <Session id="100"/>
> > is valid one.
> > 
> Not true, an ID value must be an XML Name.

Well, both Saxon 6.1 and Xalan-1 happily accept the following
XML file

<!DOCTYPE test [
<!ELEMENT test EMPTY>
<!ATTLIST test id ID #REQUIRED>
]>
<test id="100"/>

Or id="#@*()" for that matter. You can use a the following XSL
to get an "ok":

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:output method="xml" encoding="ASCII"/>

  <xsl:template match="id('100')">
    ok
  </xsl:template>
</xsl:stylesheet>

I suppose this is a feature, not a bug. :-)
I also noted that Saxon 6.1 does not output the linefeed before
the "ok" line (Xalan did). Does anybody know whether *this* is
a bug?
A Xerces based validator rejects the XML file as it should.

 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]