xml-xalan-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minc...@apache.org
Subject cvs commit: xml-xalan/java/src/org/apache/xml/res XMLErrorResources.java
Date Fri, 24 Oct 2003 15:30:35 GMT
minchau     2003/10/24 08:30:35

  Modified:    java/src/org/apache/xml/utils QName.java
               java/src/org/apache/xml/res XMLErrorResources.java
  Log:
  Shouldn't be able to call a template with no prefix:
  <xsl:template name=":tmplt1">
  PR: bug 3415
  Submitted by:	Richard Cao
  Reviewed by:	Brian Minchau
  
  Revision  Changes    Path
  1.14      +12 -3     xml-xalan/java/src/org/apache/xml/utils/QName.java
  
  Index: QName.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/utils/QName.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- QName.java	17 Oct 2003 20:59:26 -0000	1.13
  +++ QName.java	24 Oct 2003 15:30:35 -0000	1.14
  @@ -487,10 +487,19 @@
               XMLErrorResources.ER_PREFIX_MUST_RESOLVE,
               new Object[]{ prefix }));  //"Prefix must resolve to a namespace: "+prefix);
         }
  +      _localName = qname.substring(indexOfNSSep + 1);
       }
  -
  -	_localName = (indexOfNSSep < 0)
  -                 ? qname : qname.substring(indexOfNSSep + 1);   
  +    else if (indexOfNSSep == 0) 
  +    {
  +      throw new RuntimeException(
  +         XMLMessages.createXMLMessage(
  +           XMLErrorResources.ER_NAME_CANT_START_WITH_COLON,
  +           null));
  +    }
  +    else
  +    {
  +      _localName = qname;
  +    }   
                    
       if (validate)
       {
  
  
  
  1.6       +4 -0      xml-xalan/java/src/org/apache/xml/res/XMLErrorResources.java
  
  Index: XMLErrorResources.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/res/XMLErrorResources.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XMLErrorResources.java	23 Oct 2003 15:56:06 -0000	1.5
  +++ XMLErrorResources.java	24 Oct 2003 15:30:35 -0000	1.6
  @@ -190,6 +190,7 @@
     public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";  
     public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";  
     public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";  
  +  public static final String ER_NAME_CANT_START_WITH_COLON = "ER_NAME_CANT_START_WITH_COLON";
   
     // Message keys used by the serializer
     public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
  @@ -408,6 +409,9 @@
       // that there is a problem with that part of the QNAME.
       { ER_ARG_PREFIX_INVALID,
          "Prefix in QNAME should be a valid NCName"},
  +       
  +    { ER_NAME_CANT_START_WITH_COLON,
  +      "Name cannot start with a colon"},
          
       { "BAD_CODE", "Parameter to createMessage was out of bounds"},
       { "FORMAT_FAILED", "Exception thrown during messageFormat call"},
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message