dbertoni    2004/11/05 15:42:33

  Modified:    c/src/xalanc/XSLT StylesheetRoot.cpp StylesheetRoot.hpp
  Log:
  Fixed bug where an implicit indent value of "yes" would be set for HTML 
output.
  
  Revision  Changes    Path
  1.22      +10 -10    xml-xalan/c/src/xalanc/XSLT/StylesheetRoot.cpp
  
  Index: StylesheetRoot.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/StylesheetRoot.cpp,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- StylesheetRoot.cpp        12 Oct 2004 19:20:16 -0000      1.21
  +++ StylesheetRoot.cpp        5 Nov 2004 23:42:33 -0000       1.22
  @@ -82,7 +82,7 @@
                           baseIdentifier,
                           constructionContext),        
        m_version(),
  -     m_indentResult(false),
  +     m_indentResult(eIndentNoImplicit),
        m_encoding(),
        m_mediatype(),
        m_doctypeSystem(),
  @@ -340,7 +340,7 @@
                        indentAmount = m_indentAmount;
                }
   
  -             const bool      doIndent = (indentAmount > -1) ? true : 
m_indentResult;
  +             const bool      doIndent = (indentAmount > -1) ? true : 
getOutputIndent();
   
                const XalanDOMString&   theEncoding = getEncoding(outputTarget);
   
  @@ -449,8 +449,6 @@
   {
        const unsigned int              nAttrs = atts.getLength();
   
  -     bool                                    didSpecifyIndent = false;
  -
        const LocatorType* const        theLocator = 
constructionContext.getLocatorFromStack();
   
        for(unsigned int i = 0; i < nAttrs; i++)
  @@ -484,9 +482,10 @@
                }
                else if(equals(aname,Constants::ATTRNAME_OUTPUT_INDENT))
                {
  -                     m_indentResult = getYesOrNo(aname, atts.getValue(i), 
constructionContext);
  -
  -                     didSpecifyIndent = true;
  +                     m_indentResult =
  +                getYesOrNo(aname, atts.getValue(i), constructionContext) == 
true ?
  +                    eIndentYesExplicit :
  +                    eIndentNoExplicit;
                }
                else if(equals(aname,Constants::ATTRNAME_OUTPUT_ENCODING))
                {
  @@ -580,10 +579,11 @@
                }
        }
   
  -     if(FormatterListener::OUTPUT_METHOD_HTML == m_outputMethod &&
  -        false == didSpecifyIndent)
  +     if(m_outputMethod == FormatterListener::OUTPUT_METHOD_HTML &&
  +        m_indentResult != eIndentNoExplicit &&
  +       m_indentResult != eIndentYesExplicit)
        {
  -             m_indentResult = true;
  +             m_indentResult = eIndentYesImplicit;
        }
   }
   
  
  
  
  1.13      +6 -3      xml-xalan/c/src/xalanc/XSLT/StylesheetRoot.hpp
  
  Index: StylesheetRoot.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/StylesheetRoot.hpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- StylesheetRoot.hpp        17 Sep 2004 22:23:10 -0000      1.12
  +++ StylesheetRoot.hpp        5 Nov 2004 23:42:33 -0000       1.13
  @@ -154,7 +154,8 @@
        bool 
        getOutputIndent() const
        {
  -             return m_indentResult;
  +        return m_indentResult == eIndentNoImplicit ||
  +               m_indentResult == eIndentNoExplicit ? false : true;
        }
   
        /**
  @@ -304,7 +305,7 @@
        void
        setIndentResult(bool bIndent)
        {
  -             m_indentResult = bIndent;
  +        m_indentResult = bIndent == true ? eIndentYesExplicit : 
eIndentNoExplicit;
        }
   
        /**
  @@ -435,11 +436,13 @@
         */
        XalanDOMString  m_version;
   
  +    enum eIndentType { eIndentNoImplicit, eIndentNoExplicit, 
eIndentYesImplicit, eIndentYesExplicit };
  +
        /**
         * indent-result is by default no, which means an XSL processor must not
         * change the whitespace on output.
         */
  -     bool                    m_indentResult;
  +     eIndentType             m_indentResult;
   
        /**
         * The encoding attribute specifies the preferred encoding to use 
  
  
  

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

Reply via email to