xml-xalan-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mor...@apache.org
Subject cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/runtime DefaultSAXOutputHandler.java TextOutput.java
Date Wed, 12 Sep 2001 12:23:04 GMT
morten      01/09/12 05:23:04

  Modified:    java/src/org/apache/xalan/xsltc/runtime
                        DefaultSAXOutputHandler.java TextOutput.java
  Log:
  Fix to prevent character escaping inside <script> and <style> elements in
  HTML output.
  PR:		bugzilla 2517
  Obtained from:	n/a
  Submitted by:	morten@xml.apache.org
  Reviewed by:	morten@xml.apache.org
  
  Revision  Changes    Path
  1.18      +4 -2      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/DefaultSAXOutputHandler.java
  
  Index: DefaultSAXOutputHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/DefaultSAXOutputHandler.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- DefaultSAXOutputHandler.java	2001/09/12 11:10:48	1.17
  +++ DefaultSAXOutputHandler.java	2001/09/12 12:23:04	1.18
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: DefaultSAXOutputHandler.java,v 1.17 2001/09/12 11:10:48 morten Exp $
  + * @(#)$Id: DefaultSAXOutputHandler.java,v 1.18 2001/09/12 12:23:04 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -509,7 +509,9 @@
                           _writer.write(GT_LT_SL);
                           _writer.write(_element);
                       }
  -		    _writer.write(GT_CR);
  +		    else {
  +			_writer.write(GT_CR);
  +		    }
                   }
                   else {
                       // XML: output empty element as <tag/>
  
  
  
  1.27      +10 -6     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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- TextOutput.java	2001/09/12 10:48:30	1.26
  +++ TextOutput.java	2001/09/12 12:23:04	1.27
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: TextOutput.java,v 1.26 2001/09/12 10:48:30 morten Exp $
  + * @(#)$Id: TextOutput.java,v 1.27 2001/09/12 12:23:04 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -455,15 +455,19 @@
               // the first CDATA and '>' at the beginning of the next. Other
   	    // special characters/sequences are _NOT_ escaped within CDATA.
   	    Integer I = (Integer)_cdataStack.peek();
  -	    if (I.intValue() == _depth) {
  -		if (_cdataTagOpen)
  -		    _saxHandler.characters(ch, off, len);
  -		else
  -		    startCDATA(ch, off, len);
  +	    if ((I.intValue() == _depth) && (!_cdataTagOpen)) {
  +		startCDATA(ch, off, len);
   	    }
   	    // Output escaped characters if required. Non-ASCII characters
               // within HTML attributes should _NOT_ be escaped.
   	    else if (_escapeChars) {
  +		if (_outputType == HTML) {
  +		    final String qname = (String)_qnameStack.peek();
  +		    if ((qname.equals("style")) || (qname.equals("script"))) {
  +			_saxHandler.characters(ch, off, len);
  +			return;
  +		    }
  +		}
   		escapeCharacters(ch, off, len);
   	    }
   	    // Output the chracters as the are
  
  
  

---------------------------------------------------------------------
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