morten      01/11/22 05:49:07

  Modified:    java/src/org/apache/xalan/xsltc/compiler XslElement.java
  Log:
  Added test in <xsl:element> to verify that the local name of the created
  element is legal (must have contents, but no whitespaces or colon).
  PR:           bugzilla 4894
  Obtained from:        n/a
  Submitted by: [EMAIL PROTECTED]
  Reviewed by:  [EMAIL PROTECTED]
  
  Revision  Changes    Path
  1.13      +10 -9     
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/XslElement.java
  
  Index: XslElement.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/XslElement.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- XslElement.java   2001/10/30 08:42:55     1.12
  +++ XslElement.java   2001/11/22 13:49:07     1.13
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: XslElement.java,v 1.12 2001/10/30 08:42:55 morten Exp $
  + * @(#)$Id: XslElement.java,v 1.13 2001/11/22 13:49:07 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -160,14 +160,15 @@
        _name = AttributeValue.create(this, name, parser);
   
        // Next check that the local part of the QName is legal (no whitespace)
  -     if ((_name instanceof SimpleAttributeValue) &&
  -         (local.indexOf(' ') > -1)) {
  -         ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
  -                                     local, this);
  -         parser.reportError(WARNING, err);
  -         parseChildren(parser);
  -         _ignore = true; // Ignore the element if the local part is invalid
  -         return;
  +     if (_name instanceof SimpleAttributeValue) {
  +         if (local.equals(EMPTYSTRING) || (local.indexOf(' ') > -1)) {
  +             ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
  +                                         local, this);
  +             parser.reportError(WARNING, err);
  +             parseChildren(parser);
  +             _ignore = true; // Ignore the element if local part is invalid
  +             return;
  +         }
        }
   
        // Handle the 'use-attribute-sets' attribute
  
  
  

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

Reply via email to