mkwan       2003/04/04 11:29:04

  Modified:    java/src/org/apache/xalan/xsltc/dom SAXImpl.java
               java/src/org/apache/xalan/xsltc/runtime
                        StringValueHandler.java
  Log:
  According to spec http://www.w3.org/1999/11/REC-xslt-19991116-errata/#E27,
  when element nodes are used in the instantiated content of attribute, comment
  and processing instructions, we should ignore the elements together with
  their content.
  
  Revision  Changes    Path
  1.4       +1 -11     
xml-xalan/java/src/org/apache/xalan/xsltc/dom/SAXImpl.java
  
  Index: SAXImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/SAXImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SAXImpl.java      3 Apr 2003 16:48:11 -0000       1.3
  +++ SAXImpl.java      4 Apr 2003 19:29:04 -0000       1.4
  @@ -1363,16 +1363,6 @@
                       break;
               }
           } 
  -        catch (SAXException se) {
  -            // If the handler is a StringValueHandler, we should recover 
from a 
  -            // SAXExcption by ignoring the invalid nodes.
  -            if (handler instanceof StringValueHandler) {
  -                return;
  -            }
  -            else {
  -                throw new TransletException(se);
  -            }
  -        }
           catch (Exception e) {
               throw new TransletException(e);
           }
  
  
  
  1.9       +13 -2     
xml-xalan/java/src/org/apache/xalan/xsltc/runtime/StringValueHandler.java
  
  Index: StringValueHandler.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/StringValueHandler.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- StringValueHandler.java   1 Apr 2003 21:28:38 -0000       1.8
  +++ StringValueHandler.java   4 Apr 2003 19:29:04 -0000       1.9
  @@ -74,10 +74,14 @@
       private String _str = null;
       private static final String EMPTY_STR = "";
       private boolean m_escaping = false;
  +    private int _nestedLevel = 0;
        
       public void characters(char[] ch, int off, int len) 
        throws SAXException 
       {
  +     if (_nestedLevel > 0)
  +         return;
  +     
        if (_str != null) {
            _buffer.append(_str);
            _str = null;
  @@ -99,6 +103,9 @@
       }
   
       public void characters(String characters) throws SAXException {
  +     if (_nestedLevel > 0)
  +         return;
  +
        if (_str == null && _buffer.length() == 0) {
            _str = characters;
        }
  @@ -113,7 +120,11 @@
       }
       
       public void startElement(String qname) throws SAXException {
  -        throw new SAXException(EmptySerializer.ERR);
  +        _nestedLevel++;
  +    }
  +
  +    public void endElement(String qname) throws SAXException {
  +        _nestedLevel--;
       }
   
       // Override the setEscaping method just to indicate that this class is
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to