39 #ifndef OME_COMMON_XML_DOM_DOCUMENT_H
40 #define OME_COMMON_XML_DOM_DOCUMENT_H
42 #include <ome/common/config.h>
49 #include <xercesc/dom/DOMComment.hpp>
50 #include <xercesc/dom/DOMDocument.hpp>
51 #include <xercesc/dom/DOMNode.hpp>
52 #include <xercesc/parsers/XercesDOMParser.hpp>
58 #include <ome/common/xml/dom/Element.h>
59 #include <ome/common/xml/dom/NodeList.h>
60 #include <ome/common/xml/dom/Wrapper.h>
61 #include <ome/common/xml/EntityResolver.h>
62 #include <ome/common/xml/String.h>
169 const std::string& name)
174 return Element((*this)->createElementNS(xns, xname),
false);
188 xercesc::DOMNode *node =
dynamic_cast<xercesc::DOMNode *
>((*this)->createComment(text));
189 return Node(node,
false);
203 return Element((*this)->createElement(xname),
false);
214 return Element((*this)->getDocumentElement(),
false);
226 return (*this)->getElementsByTagName(
String(name));
262 validationScheme(xercesc::XercesDOMParser::Val_Auto),
265 handleMultipleImports(true),
266 validationSchemaFullChecking(true),
267 createEntityReferenceNodes(true)
291 const std::string& qualifiedName);
304 const ParseParameters& params = ParseParameters());
318 const ParseParameters& params = ParseParameters(),
319 const std::string&
id =
"membuf");
333 const ParseParameters& params = ParseParameters(),
334 const std::string&
id =
"streambuf");
384 canonicalForm(false),
387 datatypeNormalization(false),
388 discardDefaultContent(true),
391 namespaceDeclarations(true),
392 normalizeCharacters(false),
394 splitCDATASections(true),
411 const boost::filesystem::path& file,
412 const WriteParameters& params = WriteParameters());
423 std::ostream& stream,
424 const WriteParameters& params = WriteParameters());
436 const WriteParameters& params = WriteParameters());
447 const boost::filesystem::path& file,
448 const WriteParameters& params = WriteParameters());
459 std::ostream& stream,
460 const WriteParameters& params = WriteParameters());
472 const WriteParameters& params = WriteParameters());
483 const boost::filesystem::path& file,
484 const WriteParameters& params = WriteParameters());
495 std::ostream& stream,
496 const WriteParameters& params = WriteParameters());
508 const WriteParameters& params = WriteParameters());
515 #endif // OME_COMMON_XML_DOM_DOCUMENT_H
bool discardDefaultContent
Discard defaults (discard-default-content).
Definition: Document.h:362
Node createComment(const std::string &comment)
Create Comment.
Definition: Document.h:184
bool comments
Retain comments (comments).
Definition: Document.h:358
bool doSchema
Use schemas?
Definition: Document.h:252
element_type * wrapped
The wrapped type.
Definition: Wrapper.h:264
Memory type substitution.
bool CDATASections
Retain CDATA (cdata-sections).
Definition: Document.h:356
Xerces DOM class wrapper.
Definition: Wrapper.h:72
bool whitespace
Retain whitespace (element-content-whitespace).
Definition: Document.h:378
DOM Node wrapper.
Definition: Node.h:68
bool doNamespaces
Use namespaces?
Definition: Document.h:250
DOM Document wrapper.
Definition: Document.h:83
DOM Element wrapper.
Definition: Element.h:66
Document createDocument(const boost::filesystem::path &file, EntityResolver &resolver, const ParseParameters ¶ms)
Construct a Document from the content of a file.
Definition: Document.cpp:225
bool validate
Validate if schema available (validate-if-schema).
Definition: Document.h:376
bool canonicalForm
Canonicalize document (canonical-form).
Definition: Document.h:354
bool datatypeNormalization
Datatype normalization (datatype-normalization).
Definition: Document.h:360
Node()
Construct a NULL Node.
Definition: Node.h:77
void writeDocument(Document &document, const boost::filesystem::path &file, const WriteParameters ¶ms)
Write a Document to a file.
Definition: Document.cpp:361
bool entities
Retain entities (entities).
Definition: Document.h:364
WriteParameters()
Constructor.
Definition: Document.h:383
Element createElement(const std::string &name)
Create Element without namespace.
Definition: Document.h:199
Xerces entity resolver.
Definition: EntityResolver.h:66
Document(Wrapper< xercesc::DOMDocument, Node >::base_element_type *base, bool managed)
Construct a Document from a xercesc::DOMNode *.
Definition: Document.h:134
bool namespaces
Namespace processing (namespaces).
Definition: Document.h:366
~Document()
Destructor.
Definition: Document.h:143
bool handleMultipleImports
Handle multiple imports?
Definition: Document.h:254
bool createEntityReferenceNodes
Create entity reference nodes?
Definition: Document.h:258
Boost.Filesystem compatibility.
Document(const Wrapper< xercesc::DOMDocument, Node >::base_type &base)
Copy construct a Document.
Definition: Document.h:109
Document(const Document &document)
Copy construct a Document.
Definition: Document.h:99
Document(Wrapper< xercesc::DOMDocument, Node >::element_type *document, bool managed)
Construct a Document from a xercesc::DOMDocument *.
Definition: Document.h:120
bool prettyPrint
Pretty-print (format-pretty-print).
Definition: Document.h:372
Element getDocumentElement()
Get the root element of this document.
Definition: Document.h:212
Document & operator=(const Document &wrapped)
Assign a Document.
Definition: Document.h:154
void writeNode(xercesc::DOMNode &node, const boost::filesystem::path &file, const WriteParameters ¶ms)
Write a Node to a file.
Definition: Document.cpp:293
Wrapper & operator=(const Wrapper &wrapped)
Assign a Wrapper.
Definition: Wrapper.h:208
Document()
Construct a NULL Document.
Definition: Document.h:89
xercesc::DOMNode base_element_type
Base element type (root type of the wrapped type).
Definition: Base.h:82
NodeList getElementsByTagName(const std::string &name)
Get child elements with a given tag name.
Definition: Document.h:224
Xerces string wrapper.
Definition: String.h:74
ParseParameters()
Constructor.
Definition: Document.h:261
bool xmlDeclaration
Require XML declaration (xml-declaration).
Definition: Document.h:380
bool normalizeCharacters
Normalize characters.
Definition: Document.h:370
ome::compat::shared_ptr< base_element_type > base
Wrapped reference.
Definition: Base.h:231
DOM NodeList wrapper.
Definition: NodeList.h:69
bool validationSchemaFullChecking
Do full checking during validation?
Definition: Document.h:256
Element createElementNS(const std::string &ns, const std::string &name)
Create Element with namespace.
Definition: Document.h:168
Parameters controlling DOM writing.
Definition: Document.h:245
bool splitCDATASections
Split CDATA sections (split-cdata-sections).
Definition: Document.h:374
Parameters controlling DOM writing.
Definition: Document.h:351
xercesc::XercesDOMParser::ValSchemes validationScheme
Validation scheme.
Definition: Document.h:248
Document createEmptyDocument(const std::string &qualifiedName)
Construct an empty Document.
Definition: Document.cpp:200
bool namespaceDeclarations
Include namespace declaration attributes (namespace-declarations).
Definition: Document.h:368