You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@locus.apache.org on 2000/03/03 19:50:01 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/framework XMLDTDScanner.java

andyc       00/03/03 10:50:01

  Modified:    java/docs releases.xml
               java/src/org/apache/xerces/framework XMLDTDScanner.java
  Log:
  Relaxed restraint of xml:space attribute for XHTML DTDs. The
  following is taken from the XML 1.0 Specification:
  
    [2.10] A special attribute named xml:space may be attached
    to an element to signal an intention that in that element,
    white space should be preserved by applications. In valid
    documents, this attribute, like any other, must be declared
    if it is used. When declared, it must be given as an
    enumerated type whose only possible values are "default"
    and "preserve". For example:
  
      <!ATTLIST poem   xml:space (default|preserve) 'preserve'>
  
  Depending on how you read this text, you could argue that
  when xml:space is declared, it *must* have those two options.
  Or, a less relaxed reading would state that the only allowed
  values are "default" and "preserve" but not necessarally
  both.
  
  Since the XHTML 1.0 Specification uses the relaxed reading
  when defining xml:space attributes on elements, the
  XMLDTDScanner has been modified to allow for the less
  strict reading of the specification.
  
  Thanks to David Brownell <da...@pacbell.net> for the bug
  report.
  
  PR: 33
  
  Revision  Changes    Path
  1.7       +5 -0      xml-xerces/java/docs/releases.xml
  
  Index: releases.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/docs/releases.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- releases.xml	2000/02/09 21:13:50	1.6
  +++ releases.xml	2000/03/03 18:50:00	1.7
  @@ -2,6 +2,11 @@
   <!DOCTYPE s1 SYSTEM "sbk:/style/dtd/document.dtd">
   
   <s1 title="Releases">
  +    <s2 title="March 1, 2000">
  +        <ul>
  +            <li>Relaxed restraint of xml:space attribute for XHTML DTDs [david-b@pacbell.net]</li>
  +        </ul>
  +    </s2>
       <s2 title="February 8, 2000">
           <ul>
               <li>Removed hard-coded strings to enable national language support (NLS) [jeffreyr,lehors,rip]</li>
  
  
  
  1.4       +5 -2      xml-xerces/java/src/org/apache/xerces/framework/XMLDTDScanner.java
  
  Index: XMLDTDScanner.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/framework/XMLDTDScanner.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XMLDTDScanner.java	2000/02/08 01:54:45	1.3
  +++ XMLDTDScanner.java	2000/03/03 18:50:01	1.4
  @@ -2003,9 +2003,12 @@
                   if (attDefType == fENUMERATION) {
                       int index = attDefEnumeration;
                       if (index != -1) {
  -                        ok = fStringPool.stringListLength(index) == 2 &&
  +                        ok = (fStringPool.stringListLength(index) == 1 &&
  +                              (fStringPool.stringInList(index, fDefault) ||
  +                             fStringPool.stringInList(index, fPreserve))) ||
  +                             (fStringPool.stringListLength(index) == 2 &&
                                fStringPool.stringInList(index, fDefault) &&
  -                             fStringPool.stringInList(index, fPreserve);
  +                             fStringPool.stringInList(index, fPreserve));
                       }
                   }
                   if (!ok) {