18 #if !defined(XALANXMLSERIALIZERBASE_HEADER_GUARD_1357924680)
19 #define XALANXMLSERIALIZERBASE_HEADER_GUARD_1357924680
46 class XalanOutputStream;
50 using xercesc::MemoryManager;
66 initialize(MemoryManager& theManager);
90 MemoryManager& theManager,
104 return m_elemStack.getMemoryManager();
111 setDocumentLocator(
const Locator*
const locator);
118 const XMLCh*
const name,
119 AttributeList& attrs) = 0;
122 endElement(
const XMLCh*
const name) = 0;
126 const XMLCh*
const chars,
131 const XMLCh*
const chars,
135 entityReference(
const XMLCh*
const name) = 0;
139 const XMLCh*
const chars,
143 processingInstruction(
144 const XMLCh*
const target,
145 const XMLCh*
const data);
151 comment(
const XMLCh*
const data) = 0;
155 const XMLCh*
const ch,
159 getDoctypeSystem()
const;
162 getDoctypePublic()
const;
182 return m_shouldWriteXMLHeader;
188 m_shouldWriteXMLHeader = b;
212 static const char s_doctypeHeaderStartString[];
219 static const char s_doctypeHeaderPublicString[];
226 static const char s_doctypeHeaderSystemString[];
233 static const char s_xmlHeaderStartString[];
240 static const char s_xmlHeaderEncodingString[];
247 static const char s_xmlHeaderStandaloneString[];
254 static const char s_xmlHeaderEndString[];
261 static const char s_defaultVersionString[];
268 static const XalanDOMChar s_xhtmlDocTypeString[];
275 static const char s_cdataOpenString[];
282 static const char s_cdataCloseString[];
289 static const char s_lessThanEntityString[];
296 static const char s_greaterThanEntityString[];
303 static const char s_ampersandEntityString[];
310 static const char s_quoteEntityString[];
327 static const XalanDOMChar s_doctypeHeaderStartString[];
334 static const XalanDOMChar s_doctypeHeaderPublicString[];
341 static const XalanDOMChar s_doctypeHeaderSystemString[];
348 static const XalanDOMChar s_xmlHeaderStartString[];
355 static const XalanDOMChar s_xmlHeaderEncodingString[];
362 static const XalanDOMChar s_xmlHeaderStandaloneString[];
369 static const XalanDOMChar s_xmlHeaderEndString[];
376 static const XalanDOMChar s_defaultVersionString[];
383 static const XalanDOMChar s_xhtmlDocTypeString[];
390 static const XalanDOMChar s_cdataOpenString[];
397 static const XalanDOMChar s_cdataCloseString[];
404 static const XalanDOMChar s_lessThanEntityString[];
411 static const XalanDOMChar s_greaterThanEntityString[];
418 static const XalanDOMChar s_ampersandEntityString[];
425 static const XalanDOMChar s_quoteEntityString[];
442 return theChar > s_lastSpecial ?
444 s_specialChars[theChar] > eNone;
450 return theChar > s_lastSpecial ?
452 s_specialChars[theChar] > eAttr;
460 return theChar > s_lastSpecial;
466 return theChar > s_lastSpecial ?
468 s_specialChars[theChar] == eForb;
474 return theChar > s_lastSpecial ?
476 s_specialChars[theChar] == eForb;
481 static const size_t s_lastSpecial;
483 static const char s_specialChars[];
495 return theChar > s_lastSpecial ?
497 s_specialChars[theChar] > eNone;
503 return theChar > s_lastSpecial ?
505 s_specialChars[theChar] > eAttr;
513 return theChar > s_lastSpecial;
519 return theChar > s_lastSpecial ?
521 s_specialChars[theChar] == eForb;
527 return theChar > s_lastSpecial ?
529 s_specialChars[theChar] == eCRFb;
533 static const size_t s_lastSpecial;
535 static const char s_specialChars[];
558 writeXMLHeader() = 0;
564 writeDoctypeDecl(
const XalanDOMChar* name) = 0;
567 writeProcessingInstruction(
569 const XMLCh* data) = 0;
595 if(!m_elemStack.empty())
598 if(
false == m_elemStack.back())
600 m_elemStack.back() =
true;
616 return m_needToOutputDoctypeDecl;
625 m_elemStack.push_back(
false);
631 return m_elemStack.empty();
642 bool fResult =
false;
644 if (m_elemStack.empty() ==
false)
646 fResult = m_elemStack.back();
648 m_elemStack.pop_back();
657 if(
true == m_needToOutputDoctypeDecl)
659 assert(m_doctypeSystem.empty() ==
false);
661 writeDoctypeDecl(name);
663 m_needToOutputDoctypeDecl =
false;
702 return 0xD800u <= theChar && theChar <= 0xDBFFu ? true :
false;
708 return 0xDC00u <= theChar && theChar <= 0xDFFFu ? true :
false;
711 static XalanUnicodeChar
712 decodeUTF16SurrogatePair(
713 XalanDOMChar theHighSurrogate,
714 XalanDOMChar theLowSurrogate,
715 MemoryManager& theManager);
723 throwInvalidUTF16SurrogateException(
725 MemoryManager& theManager);
734 throwInvalidUTF16SurrogateException(
737 MemoryManager& theManager);
746 throwInvalidCharacterException(
748 MemoryManager& theManager);
758 throwInvalidXMLCharacterException(
761 MemoryManager& theManager);
779 bool m_needToOutputDoctypeDecl;
784 bool m_shouldWriteXMLHeader;
790 BoolStackType m_elemStack;
795 static const XalanDOMChar s_xhtmlDocTypeString[];
797 static const size_type s_xhtmlDocTypeStringLength;
806 #endif // XALANXMLSERIALIZERBASE_HEADER_GUARD_1357924680