You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2001/01/16 03:47:48 UTC
cvs commit: xml-xalan/c/src/XMLSupport FormatterToDOM.cpp FormatterToDOM.hpp
dbertoni 01/01/15 18:47:48
Modified: c/src/XMLSupport FormatterToDOM.cpp FormatterToDOM.hpp
Log:
Added some functions to get/set members. Buffer text to prevent excessive memory allocations.
Revision Changes Path
1.12 +10 -4 xml-xalan/c/src/XMLSupport/FormatterToDOM.cpp
Index: FormatterToDOM.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToDOM.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- FormatterToDOM.cpp 2000/11/02 01:45:50 1.11
+++ FormatterToDOM.cpp 2001/01/16 02:47:48 1.12
@@ -188,7 +188,9 @@
const XMLCh* const chars,
const unsigned int length)
{
- append(m_doc->createTextNode(XalanDOMString(chars, length)));
+ assign(m_buffer, chars, length);
+
+ append(m_doc->createTextNode(m_buffer));
}
@@ -202,7 +204,7 @@
s_xsltNextIsRawString,
s_formatterToDOMString));
- append(m_doc->createTextNode(XalanDOMString(chars, length)));
+ characters(chars, length);
}
@@ -220,7 +222,9 @@
const XMLCh* const chars,
const unsigned int length)
{
- append(m_doc->createTextNode(XalanDOMString(chars, length)));
+ assign(m_buffer, chars, length);
+
+ append(m_doc->createTextNode(m_buffer));
}
@@ -255,7 +259,9 @@
const XMLCh* const ch,
const unsigned int length)
{
- append(m_doc->createCDATASection(XalanDOMString(ch, length)));
+ assign(m_buffer, ch, length);
+
+ append(m_doc->createCDATASection(m_buffer));
}
1.11 +20 -0 xml-xalan/c/src/XMLSupport/FormatterToDOM.hpp
Index: FormatterToDOM.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToDOM.hpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- FormatterToDOM.hpp 2000/09/05 02:24:48 1.10
+++ FormatterToDOM.hpp 2001/01/16 02:47:48 1.11
@@ -192,18 +192,36 @@
return m_doc;
}
+ void
+ setDocument(XalanDocument* theDocument)
+ {
+ m_doc = theDocument;
+ }
+
XalanDocumentFragment*
getDocumentFragment() const
{
return m_docFrag;
}
+ void
+ setDocumentFragment(XalanDocumentFragment* theDocumentFragment)
+ {
+ m_docFrag = theDocumentFragment;
+ }
+
XalanElement*
getCurrentElement() const
{
return m_currentElem;
}
+ void
+ setCurrentElement(XalanElement* theElement)
+ {
+ m_currentElem = theElement;
+ }
+
private:
/**
@@ -227,6 +245,8 @@
#endif
ElementStackType m_elemStack;
+
+ XalanDOMString m_buffer;
static const XalanDOMString& s_xsltNextIsRawString;