dbertoni    2002/08/12 22:34:22

  Modified:    c/src/XMLSupport FormatterToHTML.cpp FormatterToHTML.hpp
  Log:
  Implemented new options for HTML output.  Removed unused constructor 
arguments.
  
  Revision  Changes    Path
  1.70      +17 -14    xml-xalan/c/src/XMLSupport/FormatterToHTML.cpp
  
  Index: FormatterToHTML.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToHTML.cpp,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- FormatterToHTML.cpp       6 Aug 2002 01:30:22 -0000       1.69
  +++ FormatterToHTML.cpp       13 Aug 2002 05:34:22 -0000      1.70
  @@ -103,31 +103,31 @@
                        const XalanDOMString&   doctypePublic,
                        bool                                    doIndent,
                        int                                             indent,
  -                     const XalanDOMString&   version,
  -                     const XalanDOMString&   standalone,
  -                     bool                                    xmlDecl) :
  +                     bool                                    escapeURLs,
  +                     bool                                    omitMetaTag) :
        FormatterToXML(
                        writer,
  -                     version,
  +                     s_emptyString,
                        doIndent,
                        indent,
                        encoding,
                        mediaType,
                        doctypeSystem,
                        doctypePublic,
  -                     xmlDecl,
  -                     standalone,
  +                     false,
  +                     s_emptyString,
                        OUTPUT_METHOD_HTML),
        m_currentElementName(),
        m_inBlockElem(false),
        m_isRawStack(),
        m_isScriptOrStyleElem(false),
        m_inScriptElemStack(),
  -     m_escapeURLs(true),
  +     m_escapeURLs(escapeURLs),
        m_isFirstElement(false),
        m_isUTF8(XalanTranscodingServices::encodingIsUTF8(m_encoding)),
        m_elementLevel(0),
  -     m_hasNamespaceStack()
  +     m_hasNamespaceStack(),
  +     m_omitMetaTag(omitMetaTag)
   {
        assert(s_elementFlags != 0 && s_dummyDesc != 0 && s_xalanHTMLEntities 
!= 0);
   
  @@ -366,13 +366,16 @@
                {
                        writeParentTagEnd();
   
  -                     if (m_doIndent)
  -                             indent(m_currentIndent);
  +                     if (m_omitMetaTag == false)
  +                     {
  +                             if (m_doIndent)
  +                                     indent(m_currentIndent);
   
  -                     accumContent(s_metaString);
  -                     accumContent(getEncoding());      
  -                     accumContent(XalanUnicode::charQuoteMark);
  -                     accumContent(XalanUnicode::charGreaterThanSign);
  +                             accumContent(s_metaString);
  +                             accumContent(getEncoding());      
  +                             accumContent(XalanUnicode::charQuoteMark);
  +                             accumContent(XalanUnicode::charGreaterThanSign);
  +                     }
                }
   
                // We've written the first element, so turn off the flag...
  
  
  
  1.30      +26 -6     xml-xalan/c/src/XMLSupport/FormatterToHTML.hpp
  
  Index: FormatterToHTML.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToHTML.hpp,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- FormatterToHTML.hpp       10 Apr 2002 06:03:52 -0000      1.29
  +++ FormatterToHTML.hpp       13 Aug 2002 05:34:22 -0000      1.30
  @@ -128,9 +128,13 @@
        /**
         * Constructor for customized encoding and doctype.
         * @param writer        The character output stream to use.
  -      * @param encoding      Java character encoding in use by 
<VAR>writer</VAR>.
  -      * @param doctype       String to be printed at the top of the document.
  +      * @param encoding      The character encoding in use by writer.
  +      * @param doctypeSystem The system ID for the DOCTYPE.
  +      * @param doctypePublic The public ID for the DOCTYPE.
  +      * @param doIndent      true if indenting should be enabled
         * @param indent        Number of spaces to indent at each nesting 
level.
  +      * @param escapeURLs    Whether or not to escape URLs according to the 
recommendation.  The default is true.
  +      * @param omitMetaTag   Whether or not to output a META TAG according 
to the recommendation.  The default is false.
         */
        FormatterToHTML(
                        Writer&                                 writer,
  @@ -140,9 +144,8 @@
                        const XalanDOMString&   doctypePublic = 
XalanDOMString(),
                        bool                                    doIndent = true,
                        int                                             indent 
= eDefaultIndentAmount,
  -                     const XalanDOMString&   version = XalanDOMString(),
  -                     const XalanDOMString&   standalone = XalanDOMString(),
  -                     bool                                    xmlDecl = 
false);
  +                     bool                                    escapeURLs = 
true,
  +                     bool                                    omitMetaTag = 
false);
   
        virtual
        ~FormatterToHTML();
  @@ -194,6 +197,18 @@
                        const XMLCh* const      data);
   
   
  +     bool
  +     getEscapeURLs() const
  +     {
  +             return m_escapeURLs;
  +     }
  +
  +     void
  +     setEscapeURLs(bool      flag)
  +     {
  +             m_escapeURLs = flag;
  +     }
  +
        class ElemDesc
        {
        public:
  @@ -469,6 +484,11 @@
         * a namespace.
         */
        BoolStackType                   m_hasNamespaceStack;
  +
  +     /**
  +      * This is set to true if we should omit the META tag in HTML output 
(the default is false)
  +      */
  +     bool                                    m_omitMetaTag;
   
        static const XalanDOMString             s_emptyString;
   };
  
  
  

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

Reply via email to