1 |
hwoarang 13/01/30 18:53:05 |
2 |
|
3 |
Added: ovaldi-5.10.1.4-strnicmp.patch |
4 |
ovaldi-5.10.1.4-disable-selinux-probes.patch |
5 |
ovaldi-5.10.1.4-xerces3.patch |
6 |
Log: |
7 |
Version bump. Bug #451694 thanks to clabbe.montjoie@×××××.com |
8 |
|
9 |
(Portage version: 2.1.11.50/cvs/Linux x86_64, signed Manifest commit with key B4AFF2C2) |
10 |
|
11 |
Revision Changes Path |
12 |
1.1 app-forensics/ovaldi/files/ovaldi-5.10.1.4-strnicmp.patch |
13 |
|
14 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-forensics/ovaldi/files/ovaldi-5.10.1.4-strnicmp.patch?rev=1.1&view=markup |
15 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-forensics/ovaldi/files/ovaldi-5.10.1.4-strnicmp.patch?rev=1.1&content-type=text/plain |
16 |
|
17 |
Index: ovaldi-5.10.1.4-strnicmp.patch |
18 |
=================================================================== |
19 |
--- src/Main.h.old 2010-10-22 14:59:13.000000000 +0200 |
20 |
+++ src/Main.h 2010-10-22 14:59:38.000000000 +0200 |
21 |
@@ -38,7 +38,7 @@ |
22 |
#endif |
23 |
|
24 |
#ifdef LINUX |
25 |
-# define STRNICMP strnicmp |
26 |
+# define STRNICMP strncasecmp |
27 |
#elif defined SUNOS |
28 |
# define STRNICMP strncasecmp |
29 |
#elif defined DARWIN |
30 |
|
31 |
|
32 |
|
33 |
1.1 app-forensics/ovaldi/files/ovaldi-5.10.1.4-disable-selinux-probes.patch |
34 |
|
35 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-forensics/ovaldi/files/ovaldi-5.10.1.4-disable-selinux-probes.patch?rev=1.1&view=markup |
36 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-forensics/ovaldi/files/ovaldi-5.10.1.4-disable-selinux-probes.patch?rev=1.1&content-type=text/plain |
37 |
|
38 |
Index: ovaldi-5.10.1.4-disable-selinux-probes.patch |
39 |
=================================================================== |
40 |
--- src/probes/unix/Process58Probe.cpp.old 2013-01-14 16:05:18.000000000 +0100 |
41 |
+++ src/probes/unix/Process58Probe.cpp 2013-01-14 16:06:16.000000000 +0100 |
42 |
@@ -29,8 +29,8 @@ |
43 |
//****************************************************************************************// |
44 |
|
45 |
#ifdef LINUX |
46 |
-# include <selinux/selinux.h> |
47 |
-# include <selinux/context.h> |
48 |
+/*# include <selinux/selinux.h> |
49 |
+# include <selinux/context.h>*/ |
50 |
# include <sys/capability.h> |
51 |
# include <SecurityContextGuard.h> |
52 |
#endif |
53 |
@@ -328,7 +328,7 @@ |
54 |
pid_t sessionId; |
55 |
uid_t loginuid; |
56 |
uint64_t effCap, *effCapp=&effCap; |
57 |
- string selinuxDomainLabel; |
58 |
+/* string selinuxDomainLabel;*/ |
59 |
|
60 |
Process58Probe::ProcStatus statStatus, statusStatus, ttyStatus, loginuidStatus; |
61 |
|
62 |
@@ -423,10 +423,10 @@ |
63 |
} |
64 |
|
65 |
// this one doesn't require reading anything in /proc |
66 |
- if (!RetrieveSelinuxDomainLabel(pid, &selinuxDomainLabel, &errMsg)) { |
67 |
+/* if (!RetrieveSelinuxDomainLabel(pid, &selinuxDomainLabel, &errMsg)) { |
68 |
item->AppendMessage(new OvalMessage(errMsg, OvalEnum::LEVEL_ERROR)); |
69 |
item->SetStatus(OvalEnum::STATUS_ERROR); |
70 |
- } |
71 |
+ }*/ |
72 |
|
73 |
// The Linux start time is represented as the number of jiffies (1/100 sec) |
74 |
// that the application was started after the last system reboot. To get an |
75 |
@@ -522,10 +522,10 @@ |
76 |
// aren't any. |
77 |
item->AppendElement(new ItemEntity("posix_capability", "", OvalEnum::DATATYPE_STRING, OvalEnum::STATUS_ERROR)); |
78 |
|
79 |
- if (selinuxDomainLabel.empty()) |
80 |
+/* if (selinuxDomainLabel.empty()) |
81 |
item->AppendElement(new ItemEntity("selinux_domain_label", "", OvalEnum::DATATYPE_STRING, OvalEnum::STATUS_ERROR)); |
82 |
else |
83 |
- item->AppendElement(new ItemEntity("selinux_domain_label", selinuxDomainLabel)); |
84 |
+ item->AppendElement(new ItemEntity("selinux_domain_label", selinuxDomainLabel));*/ |
85 |
|
86 |
if (statStatus == PROC_OK) |
87 |
item->AppendElement(new ItemEntity("session_id", Common::ToString(sessionId), OvalEnum::DATATYPE_INTEGER)); |
88 |
@@ -740,7 +740,7 @@ |
89 |
capMap[capEnum])); |
90 |
} |
91 |
} |
92 |
- |
93 |
+/* |
94 |
bool Process58Probe::RetrieveSelinuxDomainLabel(pid_t pid, string *label, string *err) { |
95 |
security_context_t sctx; |
96 |
int ec = getpidcon(pid, &sctx); |
97 |
@@ -763,7 +763,7 @@ |
98 |
*label = tmp; |
99 |
return true; |
100 |
} |
101 |
- |
102 |
+*/ |
103 |
#elif defined SUNOS |
104 |
|
105 |
void Process58Probe::GetPSInfo(string command, string pidStr, ItemVector* items) { |
106 |
@@ -830,7 +830,7 @@ |
107 |
item->AppendElement(new ItemEntity("exec_shield", "", OvalEnum::DATATYPE_BOOLEAN, OvalEnum::STATUS_NOT_COLLECTED)); |
108 |
item->AppendElement(new ItemEntity("loginuid", "", OvalEnum::DATATYPE_INTEGER, OvalEnum::STATUS_NOT_COLLECTED)); |
109 |
item->AppendElement(new ItemEntity("posix_capability", "", OvalEnum::DATATYPE_STRING, OvalEnum::STATUS_NOT_COLLECTED)); |
110 |
- item->AppendElement(new ItemEntity("selinux_domain_label", "", OvalEnum::DATATYPE_STRING, OvalEnum::STATUS_NOT_COLLECTED)); |
111 |
+/* item->AppendElement(new ItemEntity("selinux_domain_label", "", OvalEnum::DATATYPE_STRING, OvalEnum::STATUS_NOT_COLLECTED));*/ |
112 |
item->AppendElement(new ItemEntity("session_id", Common::ToString(info.pr_sid), OvalEnum::DATATYPE_INTEGER)); |
113 |
|
114 |
items->push_back(item); |
115 |
@@ -988,7 +988,7 @@ |
116 |
item->AppendElement(new ItemEntity("exec_shield", "", OvalEnum::DATATYPE_BOOLEAN, OvalEnum::STATUS_NOT_COLLECTED)); |
117 |
item->AppendElement(new ItemEntity("loginuid", "", OvalEnum::DATATYPE_INTEGER, OvalEnum::STATUS_NOT_COLLECTED)); |
118 |
item->AppendElement(new ItemEntity("posix_capability", "", OvalEnum::DATATYPE_STRING, OvalEnum::STATUS_NOT_COLLECTED)); |
119 |
- item->AppendElement(new ItemEntity("selinux_domain_label", "", OvalEnum::DATATYPE_STRING, OvalEnum::STATUS_NOT_COLLECTED)); |
120 |
+/* item->AppendElement(new ItemEntity("selinux_domain_label", "", OvalEnum::DATATYPE_STRING, OvalEnum::STATUS_NOT_COLLECTED));*/ |
121 |
item->AppendElement(new ItemEntity("session_id", "", OvalEnum::DATATYPE_INTEGER, OvalEnum::STATUS_NOT_COLLECTED)); |
122 |
|
123 |
items->push_back(item); |
124 |
|
125 |
|
126 |
|
127 |
1.1 app-forensics/ovaldi/files/ovaldi-5.10.1.4-xerces3.patch |
128 |
|
129 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-forensics/ovaldi/files/ovaldi-5.10.1.4-xerces3.patch?rev=1.1&view=markup |
130 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-forensics/ovaldi/files/ovaldi-5.10.1.4-xerces3.patch?rev=1.1&content-type=text/plain |
131 |
|
132 |
Index: ovaldi-5.10.1.4-xerces3.patch |
133 |
=================================================================== |
134 |
--- src/XmlProcessor.h.old 2011-08-18 14:35:41.608703233 +0200 |
135 |
+++ src/XmlProcessor.h 2011-08-18 14:39:21.835597094 +0200 |
136 |
@@ -38,14 +38,17 @@ |
137 |
#include <string> |
138 |
|
139 |
// required xerces includes |
140 |
-#include <xercesc/dom/DOMBuilder.hpp> |
141 |
#include <xercesc/dom/DOMDocument.hpp> |
142 |
#include <xercesc/dom/DOMErrorHandler.hpp> |
143 |
#include <xercesc/dom/DOMError.hpp> |
144 |
|
145 |
// for entity resolver |
146 |
-#include <xercesc/dom/DOMEntityResolver.hpp> |
147 |
-#include <xercesc/dom/DOMInputSource.hpp> |
148 |
+ |
149 |
+#include <xercesc/dom/DOMImplementationRegistry.hpp> |
150 |
+#include <xercesc/dom/DOMLSParser.hpp> |
151 |
+#include <xercesc/sax/EntityResolver.hpp> |
152 |
+#include <xercesc/sax/InputSource.hpp> |
153 |
+#include <xercesc/sax2/SAX2XMLReader.hpp> |
154 |
|
155 |
#include "Exception.h" |
156 |
|
157 |
@@ -53,12 +56,14 @@ |
158 |
This class extends the default DOMEntityResolver and implments the resolve entity method |
159 |
to support |
160 |
*/ |
161 |
-class DataDirResolver : public xercesc::DOMEntityResolver { |
162 |
+class DataDirResolver : public xercesc::EntityResolver { |
163 |
public: |
164 |
/** |
165 |
* |
166 |
*/ |
167 |
- xercesc::DOMInputSource *resolveEntity (const XMLCh *const publicId, const XMLCh *const systemId, const XMLCh *const baseURI); |
168 |
+// xercesc::DOMInputSource *resolveEntity (const XMLCh *const publicId, const XMLCh *const systemId, const XMLCh *const baseURI); |
169 |
+ xercesc::InputSource *resolveEntity (const XMLCh *const publicId, const XMLCh *const systemId); |
170 |
+ xercesc::DOMLSInput *resolveEntity (const XMLCh *const publicId, const XMLCh *const systemId, const XMLCh *const baseURI); |
171 |
}; |
172 |
|
173 |
/** |
174 |
@@ -144,7 +149,7 @@ |
175 |
* owns the documents it builds. Users must manually destroy |
176 |
* those documents. |
177 |
*/ |
178 |
- xercesc::DOMBuilder *parserWithCallerAdoption; |
179 |
+ xercesc::DOMLSParser *parserWithCallerAdoption; |
180 |
|
181 |
/** |
182 |
* This parser doesn't have user-adoption switched on, so it |
183 |
@@ -156,7 +161,7 @@ |
184 |
* appear to ever be switched off. So to make sure this isn't |
185 |
* leaking memory, I have created separate parsers. |
186 |
*/ |
187 |
- xercesc::DOMBuilder *parser; |
188 |
+ xercesc::DOMLSParser *parser; |
189 |
|
190 |
/** The entity resolver for both parsers. */ |
191 |
DataDirResolver resolver; |
192 |
--- src/probes/independent/XmlFileContentProbe.cpp.old 2010-10-22 14:49:22.000000000 +0200 |
193 |
+++ src/probes/independent/XmlFileContentProbe.cpp 2010-10-22 14:51:39.000000000 +0200 |
194 |
@@ -419,12 +419,24 @@ |
195 |
return new DummyEntityResolver::DoNothingBinInputStream(); |
196 |
} |
197 |
|
198 |
+#if XERCES_VERSION_MAJOR < 3 |
199 |
unsigned int DummyEntityResolver::DoNothingBinInputStream::curPos() const |
200 |
+#else |
201 |
+const XMLCh* DummyEntityResolver::DoNothingBinInputStream::getContentType() const |
202 |
+{ |
203 |
+ return NULL; |
204 |
+} |
205 |
+XMLFilePos DummyEntityResolver::DoNothingBinInputStream::curPos() const |
206 |
+#endif |
207 |
{ |
208 |
return 0; |
209 |
} |
210 |
|
211 |
+#if XERCES_VERSION_MAJOR < 3 |
212 |
unsigned int DummyEntityResolver::DoNothingBinInputStream::readBytes(XMLByte *const /*toFill*/, const unsigned int /*maxToRead*/) |
213 |
+#else |
214 |
+XMLSize_t DummyEntityResolver::DoNothingBinInputStream::readBytes(XMLByte *const toFill, XMLSize_t maxToRead) |
215 |
+#endif |
216 |
{ |
217 |
return 0; |
218 |
} |
219 |
--- src/probes/independent/XmlFileContentProbe.h.old 2010-10-22 14:55:47.000000000 +0200 |
220 |
+++ src/probes/independent/XmlFileContentProbe.h 2010-10-22 14:57:00.000000000 +0200 |
221 |
@@ -134,8 +134,14 @@ |
222 |
class DoNothingBinInputStream : public BinInputStream |
223 |
{ |
224 |
public: |
225 |
+#if XERCES_VERSION_MAJOR < 3 |
226 |
virtual unsigned int curPos() const; |
227 |
virtual unsigned int readBytes(XMLByte *const toFill, const unsigned int maxToRead); |
228 |
+#else |
229 |
+ virtual XMLFilePos curPos() const; |
230 |
+ virtual const XMLCh* getContentType() const; |
231 |
+ virtual XMLSize_t readBytes(XMLByte *const toFill, XMLSize_t maxToRead); |
232 |
+#endif |
233 |
}; |
234 |
}; |
235 |
|
236 |
--- src/XmlCommon.cpp.old |
237 |
+++ src/XmlCommon.cpp |
238 |
@@ -546,7 +546,11 @@ void XmlCommon::AddSchemaLocation(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *do |
239 |
string XmlCommon::GetNamespace(DOMElement *element) { |
240 |
|
241 |
string xmlns = ""; |
242 |
+#if XERCES_VERSION_MAJOR < 3 |
243 |
xmlns = XmlCommon::ToString(element->getTypeInfo()->getNamespace()); |
244 |
+#else |
245 |
+ xmlns = XmlCommon::ToString(element->getSchemaTypeInfo()->getTypeNamespace()); |
246 |
+#endif |
247 |
if (xmlns.compare("") == 0) { |
248 |
xmlns = ""; |
249 |
} |
250 |
--- src/XmlProcessor.cpp.old 2013-01-14 15:16:14.000000000 +0100 |
251 |
+++ src/XmlProcessor.cpp 2013-01-14 15:19:20.000000000 +0100 |
252 |
@@ -35,7 +35,6 @@ |
253 |
// for dom Writer |
254 |
#include <xercesc/dom/DOMImplementation.hpp> |
255 |
#include <xercesc/dom/DOMImplementationLS.hpp> |
256 |
-#include <xercesc/dom/DOMWriter.hpp> |
257 |
#include <xercesc/framework/StdOutFormatTarget.hpp> |
258 |
#include <xercesc/framework/LocalFileFormatTarget.hpp> |
259 |
#include <xercesc/util/XMLUni.hpp> |
260 |
@@ -50,11 +49,26 @@ |
261 |
using namespace std; |
262 |
using namespace xercesc; |
263 |
|
264 |
+#if XERCES_VERSION_MAJOR < 3 |
265 |
+#define SetParameter(serializer,n,v) if (serializer->canSetFeature(n,v)) serializer->setFeature(n,v) |
266 |
+#else |
267 |
+#define SetParameter(serializer,n,v) if (serializer->getDomConfig()->canSetParameter(n,v)) serializer->getDomConfig()->setParameter(n,v) |
268 |
+#endif |
269 |
+ |
270 |
//****************************************************************************************// |
271 |
// DataDirResolver Class // |
272 |
//****************************************************************************************// |
273 |
- |
274 |
+#if XERCES_VERSION_MAJOR < 3 |
275 |
DOMInputSource* DataDirResolver::resolveEntity (const XMLCh *const /*publicId*/, const XMLCh *const systemId, const XMLCh *const /*baseURI*/) { |
276 |
+#else |
277 |
+InputSource* DataDirResolver::resolveEntity(const XMLCh* publicId, const XMLCh* systemId) |
278 |
+{ |
279 |
+ return NULL; |
280 |
+ //return DataDirResolver::resolveEntity (publicId, systemId, NULL); |
281 |
+} |
282 |
+ |
283 |
+DOMLSInput* DataDirResolver::resolveEntity (const XMLCh *const publicId, const XMLCh *const systemId, const XMLCh *const baseURI) { |
284 |
+#endif |
285 |
string path = ""; |
286 |
size_t last; |
287 |
string schemapath = Common::GetSchemaPath(); |
288 |
@@ -127,7 +141,7 @@ |
289 |
parserWithCallerAdoption = makeParser(schemaLocation); |
290 |
// add one extra feature on this parser to prevent it from |
291 |
// taking ownership of its documents. |
292 |
- parserWithCallerAdoption->setFeature(XMLUni::fgXercesUserAdoptsDOMDocument, true); |
293 |
+ SetParameter(parserWithCallerAdoption, XMLUni::fgXercesUserAdoptsDOMDocument, true); |
294 |
|
295 |
} catch (const XMLException& toCatch) { |
296 |
string errMsg = "Error: An error occured durring initialization of the xml utilities:\n"; |
297 |
@@ -156,32 +170,40 @@ |
298 |
XMLPlatformUtils::Terminate(); |
299 |
} |
300 |
|
301 |
-DOMBuilder *XmlProcessor::makeParser(const string &schemaLocation) { |
302 |
+DOMLSParser *XmlProcessor::makeParser(const string &schemaLocation) { |
303 |
// Instantiate the DOM parser. |
304 |
static const XMLCh gLS[] = { chLatin_L, chLatin_S, chNull }; |
305 |
DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(gLS); |
306 |
|
307 |
- DOMBuilder *parser = ((DOMImplementationLS*)impl)->createDOMBuilder(DOMImplementationLS::MODE_SYNCHRONOUS, 0); |
308 |
+#if XERCES_VERSION_MAJOR < 3 |
309 |
+ DOMLSParser *parser = ((DOMImplementationLS*)impl)->createDOMLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0); |
310 |
+#else |
311 |
+ DOMLSParser *parser = ((DOMImplementationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0); |
312 |
+#endif |
313 |
|
314 |
/////////////////////////////////////////////////////// |
315 |
// Set features on the builder |
316 |
/////////////////////////////////////////////////////// |
317 |
|
318 |
- parser->setFeature(XMLUni::fgDOMComments, false); // Discard Comment nodes in the document. |
319 |
- parser->setFeature(XMLUni::fgDOMDatatypeNormalization, true); // Let the validation process do its datatype normalization that is defined in the used schema language. |
320 |
- parser->setFeature(XMLUni::fgDOMNamespaces, true); // Perform Namespace processing |
321 |
- parser->setFeature(XMLUni::fgDOMValidation, true); // Report all validation errors. |
322 |
- parser->setFeature(XMLUni::fgXercesSchema, true); // Enable the parser's schema support. |
323 |
- parser->setFeature(XMLUni::fgXercesSchemaFullChecking, true); // Enable full schema constraint checking, including checking which may be time-consuming or memory intensive. Currently, particle unique attribution constraint checking and particle derivation restriction checking are controlled by this option. |
324 |
- parser->setFeature(XMLUni::fgXercesValidationErrorAsFatal, true); // The parser will treat validation error as fatal and will exit |
325 |
- parser->setFeature(XMLUni::fgXercesDOMHasPSVIInfo, true); // Enable storing of PSVI information in element and attribute nodes. |
326 |
+ SetParameter(parser, XMLUni::fgDOMComments, false); // Discard Comment nodes in the document. |
327 |
+ SetParameter(parser, XMLUni::fgDOMDatatypeNormalization, true); // Let the validation process do its datatype normalization that is defined in the used schema language. |
328 |
+ SetParameter(parser, XMLUni::fgDOMNamespaces, true); // Perform Namespace processing |
329 |
+ SetParameter(parser, XMLUni::fgDOMValidate, true); // Report all validation errors. |
330 |
+ SetParameter(parser, XMLUni::fgXercesSchema, true); // Enable the parser's schema support. |
331 |
+ SetParameter(parser, XMLUni::fgXercesSchemaFullChecking, true); // Enable full schema constraint checking, including checking which may be time-consuming or memory intensive. Currently, particle unique attribution constraint checking and particle derivation restriction checking are controlled by this option. |
332 |
+ SetParameter(parser, XMLUni::fgXercesValidationErrorAsFatal, true); // The parser will treat validation error as fatal and will exit |
333 |
+ SetParameter(parser, XMLUni::fgXercesDOMHasPSVIInfo, true); // Enable storing of PSVI information in element and attribute nodes. |
334 |
|
335 |
/////////////////////////////////////////////////////// |
336 |
//****************************************************************************************// |
337 |
// The following code was added to handle air-gap operation // |
338 |
//****************************************************************************************// |
339 |
/* Look for XML schemas in local directory instead of Internet */ |
340 |
+#if XERCES_VERSION_MAJOR < 3 |
341 |
parser->setEntityResolver (&resolver); |
342 |
+#else |
343 |
+ parser->getDomConfig()->setParameter(XMLUni::fgXercesEntityResolver, &resolver); |
344 |
+#endif |
345 |
//****************************************************************************************// |
346 |
// End of air-gap code // |
347 |
//****************************************************************************************// |
348 |
@@ -189,7 +211,11 @@ |
349 |
/////////////////////////////////////////////////////// |
350 |
// Add an Error Handler |
351 |
/////////////////////////////////////////////////////// |
352 |
+#if XERCES_VERSION_MAJOR < 3 |
353 |
parser->setErrorHandler(&errHandler); |
354 |
+#else |
355 |
+ parser->getDomConfig()->setParameter(XMLUni::fgDOMErrorHandler, &errHandler); |
356 |
+#endif |
357 |
|
358 |
// Fix a schema location if possible, so instance documents don't |
359 |
// have to set the schemaLocation attribute. And if they do, this |
360 |
@@ -197,7 +223,7 @@ |
361 |
// overriding of the value in instance documents. |
362 |
if (!schemaLocation.empty()) { |
363 |
XMLCh *schemaLocationCstr = XMLString::transcode(schemaLocation.c_str()); |
364 |
- parser->setProperty(XMLUni::fgXercesSchemaExternalSchemaLocation, schemaLocationCstr); |
365 |
+ SetParameter(parser, XMLUni::fgXercesSchemaExternalSchemaLocation, schemaLocationCstr); |
366 |
XMLString::release(&schemaLocationCstr); |
367 |
} |
368 |
|
369 |
@@ -279,23 +305,19 @@ |
370 |
XMLCh tempStr[100]; |
371 |
XMLString::transcode("LS", tempStr, 99); |
372 |
DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); |
373 |
+#if XERCES_VERSION_MAJOR < 3 |
374 |
DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter(); |
375 |
+#else |
376 |
+ DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer(); |
377 |
+#endif |
378 |
|
379 |
- // set feature if the serializer supports the feature/mode |
380 |
- if (theSerializer->canSetFeature(XMLUni::fgDOMWRTSplitCdataSections, true)) |
381 |
- theSerializer->setFeature(XMLUni::fgDOMWRTSplitCdataSections, true); |
382 |
|
383 |
- if (theSerializer->canSetFeature(XMLUni::fgDOMWRTDiscardDefaultContent, true)) |
384 |
- theSerializer->setFeature(XMLUni::fgDOMWRTDiscardDefaultContent, true); |
385 |
- |
386 |
- if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true)) |
387 |
- theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true); |
388 |
- |
389 |
- if (theSerializer->canSetFeature(XMLUni::fgDOMWRTBOM, false)) |
390 |
- theSerializer->setFeature(XMLUni::fgDOMWRTBOM, false); |
391 |
- |
392 |
- //if (theSerializer->canSetFeature(XMLUni::fgDOMWRTDiscardDefaultContent, true)) |
393 |
- // theSerializer->setFeature(XMLUni::fgDOMWRTBOM, true); |
394 |
+ // set feature if the serializer supports the feature/mode |
395 |
+ SetParameter(theSerializer, XMLUni::fgDOMWRTSplitCdataSections, true); |
396 |
+ SetParameter(theSerializer, XMLUni::fgDOMWRTDiscardDefaultContent, true); |
397 |
+ SetParameter(theSerializer, XMLUni::fgDOMWRTFormatPrettyPrint, true); |
398 |
+ SetParameter(theSerializer, XMLUni::fgDOMWRTBOM, false); |
399 |
+ //SetParameter(theSerializer, XMLUni::fgDOMWRTBOM, true); |
400 |
|
401 |
// |
402 |
// Plug in a format target to receive the resultant |
403 |
@@ -313,7 +335,13 @@ |
404 |
// |
405 |
// do the serialization through DOMWriter::writeNode(); |
406 |
// |
407 |
+#if XERCES_VERSION_MAJOR < 3 |
408 |
theSerializer->writeNode(myFormTarget, *doc); |
409 |
+#else |
410 |
+ DOMLSOutput *output = ((DOMImplementationLS*)impl)->createLSOutput(); |
411 |
+ output->setByteStream(myFormTarget); |
412 |
+ theSerializer->write(doc, output); |
413 |
+#endif |
414 |
|
415 |
theSerializer->release(); |
416 |
delete myFormTarget; |