39 #ifndef OME_COMMON_XML_DOM_DOCUMENT_H 40 #define OME_COMMON_XML_DOM_DOCUMENT_H 42 #include <ome/common/config.h> 51 #include <boost/filesystem/path.hpp> 53 #include <xercesc/dom/DOMComment.hpp> 54 #include <xercesc/dom/DOMDocument.hpp> 55 #include <xercesc/dom/DOMNode.hpp> 56 #include <xercesc/parsers/XercesDOMParser.hpp> 60 #include <ome/common/xml/dom/Element.h> 61 #include <ome/common/xml/dom/NodeList.h> 62 #include <ome/common/xml/dom/Wrapper.h> 63 #include <ome/common/xml/EntityResolver.h> 64 #include <ome/common/xml/String.h> 171 const std::string& name)
176 return Element((*this)->createElementNS(xns, xname),
false);
190 xercesc::DOMNode *node =
dynamic_cast<xercesc::DOMNode *
>((*this)->createComment(text));
191 return Node(node,
false);
205 return Element((*this)->createElement(xname),
false);
216 return Element((*this)->getDocumentElement(),
false);
228 return (*this)->getElementsByTagName(
String(name));
264 validationScheme(xercesc::XercesDOMParser::Val_Auto),
267 handleMultipleImports(true),
268 validationSchemaFullChecking(true),
269 createEntityReferenceNodes(true)
293 const std::string& qualifiedName);
321 const std::string&
id =
"membuf");
336 const std::string&
id =
"streambuf");
386 canonicalForm(false),
389 datatypeNormalization(false),
390 discardDefaultContent(true),
393 namespaceDeclarations(true),
394 normalizeCharacters(false),
396 splitCDATASections(true),
413 const boost::filesystem::path& file,
425 std::ostream& stream,
449 const boost::filesystem::path& file,
461 std::ostream& stream,
485 const boost::filesystem::path& file,
497 std::ostream& stream,
517 #endif // OME_COMMON_XML_DOM_DOCUMENT_H bool discardDefaultContent
Discard defaults (discard-default-content).
Definition: Document.h:364
Node createComment(const std::string &comment)
Create Comment.
Definition: Document.h:186
bool comments
Retain comments (comments).
Definition: Document.h:360
bool doSchema
Use schemas?
Definition: Document.h:254
std::shared_ptr< base_element_type > base
Wrapped reference.
Definition: Base.h:253
element_type * wrapped
The wrapped type.
Definition: Wrapper.h:264
bool CDATASections
Retain CDATA (cdata-sections).
Definition: Document.h:358
Xerces DOM class wrapper.
Definition: Wrapper.h:72
bool whitespace
Retain whitespace (element-content-whitespace).
Definition: Document.h:380
DOM Node wrapper.
Definition: Node.h:70
bool doNamespaces
Use namespaces?
Definition: Document.h:252
DOM Document wrapper.
Definition: Document.h:85
DOM Element wrapper.
Definition: Element.h:67
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:378
bool canonicalForm
Canonicalize document (canonical-form).
Definition: Document.h:356
bool datatypeNormalization
Datatype normalization (datatype-normalization).
Definition: Document.h:362
Node()
Construct a NULL Node.
Definition: Node.h:79
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:366
WriteParameters()
Constructor.
Definition: Document.h:385
Element createElement(const std::string &name)
Create Element without namespace.
Definition: Document.h:201
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:136
bool namespaces
Namespace processing (namespaces).
Definition: Document.h:368
~Document()
Destructor.
Definition: Document.h:145
bool handleMultipleImports
Handle multiple imports?
Definition: Document.h:256
bool createEntityReferenceNodes
Create entity reference nodes?
Definition: Document.h:260
Boost.Filesystem compatibility.
Document(const Wrapper< xercesc::DOMDocument, Node >::base_type &base)
Copy construct a Document.
Definition: Document.h:111
Open Microscopy Environment C++.
Definition: base64.h:48
Document(const Document &document)
Copy construct a Document.
Definition: Document.h:101
Document(Wrapper< xercesc::DOMDocument, Node >::element_type *document, bool managed)
Construct a Document from a xercesc::DOMDocument *.
Definition: Document.h:122
bool prettyPrint
Pretty-print (format-pretty-print).
Definition: Document.h:374
Element getDocumentElement()
Get the root element of this document.
Definition: Document.h:214
Document & operator=(const Document &wrapped)
Assign a Document.
Definition: Document.h:156
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:91
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:226
Xerces string wrapper.
Definition: String.h:74
ParseParameters()
Constructor.
Definition: Document.h:263
bool xmlDeclaration
Require XML declaration (xml-declaration).
Definition: Document.h:382
bool normalizeCharacters
Normalize characters.
Definition: Document.h:372
DOM NodeList wrapper.
Definition: NodeList.h:69
bool validationSchemaFullChecking
Do full checking during validation?
Definition: Document.h:258
Element createElementNS(const std::string &ns, const std::string &name)
Create Element with namespace.
Definition: Document.h:170
Parameters controlling DOM writing.
Definition: Document.h:247
bool splitCDATASections
Split CDATA sections (split-cdata-sections).
Definition: Document.h:376
Parameters controlling DOM writing.
Definition: Document.h:353
xercesc::XercesDOMParser::ValSchemes validationScheme
Validation scheme.
Definition: Document.h:250
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:370