src/com/sun/org/apache/xml/internal/serializer/ToHTMLStream.java

Print this page


   1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   4  */
   5 /*
   6  * Copyright 2001-2004 The Apache Software Foundation.
   7  *
   8  * Licensed under the Apache License, Version 2.0 (the "License");


   9  * you may not use this file except in compliance with the License.
  10  * You may obtain a copy of the License at
  11  *
  12  *     http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 /*
  21  * $Id: ToHTMLStream.java,v 1.2.4.1 2005/09/15 08:15:26 suresh_emailid Exp $
  22  */
  23 package com.sun.org.apache.xml.internal.serializer;
  24 
  25 import java.io.IOException;
  26 import java.io.OutputStream;
  27 import java.io.UnsupportedEncodingException;
  28 import java.util.Properties;


 332             new ElemDesc(
 333                 0
 334                     | ElemDesc.BLOCK
 335                     | ElemDesc.BLOCKFORM
 336                     | ElemDesc.BLOCKFORMFIELDSET));
 337         // Netscape 4 extension
 338         m_elementFlags.put(
 339             "ILAYER",
 340             new ElemDesc(
 341                 0
 342                     | ElemDesc.BLOCK
 343                     | ElemDesc.BLOCKFORM
 344                     | ElemDesc.BLOCKFORMFIELDSET));
 345 
 346 
 347         // NOW FOR ATTRIBUTE INFORMATION . . .
 348         ElemDesc elemDesc;
 349 
 350 
 351         // ----------------------------------------------
 352         elemDesc = (ElemDesc) m_elementFlags.get("A");
 353         elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
 354         elemDesc.setAttr("NAME", ElemDesc.ATTRURL);
 355 
 356         // ----------------------------------------------
 357         elemDesc = (ElemDesc) m_elementFlags.get("AREA");
 358         elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
 359         elemDesc.setAttr("NOHREF", ElemDesc.ATTREMPTY);
 360 
 361         // ----------------------------------------------
 362         elemDesc = (ElemDesc) m_elementFlags.get("BASE");
 363         elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
 364 
 365         // ----------------------------------------------
 366         elemDesc = (ElemDesc) m_elementFlags.get("BUTTON");
 367         elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
 368 
 369         // ----------------------------------------------
 370         elemDesc = (ElemDesc) m_elementFlags.get("BLOCKQUOTE");
 371         elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
 372 
 373         // ----------------------------------------------
 374         elemDesc = (ElemDesc) m_elementFlags.get("DEL");
 375         elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
 376 
 377         // ----------------------------------------------
 378         elemDesc = (ElemDesc) m_elementFlags.get("DIR");
 379         elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
 380 
 381         // ----------------------------------------------
 382 
 383         elemDesc = (ElemDesc) m_elementFlags.get("DIV");
 384         elemDesc.setAttr("SRC", ElemDesc.ATTRURL); // Netscape 4 extension
 385         elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY); // Internet-Explorer extension
 386 
 387         // ----------------------------------------------
 388         elemDesc = (ElemDesc) m_elementFlags.get("DL");
 389         elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
 390 
 391         // ----------------------------------------------
 392         elemDesc = (ElemDesc) m_elementFlags.get("FORM");
 393         elemDesc.setAttr("ACTION", ElemDesc.ATTRURL);
 394 
 395         // ----------------------------------------------
 396         // Attribution to: "Voytenko, Dimitry" <DVoytenko@SECTORBASE.COM>
 397         elemDesc = (ElemDesc) m_elementFlags.get("FRAME");
 398         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
 399         elemDesc.setAttr("LONGDESC", ElemDesc.ATTRURL);
 400         elemDesc.setAttr("NORESIZE",ElemDesc.ATTREMPTY);
 401 
 402         // ----------------------------------------------
 403         elemDesc = (ElemDesc) m_elementFlags.get("HEAD");
 404         elemDesc.setAttr("PROFILE", ElemDesc.ATTRURL);
 405 
 406         // ----------------------------------------------
 407         elemDesc = (ElemDesc) m_elementFlags.get("HR");
 408         elemDesc.setAttr("NOSHADE", ElemDesc.ATTREMPTY);
 409 
 410         // ----------------------------------------------
 411         // HTML 4.0, section 16.5
 412         elemDesc = (ElemDesc) m_elementFlags.get("IFRAME");
 413         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
 414         elemDesc.setAttr("LONGDESC", ElemDesc.ATTRURL);
 415 
 416         // ----------------------------------------------
 417         // Netscape 4 extension
 418         elemDesc = (ElemDesc) m_elementFlags.get("ILAYER");
 419         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
 420 
 421         // ----------------------------------------------
 422         elemDesc = (ElemDesc) m_elementFlags.get("IMG");
 423         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
 424         elemDesc.setAttr("LONGDESC", ElemDesc.ATTRURL);
 425         elemDesc.setAttr("USEMAP", ElemDesc.ATTRURL);
 426         elemDesc.setAttr("ISMAP", ElemDesc.ATTREMPTY);
 427 
 428         // ----------------------------------------------
 429         elemDesc = (ElemDesc) m_elementFlags.get("INPUT");
 430         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
 431         elemDesc.setAttr("USEMAP", ElemDesc.ATTRURL);
 432         elemDesc.setAttr("CHECKED", ElemDesc.ATTREMPTY);
 433         elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
 434         elemDesc.setAttr("ISMAP", ElemDesc.ATTREMPTY);
 435         elemDesc.setAttr("READONLY", ElemDesc.ATTREMPTY);
 436 
 437         // ----------------------------------------------
 438         elemDesc = (ElemDesc) m_elementFlags.get("INS");
 439         elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
 440 
 441         // ----------------------------------------------
 442         // Netscape 4 extension
 443         elemDesc = (ElemDesc) m_elementFlags.get("LAYER");
 444         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
 445 
 446         // ----------------------------------------------
 447         elemDesc = (ElemDesc) m_elementFlags.get("LINK");
 448         elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
 449 
 450         // ----------------------------------------------
 451         elemDesc = (ElemDesc) m_elementFlags.get("MENU");
 452         elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
 453 
 454         // ----------------------------------------------
 455         elemDesc = (ElemDesc) m_elementFlags.get("OBJECT");
 456         elemDesc.setAttr("CLASSID", ElemDesc.ATTRURL);
 457         elemDesc.setAttr("CODEBASE", ElemDesc.ATTRURL);
 458         elemDesc.setAttr("DATA", ElemDesc.ATTRURL);
 459         elemDesc.setAttr("ARCHIVE", ElemDesc.ATTRURL);
 460         elemDesc.setAttr("USEMAP", ElemDesc.ATTRURL);
 461         elemDesc.setAttr("DECLARE", ElemDesc.ATTREMPTY);
 462 
 463         // ----------------------------------------------
 464         elemDesc = (ElemDesc) m_elementFlags.get("OL");
 465         elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
 466 
 467         // ----------------------------------------------
 468         elemDesc = (ElemDesc) m_elementFlags.get("OPTGROUP");
 469         elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
 470 
 471         // ----------------------------------------------
 472         elemDesc = (ElemDesc) m_elementFlags.get("OPTION");
 473         elemDesc.setAttr("SELECTED", ElemDesc.ATTREMPTY);
 474         elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
 475 
 476         // ----------------------------------------------
 477         elemDesc = (ElemDesc) m_elementFlags.get("Q");
 478         elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
 479 
 480         // ----------------------------------------------
 481         elemDesc = (ElemDesc) m_elementFlags.get("SCRIPT");
 482         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
 483         elemDesc.setAttr("FOR", ElemDesc.ATTRURL);
 484         elemDesc.setAttr("DEFER", ElemDesc.ATTREMPTY);
 485 
 486         // ----------------------------------------------
 487         elemDesc = (ElemDesc) m_elementFlags.get("SELECT");
 488         elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
 489         elemDesc.setAttr("MULTIPLE", ElemDesc.ATTREMPTY);
 490 
 491         // ----------------------------------------------
 492         elemDesc = (ElemDesc) m_elementFlags.get("TABLE");
 493         elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY); // Internet-Explorer extension
 494 
 495         // ----------------------------------------------
 496         elemDesc = (ElemDesc) m_elementFlags.get("TD");
 497         elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY);
 498 
 499         // ----------------------------------------------
 500         elemDesc = (ElemDesc) m_elementFlags.get("TEXTAREA");
 501         elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
 502         elemDesc.setAttr("READONLY", ElemDesc.ATTREMPTY);
 503 
 504         // ----------------------------------------------
 505         elemDesc = (ElemDesc) m_elementFlags.get("TH");
 506         elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY);
 507 
 508         // ----------------------------------------------
 509         // The nowrap attribute of a tr element is both
 510         // a Netscape and Internet-Explorer extension
 511         elemDesc = (ElemDesc) m_elementFlags.get("TR");
 512         elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY);
 513 
 514         // ----------------------------------------------
 515         elemDesc = (ElemDesc) m_elementFlags.get("UL");
 516         elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
 517     }
 518 
 519     /**
 520      * Dummy element for elements not found.
 521      */
 522     static private final ElemDesc m_dummy = new ElemDesc(0 | ElemDesc.BLOCK);
 523 
 524     /** True if URLs should be specially escaped with the %xx form. */
 525     private boolean m_specialEscapeURLs = true;
 526 
 527     /** True if the META tag should be omitted. */
 528     private boolean m_omitMetaTag = false;
 529 
 530     /**
 531      * Tells if the formatter should use special URL escaping.
 532      *
 533      * @param bool True if URLs should be specially escaped with the %xx form.
 534      */
 535     public void setSpecialEscapeURLs(boolean bool)


1745             {
1746 
1747             // finish processing attributes, time to fire off the start element event
1748             if (m_tracer != null)
1749                 super.fireStartElem(m_elemContext.m_elementName);
1750 
1751             int nAttrs = m_attributes.getLength();
1752             if (nAttrs>0)
1753             {
1754                 processAttributes(m_writer, nAttrs);
1755                 // clear attributes object for re-use with next element
1756                 m_attributes.clear();
1757             }
1758 
1759             m_writer.write('>');
1760 
1761             /* whether Xalan or XSLTC, we have the prefix mappings now, so
1762              * lets determine if the current element is specified in the cdata-
1763              * section-elements list.
1764              */
1765             if (m_cdataSectionElements != null)
1766                 m_elemContext.m_isCdataSection = isCdataSection();
1767             if (m_doIndent)
1768             {
1769                 m_isprevtext = false;
1770                 m_preserves.push(m_ispreserve);
1771             }
1772 
1773             }
1774             catch(IOException e)
1775             {
1776                 throw new SAXException(e);
1777             }
1778     }
1779     /**
1780      * Initialize the serializer with the specified output stream and output
1781      * format. Must be called before calling any of the serialize methods.
1782      *
1783      * @param output The output stream to use
1784      * @param format The output format
1785      * @throws UnsupportedEncodingException The encoding specified   in the
1786      * output format is not supported
1787      */
1788     protected synchronized void init(OutputStream output, Properties format)
1789         throws UnsupportedEncodingException
1790     {
1791         if (null == format)
1792         {
1793             format = OutputPropertiesFactory.getDefaultMethodProperties(Method.HTML);
1794          }
1795         super.init(output,format, false);
1796     }
1797 
1798         /**
1799          * Specifies an output stream to which the document should be
1800          * serialized. This method should not be called while the
1801          * serializer is in the process of serializing a document.
1802          * <p>
1803          * The encoding specified in the output properties is used, or
1804          * if no encoding was specified, the default for the selected
1805          * output method.
1806          *
1807          * @param output The output stream
1808          */
1809         public void setOutputStream(OutputStream output)
1810         {
1811 
1812             try
1813             {
1814                 Properties format;
1815                 if (null == m_format)
1816                     format = OutputPropertiesFactory.getDefaultMethodProperties(Method.HTML);
1817                 else
1818                     format = m_format;
1819                 init(output, format, true);
1820             }
1821             catch (UnsupportedEncodingException uee)
1822             {
1823 
1824                 // Should have been warned in init, I guess...
1825             }
1826         }
1827         /**
1828          * This method is used when a prefix/uri namespace mapping
1829          * is indicated after the element was started with a
1830          * startElement() and before and endElement().
1831          * startPrefixMapping(prefix,uri) would be used before the
1832          * startElement() call.
1833          * @param uri the URI of the namespace
1834          * @param prefix the prefix associated with the given URI.
1835          *
1836          * @see ExtendedContentHandler#namespaceAfterStartElement(String, String)
1837          */
1838         public void namespaceAfterStartElement(String prefix, String uri)
1839             throws SAXException
1840         {
1841             // hack for XSLTC with finding URI for default namespace
1842             if (m_elemContext.m_elementURI == null)
1843             {
1844                 String prefix1 = getPrefixPart(m_elemContext.m_elementName);
1845                 if (prefix1 == null && EMPTYSTRING.equals(prefix))
1846                 {


   1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   4  */
   5 /*
   6  * Licensed to the Apache Software Foundation (ASF) under one
   7  * or more contributor license agreements. See the NOTICE file
   8  * distributed with this work for additional information
   9  * regarding copyright ownership. The ASF licenses this file
  10  * to you under the Apache License, Version 2.0 (the  "License");
  11  * you may not use this file except in compliance with the License.
  12  * You may obtain a copy of the License at
  13  *
  14  *     http://www.apache.org/licenses/LICENSE-2.0
  15  *
  16  * Unless required by applicable law or agreed to in writing, software
  17  * distributed under the License is distributed on an "AS IS" BASIS,
  18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19  * See the License for the specific language governing permissions and
  20  * limitations under the License.
  21  */
  22 /*
  23  * $Id: ToHTMLStream.java,v 1.2.4.1 2005/09/15 08:15:26 suresh_emailid Exp $
  24  */
  25 package com.sun.org.apache.xml.internal.serializer;
  26 
  27 import java.io.IOException;
  28 import java.io.OutputStream;
  29 import java.io.UnsupportedEncodingException;
  30 import java.util.Properties;


 334             new ElemDesc(
 335                 0
 336                     | ElemDesc.BLOCK
 337                     | ElemDesc.BLOCKFORM
 338                     | ElemDesc.BLOCKFORMFIELDSET));
 339         // Netscape 4 extension
 340         m_elementFlags.put(
 341             "ILAYER",
 342             new ElemDesc(
 343                 0
 344                     | ElemDesc.BLOCK
 345                     | ElemDesc.BLOCKFORM
 346                     | ElemDesc.BLOCKFORMFIELDSET));
 347 
 348 
 349         // NOW FOR ATTRIBUTE INFORMATION . . .
 350         ElemDesc elemDesc;
 351 
 352 
 353         // ----------------------------------------------
 354         elemDesc = (ElemDesc) m_elementFlags.get("a");
 355         elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
 356         elemDesc.setAttr("NAME", ElemDesc.ATTRURL);
 357 
 358         // ----------------------------------------------
 359         elemDesc = (ElemDesc) m_elementFlags.get("area");
 360         elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
 361         elemDesc.setAttr("NOHREF", ElemDesc.ATTREMPTY);
 362 
 363         // ----------------------------------------------
 364         elemDesc = (ElemDesc) m_elementFlags.get("base");
 365         elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
 366 
 367         // ----------------------------------------------
 368         elemDesc = (ElemDesc) m_elementFlags.get("button");
 369         elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
 370 
 371         // ----------------------------------------------
 372         elemDesc = (ElemDesc) m_elementFlags.get("blockquote");
 373         elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
 374 
 375         // ----------------------------------------------
 376         elemDesc = (ElemDesc) m_elementFlags.get("del");
 377         elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
 378 
 379         // ----------------------------------------------
 380         elemDesc = (ElemDesc) m_elementFlags.get("dir");
 381         elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
 382 
 383         // ----------------------------------------------
 384 
 385         elemDesc = (ElemDesc) m_elementFlags.get("div");
 386         elemDesc.setAttr("SRC", ElemDesc.ATTRURL); // Netscape 4 extension
 387         elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY); // Internet-Explorer extension
 388 
 389         // ----------------------------------------------
 390         elemDesc = (ElemDesc) m_elementFlags.get("dl");
 391         elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
 392 
 393         // ----------------------------------------------
 394         elemDesc = (ElemDesc) m_elementFlags.get("form");
 395         elemDesc.setAttr("ACTION", ElemDesc.ATTRURL);
 396 
 397         // ----------------------------------------------
 398         // Attribution to: "Voytenko, Dimitry" <DVoytenko@SECTORBASE.COM>
 399         elemDesc = (ElemDesc) m_elementFlags.get("frame");
 400         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
 401         elemDesc.setAttr("LONGDESC", ElemDesc.ATTRURL);
 402         elemDesc.setAttr("NORESIZE",ElemDesc.ATTREMPTY);
 403 
 404         // ----------------------------------------------
 405         elemDesc = (ElemDesc) m_elementFlags.get("head");
 406         elemDesc.setAttr("PROFILE", ElemDesc.ATTRURL);
 407 
 408         // ----------------------------------------------
 409         elemDesc = (ElemDesc) m_elementFlags.get("hr");
 410         elemDesc.setAttr("NOSHADE", ElemDesc.ATTREMPTY);
 411 
 412         // ----------------------------------------------
 413         // HTML 4.0, section 16.5
 414         elemDesc = (ElemDesc) m_elementFlags.get("iframe");
 415         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
 416         elemDesc.setAttr("LONGDESC", ElemDesc.ATTRURL);
 417 
 418         // ----------------------------------------------
 419         // Netscape 4 extension
 420         elemDesc = (ElemDesc) m_elementFlags.get("ilayer");
 421         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
 422 
 423         // ----------------------------------------------
 424         elemDesc = (ElemDesc) m_elementFlags.get("img");
 425         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
 426         elemDesc.setAttr("LONGDESC", ElemDesc.ATTRURL);
 427         elemDesc.setAttr("USEMAP", ElemDesc.ATTRURL);
 428         elemDesc.setAttr("ISMAP", ElemDesc.ATTREMPTY);
 429 
 430         // ----------------------------------------------
 431         elemDesc = (ElemDesc) m_elementFlags.get("input");
 432         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
 433         elemDesc.setAttr("USEMAP", ElemDesc.ATTRURL);
 434         elemDesc.setAttr("CHECKED", ElemDesc.ATTREMPTY);
 435         elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
 436         elemDesc.setAttr("ISMAP", ElemDesc.ATTREMPTY);
 437         elemDesc.setAttr("READONLY", ElemDesc.ATTREMPTY);
 438 
 439         // ----------------------------------------------
 440         elemDesc = (ElemDesc) m_elementFlags.get("ins");
 441         elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
 442 
 443         // ----------------------------------------------
 444         // Netscape 4 extension
 445         elemDesc = (ElemDesc) m_elementFlags.get("layer");
 446         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
 447 
 448         // ----------------------------------------------
 449         elemDesc = (ElemDesc) m_elementFlags.get("link");
 450         elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
 451 
 452         // ----------------------------------------------
 453         elemDesc = (ElemDesc) m_elementFlags.get("menu");
 454         elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
 455 
 456         // ----------------------------------------------
 457         elemDesc = (ElemDesc) m_elementFlags.get("object");
 458         elemDesc.setAttr("CLASSID", ElemDesc.ATTRURL);
 459         elemDesc.setAttr("CODEBASE", ElemDesc.ATTRURL);
 460         elemDesc.setAttr("DATA", ElemDesc.ATTRURL);
 461         elemDesc.setAttr("ARCHIVE", ElemDesc.ATTRURL);
 462         elemDesc.setAttr("USEMAP", ElemDesc.ATTRURL);
 463         elemDesc.setAttr("DECLARE", ElemDesc.ATTREMPTY);
 464 
 465         // ----------------------------------------------
 466         elemDesc = (ElemDesc) m_elementFlags.get("ol");
 467         elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
 468 
 469         // ----------------------------------------------
 470         elemDesc = (ElemDesc) m_elementFlags.get("optgroup");
 471         elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
 472 
 473         // ----------------------------------------------
 474         elemDesc = (ElemDesc) m_elementFlags.get("option");
 475         elemDesc.setAttr("SELECTED", ElemDesc.ATTREMPTY);
 476         elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
 477 
 478         // ----------------------------------------------
 479         elemDesc = (ElemDesc) m_elementFlags.get("q");
 480         elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
 481 
 482         // ----------------------------------------------
 483         elemDesc = (ElemDesc) m_elementFlags.get("script");
 484         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
 485         elemDesc.setAttr("FOR", ElemDesc.ATTRURL);
 486         elemDesc.setAttr("DEFER", ElemDesc.ATTREMPTY);
 487 
 488         // ----------------------------------------------
 489         elemDesc = (ElemDesc) m_elementFlags.get("select");
 490         elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
 491         elemDesc.setAttr("MULTIPLE", ElemDesc.ATTREMPTY);
 492 
 493         // ----------------------------------------------
 494         elemDesc = (ElemDesc) m_elementFlags.get("table");
 495         elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY); // Internet-Explorer extension
 496 
 497         // ----------------------------------------------
 498         elemDesc = (ElemDesc) m_elementFlags.get("td");
 499         elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY);
 500 
 501         // ----------------------------------------------
 502         elemDesc = (ElemDesc) m_elementFlags.get("textarea");
 503         elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
 504         elemDesc.setAttr("READONLY", ElemDesc.ATTREMPTY);
 505 
 506         // ----------------------------------------------
 507         elemDesc = (ElemDesc) m_elementFlags.get("th");
 508         elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY);
 509 
 510         // ----------------------------------------------
 511         // The nowrap attribute of a tr element is both
 512         // a Netscape and Internet-Explorer extension
 513         elemDesc = (ElemDesc) m_elementFlags.get("tr");
 514         elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY);
 515 
 516         // ----------------------------------------------
 517         elemDesc = (ElemDesc) m_elementFlags.get("ul");
 518         elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
 519     }
 520 
 521     /**
 522      * Dummy element for elements not found.
 523      */
 524     static private final ElemDesc m_dummy = new ElemDesc(0 | ElemDesc.BLOCK);
 525 
 526     /** True if URLs should be specially escaped with the %xx form. */
 527     private boolean m_specialEscapeURLs = true;
 528 
 529     /** True if the META tag should be omitted. */
 530     private boolean m_omitMetaTag = false;
 531 
 532     /**
 533      * Tells if the formatter should use special URL escaping.
 534      *
 535      * @param bool True if URLs should be specially escaped with the %xx form.
 536      */
 537     public void setSpecialEscapeURLs(boolean bool)


1747             {
1748 
1749             // finish processing attributes, time to fire off the start element event
1750             if (m_tracer != null)
1751                 super.fireStartElem(m_elemContext.m_elementName);
1752 
1753             int nAttrs = m_attributes.getLength();
1754             if (nAttrs>0)
1755             {
1756                 processAttributes(m_writer, nAttrs);
1757                 // clear attributes object for re-use with next element
1758                 m_attributes.clear();
1759             }
1760 
1761             m_writer.write('>');
1762 
1763             /* whether Xalan or XSLTC, we have the prefix mappings now, so
1764              * lets determine if the current element is specified in the cdata-
1765              * section-elements list.
1766              */
1767             if (m_StringOfCDATASections != null)
1768                 m_elemContext.m_isCdataSection = isCdataSection();
1769             if (m_doIndent)
1770             {
1771                 m_isprevtext = false;
1772                 m_preserves.push(m_ispreserve);
1773             }
1774 
1775             }
1776             catch(IOException e)
1777             {
1778                 throw new SAXException(e);
1779             }
1780     }


















1781 





























1782         /**
1783          * This method is used when a prefix/uri namespace mapping
1784          * is indicated after the element was started with a
1785          * startElement() and before and endElement().
1786          * startPrefixMapping(prefix,uri) would be used before the
1787          * startElement() call.
1788          * @param uri the URI of the namespace
1789          * @param prefix the prefix associated with the given URI.
1790          *
1791          * @see ExtendedContentHandler#namespaceAfterStartElement(String, String)
1792          */
1793         public void namespaceAfterStartElement(String prefix, String uri)
1794             throws SAXException
1795         {
1796             // hack for XSLTC with finding URI for default namespace
1797             if (m_elemContext.m_elementURI == null)
1798             {
1799                 String prefix1 = getPrefixPart(m_elemContext.m_elementName);
1800                 if (prefix1 == null && EMPTYSTRING.equals(prefix))
1801                 {