3 #include "Print_Handler.h"
5 #include "ace/Log_Msg.h"
7 ACEXML_Print_Handler::ACEXML_Print_Handler (ACEXML_Char
* fileName
)
8 : fileName_(ACE::strnew (fileName
)),
13 ACEXML_Print_Handler::~ACEXML_Print_Handler ()
15 delete[] this->fileName_
;
19 ACEXML_Print_Handler::characters (const ACEXML_Char
*cdata
,
24 ACE_TEXT ("* Event characters () ** start: %u end: %u ***************\n%s\n- End event characters () ---------------\n"),
25 start
, length
, cdata
));
29 ACEXML_Print_Handler::endDocument ()
32 ACE_TEXT ("* Event endDocument () ***************\n")));
36 ACEXML_Print_Handler::endElement (const ACEXML_Char
*uri
,
37 const ACEXML_Char
*name
,
38 const ACEXML_Char
*qName
)
41 ACE_TEXT ("* Event endElement (%s, %s, %s) ***************\n"),
46 ACEXML_Print_Handler::endPrefixMapping (const ACEXML_Char
*prefix
)
49 ACE_TEXT ("* Event endPrefixMapping (%s) ***************\n"),
54 ACEXML_Print_Handler::ignorableWhitespace (const ACEXML_Char
*,
58 // ACE_DEBUG ((LM_DEBUG,
59 // ACE_TEXT ("* Event ignorableWhitespace () ***************\n")));
63 ACEXML_Print_Handler::processingInstruction (const ACEXML_Char
*target
,
64 const ACEXML_Char
*data
)
67 ACE_TEXT ("* Event processingInstruction (%s, %s) ***************\n"),
72 ACEXML_Print_Handler::setDocumentLocator (ACEXML_Locator
* locator
)
74 this->locator_
= locator
;
75 // ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("* Event setDocumentLocator () ***************\n")));
79 ACEXML_Print_Handler::skippedEntity (const ACEXML_Char
*name
)
82 ACE_TEXT ("* Event skippedEntity (%s) ***************\n"),
87 ACEXML_Print_Handler::startDocument ()
90 ACE_TEXT ("* Event startDocument () ***************\n")));
94 ACEXML_Print_Handler::startElement (const ACEXML_Char
*uri
,
95 const ACEXML_Char
*name
,
96 const ACEXML_Char
*qName
,
97 ACEXML_Attributes
*alist
)
100 ACE_TEXT ("* Event startElement (%s, %s, %s) ***************\n"),
104 for (size_t i
= 0; i
< alist
->getLength (); ++i
)
106 ACE_DEBUG ((LM_DEBUG
,
107 ACE_TEXT (" %s = \"%s\"\n"),
108 alist
->getQName (i
), alist
->getValue (i
)));
113 ACEXML_Print_Handler::startPrefixMapping (const ACEXML_Char
* prefix
,
114 const ACEXML_Char
* uri
)
116 ACE_DEBUG ((LM_DEBUG
,
117 ACE_TEXT ("* Event startPrefixMapping () ***************\n")));
118 ACE_DEBUG ((LM_DEBUG
,
119 ACE_TEXT ("Prefix = %s, URI = %s\n"), prefix
, uri
));
122 // *** Methods inherit from ACEXML_DTDHandler.
125 ACEXML_Print_Handler::notationDecl (const ACEXML_Char
*name
,
126 const ACEXML_Char
*publicID
,
127 const ACEXML_Char
*systemID
)
129 ACE_DEBUG ((LM_DEBUG
,
130 ACE_TEXT ("* Event notationDecl: (%s) "),
134 ACE_DEBUG ((LM_DEBUG
,
135 ACE_TEXT ("SYSTEM %s\n"),
137 else if (systemID
== 0)
138 ACE_DEBUG ((LM_DEBUG
,
139 ACE_TEXT ("PUBLIC %s\n"),
142 ACE_DEBUG ((LM_DEBUG
,
143 ACE_TEXT ("PUBLIC %s %s\n"),
144 publicID
, systemID
));
148 ACEXML_Print_Handler::unparsedEntityDecl (const ACEXML_Char
*name
,
149 const ACEXML_Char
*publicID
,
150 const ACEXML_Char
*systemID
,
151 const ACEXML_Char
*notationName
)
153 ACE_DEBUG ((LM_DEBUG
,
154 ACE_TEXT ("* Unparsed Entity: %s"),
158 ACE_DEBUG ((LM_DEBUG
,
159 ACE_TEXT (" SYSTEM %s"),
162 ACE_DEBUG ((LM_DEBUG
,
163 ACE_TEXT (" PUBLIC %s %s"),
164 publicID
, systemID
));
166 ACE_DEBUG ((LM_DEBUG
,
167 ACE_TEXT (" NDATA %s\n"),
171 // Methods inherit from ACEXML_EnitityResolver.
174 ACEXML_Print_Handler::resolveEntity (const ACEXML_Char
*,
181 // Methods inherit from ACEXML_ErrorHandler.
184 * Receive notification of a recoverable error.
187 ACEXML_Print_Handler::error (ACEXML_SAXParseException
& ex
)
189 ACE_DEBUG ((LM_DEBUG
, "%s: line: %d col: %d ",
190 (this->locator_
->getSystemId() == 0 ? this->fileName_
: this->locator_
->getSystemId()),
191 this->locator_
->getLineNumber(),
192 this->locator_
->getColumnNumber()));
197 ACEXML_Print_Handler::fatalError (ACEXML_SAXParseException
& ex
)
199 ACE_DEBUG ((LM_DEBUG
, "%s: line: %d col: %d ",
200 (this->locator_
->getSystemId() == 0 ? this->fileName_
: this->locator_
->getSystemId()),
201 this->locator_
->getLineNumber(),
202 this->locator_
->getColumnNumber()));
207 ACEXML_Print_Handler::warning (ACEXML_SAXParseException
& ex
)
209 ACE_DEBUG ((LM_DEBUG
, "%s: line: %d col: %d ",
210 (this->locator_
->getSystemId() == 0 ? this->fileName_
: this->locator_
->getSystemId()),
211 this->locator_
->getLineNumber(),
212 this->locator_
->getColumnNumber()));