garyp       01/06/15 01:12:50

  Modified:    java/src/org/apache/xalan/processor StylesheetHandler.java
  Log:
  Resolve bugzilla bug 2098 (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2098).
  The routine checkForFragmentID was checking for an attribute of type "ID" instead of 
the "id" attribute.
  Retrofit this change for the DTM merge.
  
  Revision  Changes    Path
  1.42      +23 -3     
xml-xalan/java/src/org/apache/xalan/processor/StylesheetHandler.java
  
  Index: StylesheetHandler.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/StylesheetHandler.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- StylesheetHandler.java    2001/06/12 19:14:48     1.41
  +++ StylesheetHandler.java    2001/06/15 08:12:48     1.42
  @@ -613,8 +613,28 @@
       //m_prefixMappings.clear(); // JDK 1.2+ only -sc
       m_prefixMappings.removeAllElements(); // JDK 1.1.x compat -sc
   
  -    m_elementID++;           
  +    m_elementID++;
   
  +    // This check is currently done for all elements.  We should possibly consider
  +    // limiting this check to xsl:stylesheet elements only since that is all it 
really
  +    // applies to.  Also, it could be bypassed if m_shouldProcess is already true.
  +    // In other words, the next two statements could instead look something like 
this:
  +    // if (!m_shouldProcess)
  +    // {
  +    //   if (localName.equals(Constants.ELEMNAME_STYLESHEET_STRING) &&
  +    //       url.equals(Constants.S_XSLNAMESPACEURL))
  +    //   {
  +    //     checkForFragmentID(attributes);
  +    //     if (!m_shouldProcess)
  +    //       return;
  +    //   }
  +    //   else
  +    //     return;
  +    // } 
  +    // I didn't include this code statement at this time because in practice 
  +    // it is a small performance hit and I was waiting to see if its absence
  +    // caused a problem. - GLP
  +
       checkForFragmentID(attributes);
   
       if (!m_shouldProcess)
  @@ -1025,9 +1045,9 @@
   
           for (int i = 0; i < n; i++)
           {
  -          String type = attributes.getType(i);
  +          String name = attributes.getQName(i);
   
  -          if (type.equalsIgnoreCase("ID"))
  +          if (name.equals(Constants.ATTRNAME_ID))
             {
               String val = attributes.getValue(i);
   
  
  
  

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

Reply via email to