morten      01/05/17 05:45:07

  Modified:    java/src/org/apache/xalan/xsltc/runtime TextOutput.java
  Log:
  Added a qname stack to the translet output handler to ensure that closing
  tags get the same prefixed qname as the opening tag.
  PR:           bugzilla 1473
  Obtained from:        bugtraq 4426607 (Sun Microsystems)
  Submitted by: [EMAIL PROTECTED]
  Reviewed by:  [EMAIL PROTECTED]
  
  Revision  Changes    Path
  1.3       +13 -7     
xml-xalan/java/src/org/apache/xalan/xsltc/runtime/TextOutput.java
  
  Index: TextOutput.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/TextOutput.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TextOutput.java   2001/05/01 13:16:22     1.2
  +++ TextOutput.java   2001/05/17 12:45:03     1.3
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: TextOutput.java,v 1.2 2001/05/01 13:16:22 morten Exp $
  + * @(#)$Id: TextOutput.java,v 1.3 2001/05/17 12:45:03 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -119,6 +119,7 @@
       private Hashtable _namespaces;
       private Stack     _nodeStack;
       private Stack     _prefixStack;
  +    private Stack     _qnameStack;
   
       // Holds the current tree depth (see startElement() and endElement()).
       private int _depth = 0;
  @@ -156,6 +157,8 @@
        _header       = null;
        _encoding     = "utf-8";
   
  +     _qnameStack   = new Stack();
  +
        // Empty all our hashtables
        _attributeTemplates.clear();
        _cdataElements.clear();
  @@ -471,6 +474,8 @@
            _attributes.clear();
            _startTagOpen = true;
   
  +         _qnameStack.push(elementName);
  +
            // Insert <META> tag directly after <HEAD> element in HTML doc
            if (_outputType == HTML) {
                if (elementName.toLowerCase().equals("head")) {
  @@ -554,17 +559,18 @@
        * End an element or CDATA section in the output document
        */
       public void endElement(String elementName) throws TransletException {
  -        try {
  +     try {
            // Close any open element
            if (_startTagOpen) {
                closeStartTag();
            }
  -            else if (_cdataTagOpen) {
  -                characters(ENDCDATA);
  -                _cdataTagOpen = false;
  -            }
  +         else if (_cdataTagOpen) {
  +             characters(ENDCDATA);
  +             _cdataTagOpen = false;
  +         }
   
  -            _saxHandler.endElement(null, null, elementName);
  +         final String qname = (String)(_qnameStack.pop());
  +            _saxHandler.endElement(null, null, qname);
   
               popNamespaces();
               _depth--;
  
  
  

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

Reply via email to