12#ifndef ARCANE_CORE_DOM_H
13#define ARCANE_CORE_DOM_H
17#include "arcane/core/DomDeclaration.h"
18#include "arcane/utils/String.h"
38extern NodePrv* toNodePrv(
const Node& node);
43typedef String DOMString;
56const UShort INDEX_SIZE_ERR = 1;
58const UShort DOMSTRING_SIZE_ERR = 2;
60const UShort HIERARCHY_REQUEST_ERR = 3;
63const UShort WRONG_DOCUMENT_ERR = 4;
68const UShort INVALID_CHARACTER_ERR = 5;
70const UShort NO_DATA_ALLOWED_ERR = 6;
73const UShort NO_MODIFICATION_ALLOWED_ERR = 7;
76const UShort NOT_FOUND_ERR = 8;
79const UShort NOT_SUPPORTED_ERR = 9;
82const UShort INUSE_ATTRIBUTE_ERR = 10;
85const UShort INVALID_STATE_ERR = 11;
87const UShort SYNTAX_ERR = 12;
89const UShort INVALID_MODIFICATION_ERR = 13;
92const UShort NAMESPACE_ERR = 14;
95const UShort INVALID_ACCESS_ERR = 15;
98const UShort NOT_IMPLEMENTED_ERR = 2500;
103class ARCANE_CORE_EXPORT DOMException
107 DOMException(UShort _code)
119class ARCANE_CORE_EXPORT DOMWriter
126 DOMWriter(DOMWriterPrv*);
127 DOMWriter(
const DOMWriter& dw);
130 const DOMWriter& operator=(
const DOMWriter& from);
135 void encoding(
const String& encoding);
141 DOMWriterPrv* _impl()
const;
143 void _checkValid()
const;
149class ARCANE_CORE_EXPORT DOMImplementation
155 bool hasFeature(
const DOMString& feature,
const DOMString& version)
const;
160 DocumentType createDocumentType(
const DOMString& qualified_name,
const DOMString& public_id,
161 const DOMString& system_id)
const;
174 DOMImplementation getInterface(
const DOMString& feature)
const;
184 DOMImplementation(ImplementationPrv*);
185 ~DOMImplementation();
197 String _implementationName()
const;
201 static void initialize();
202 static void terminate();
206 ImplementationPrv* m_p;
207 ImplementationPrv* _impl()
const;
208 void _checkValid()
const;
214ARCANE_CORE_EXPORT
bool operator==(
const Node& n1,
const Node& n2);
215ARCANE_CORE_EXPORT
bool operator!=(
const Node& n1,
const Node& n2);
222class ARCANE_CORE_EXPORT Node
261 DOMString nodeName()
const;
266 DOMString nodeValue()
const;
267 void nodeValue(
const DOMString& value)
const;
272 UShort nodeType()
const;
277 Node parentNode()
const;
287 Node firstChild()
const;
292 Node lastChild()
const;
297 Node previousSibling()
const;
302 Node nextSibling()
const;
307 NamedNodeMap attributes()
const;
317 Node insertBefore(
const Node& new_child,
const Node& ref_child)
const;
318 Node replaceChild(
const Node& new_child,
const Node& old_child)
const;
319 Node removeChild(
const Node& old_child)
const;
320 Node appendChild(
const Node& new_child)
const;
321 bool hasChildNodes()
const;
322 Node cloneNode(
bool deep)
const;
327 DOMString prefix()
const;
328 void prefix(
const DOMString& new_prefix)
const;
333 void normalize()
const;
334 bool isSupported(
const DOMString& feature,
const DOMString& version)
const;
335 DOMString namespaceURI()
const;
337 DOMString localName()
const;
374 DOMString textContent()
const;
375 void textContent(
const DOMString& value)
const;
380 DOMString baseURI()
const;
385 bool isSameNode(
const Node& node)
const;
386 UShort compareTreePosition(
const Node& other)
const;
387 bool isEqualNode(
const Node& other)
const;
388 Node getInterface(
const DOMString& feature)
const;
389 DOMString lookupNamespacePrefix(
const DOMString& namespace_uri,
bool use_default)
const;
390 bool isDefaultNamespace(
const DOMString& namespace_uri)
const;
391 DOMString lookupNamespaceURI(
const DOMString& prefix)
const;
393 DOMObject setUserData(
const DOMString& key,
const DOMObject& data,
395 DOMObject getUserData(
const DOMString& key)
const;
416 friend class IDOM_Node;
417 friend class IDOM_Document;
419 friend class Element;
421 friend class DOMImplementation;
422 friend class NamedNodeMap;
423 friend class CharacterData;
425 friend class DOMWriter;
426 friend bool ARCANE_CORE_EXPORT operator==(
const Node& n1,
const Node& n2);
432 void _assign(
const Node&);
439 const Node& operator=(
const Node& from);
447 void _checkValid()
const;
451 NodePrv* _impl()
const;
452 friend NodePrv* toNodePrv(
const Node& node);
462class ARCANE_CORE_EXPORT Document
474 DOMImplementation implementation()
const;
479 Element documentElement()
const;
484 Element createElement(
const DOMString& tag_name)
const;
486 Text createTextNode(
const DOMString& data)
const;
487 Comment createComment(
const DOMString& data)
const;
488 CDATASection createCDATASection(
const DOMString& data)
const;
490 const DOMString& data)
const;
491 Attr createAttribute(
const DOMString& name)
const;
493 NodeList getElementsByTagName(
const DOMString& tagname)
const;
498 Node importNode(
const Node& imported_node,
bool deep)
const;
499 Element createElementNS(
const DOMString& namespace_uri,
const DOMString& qualified_name)
const;
500 Attr createAttributeNS(
const DOMString& namespace_uri,
const DOMString& qualified_name)
const;
501 NodeList getElementsByTagNameNS(
const DOMString& namespace_uri,
const DOMString& local_name)
const;
502 Element getElementById(
const DOMString& element_id)
const;
507 DOMString actualEncoding()
const;
508 void actualEncoding(
const DOMString&)
const;
513 DOMString encoding()
const;
514 void encoding(
const DOMString&)
const;
519 bool standalone()
const;
520 void standalone(
bool)
const;
525 bool strictErrorChecking()
const;
526 void strictErrorChecking(
bool)
const;
531 DOMString version()
const;
532 void version(
const DOMString&)
const;
543 DOMString documentURI()
const;
544 void documentURI(
const DOMString&)
const;
549 Node adoptNode(
const Node& source)
const;
550 void normalizeDocument();
555 Node renameNode(
const Node& node,
const DOMString& namespace_uri,
556 const DOMString& name);
561 friend class IDOM_Document;
562 friend class DOMImplementation;
572 DocumentPrv* _impl()
const;
575class ARCANE_CORE_EXPORT DocumentFragment
581 DocumentFragment(DocumentFragmentPrv*);
591class ARCANE_CORE_EXPORT NodeList
597 Node item(ULong index)
const;
598 ULong length()
const;
603 NodeList(NodeListPrv*);
607 NodeListPrv* _impl()
const;
609 void _checkValid()
const;
619class ARCANE_CORE_EXPORT CharacterData
626 DOMString data()
const;
627 void data(
const DOMString&)
const;
632 ULong length()
const;
637 DOMString substringData(ULong offset, ULong count)
const;
638 void appendData(
const DOMString& arg)
const;
639 void insertData(ULong offset,
const DOMString& arg)
const;
640 void deleteData(ULong offset, ULong count)
const;
641 void replaceData(ULong offset, ULong count,
const DOMString& arg)
const;
646 CharacterData(
const Node& from);
647 CharacterData(
const CharacterData& from);
648 CharacterData(CharacterDataPrv*);
649 CharacterDataPrv* _impl()
const;
652class ARCANE_CORE_EXPORT Attr
659 DOMString name()
const;
664 bool specified()
const;
669 DOMString value()
const;
670 void value(
const DOMString& str)
const;
675 Element ownerElement()
const;
680 friend class IDOM_Attr;
681 friend class IDOM_Node;
682 friend class Element;
692 AttrPrv* _impl()
const;
698class ARCANE_CORE_EXPORT Element
705 DOMString tagName()
const;
710 DOMString getAttribute(
const DOMString& name)
const;
711 void setAttribute(
const DOMString& name,
const DOMString& value)
const;
712 void removeAttribute(
const DOMString& name)
const;
713 Attr getAttributeNode(
const DOMString& name)
const;
714 Attr setAttributeNode(
const Attr& new_attr)
const;
715 Attr removeAttributeNode(
const Attr& old_attr)
const;
716 NodeList getElementsByTagName(
const DOMString& name)
const;
719 DOMString getAttributeNS(
const DOMString& namespace_uri,
const DOMString& local_name)
const;
720 void setAttributeNS(
const DOMString& namespace_uri,
const DOMString& qualified_name,
721 const DOMString& value)
const;
722 void removeAttributeNS(
const DOMString& namespace_uri,
const DOMString& local_name)
const;
723 Attr getAttributeNodeNS(
const DOMString& namespace_uri,
const DOMString& local_name)
const;
724 Attr setAttributeNodeNS(
const Attr& new_attr)
const;
725 NodeList getElementsByTagNameNS(
const DOMString& namespace_uri,
const DOMString& local_name)
const;
726 bool hasAttribute(
const DOMString& name)
const;
727 bool hasAttributeNS(
const DOMString& namespace_uri,
const DOMString& local_name)
const;
732 Element(
const Element&);
733 Element(
const Node&);
737 Element(ElementPrv*);
738 friend class IDOM_Element;
741 ElementPrv* _impl()
const;
747class ARCANE_CORE_EXPORT Text
748:
public CharacterData
754 Text splitText(ULong offset)
const;
758 bool isWhiteSpaceInElementContent()
const;
762 DOMString wholeText()
const;
766 Text replaceWholeText(
const DOMString& content)
const;
774 TextPrv* _impl()
const;
781class ARCANE_CORE_EXPORT Comment
782:
public CharacterData
787 Comment(CommentPrv*);
791 CommentPrv* _impl()
const;
794class ARCANE_CORE_EXPORT CDATASection
800 CDATASection(CDATASectionPrv*);
804 CDATASectionPrv* _impl()
const;
814 DOMString name()
const;
819 NamedNodeMap entities()
const;
824 NamedNodeMap notations()
const;
828 DOMString publicId()
const;
833 DOMString systemId()
const;
838 DOMString internalSubset()
const;
842 DocumentType(DocumentTypePrv*);
848 DocumentTypePrv* _impl()
const;
861 DOMString publicId()
const;
866 DOMString systemId()
const;
870 NotationPrv* _impl()
const;
883 DOMString publicId()
const;
888 DOMString systemId()
const;
893 DOMString notationName()
const;
897 DOMString actualEncoding()
const;
898 void actualEncoding(
const DOMString&)
const;
903 DOMString encoding()
const;
904 void encoding(
const DOMString&)
const;
909 DOMString version()
const;
910 void version(
const DOMString&)
const;
914 EntityPrv* _impl()
const;
926 EntityReference(EntityReferencePrv*);
930 EntityReferencePrv* _impl()
const;
936class ARCANE_CORE_EXPORT ProcessingInstruction
943 DOMString target()
const;
948 DOMString data()
const;
949 void data(
const DOMString& value)
const;
953 ProcessingInstruction();
954 ProcessingInstruction(ProcessingInstructionPrv*);
958 ProcessingInstructionPrv* _impl()
const;
964class ARCANE_CORE_EXPORT NamedNodeMap
970 ULong length()
const;
974 Node getNamedItem(
const DOMString& name)
const;
975 Node setNamedItem(
const Node& arg)
const;
976 Node removeNamedItem(
const DOMString& name)
const;
977 Node item(ULong index)
const;
981 Node getNamedItemNS(
const DOMString& namespace_uri,
const DOMString& local_name)
const;
982 Node setNamedItemNS(
const Node& arg)
const;
983 Node removeNamedItemNS(
const DOMString& namespace_uri,
const DOMString& local_name)
const;
991 friend class IDOM_Node;
992 friend class IDOM_Element;
994 NamedNodeMap(NamedNodeMapPrv*);
996 NamedNodeMap(
const NamedNodeMap& from);
997 const NamedNodeMap& operator=(
const NamedNodeMap& from);
1002 NamedNodeMapPrv* m_p;
1003 NamedNodeMapPrv* _impl()
const;
1033 void handle(UShort operation,
const DOMString& key,
const DOMObject& data,
1034 const Node& src,
const Node& dest)
const;
1056 UShort severity()
const;
1061 DOMString message()
const;
1066 DOMObject relatedException()
const;
1076 DOMError(DOMErrorPrv*);
1078 DOMError(
const DOMError& from);
1079 const DOMError& operator=(
const DOMError& from);
1084 DOMErrorPrv* _impl()
const;
1086 void _checkValid()
const;
1098 bool handleError(
const DOMError& error)
const;
1111 long lineNumber()
const;
1115 long columnNumber()
const;
1119 long offset()
const;
1123 Node errorNode()
const;
1127 DOMString uri()
const;
1131 friend class DOMError;
1133 DOMLocator(DOMLocatorPrv*);
1135 DOMLocator(
const DOMLocator& from);
1136 const DOMLocator& operator=(
const DOMLocator& from);
1141 DOMLocatorPrv* _impl()
const;
1143 void _checkValid()
const;
1158const unsigned short INVALID_EXPRESSION_ERR = 1;
1163const unsigned short TYPE_ERR = 2;
1173 unsigned short code;
1188 const Node& context_node,
1194 const Node& context_node,
1213 DOMString lookupNamespaceURI(
const DOMString& prefix)
const;
1258 UShort resultType()
const;
1263 double numberValue()
const;
1268 DOMString stringValue()
const;
1273 bool booleanValue()
const;
1278 Node singleNodeValue()
const;
1295 Node nextNode()
const;
1304 ULong length()
const;
1309 Node item(ULong index)
const;
1329 Element ownerElement()
const;
Manager of a DOM document.
Unicode character string.
static const UShort SEVERITY_ERROR
The severity of the error described by the DOMError is error.
static const UShort SEVERITY_WARNING
The severity of the error described by the DOMError is warning.
static const UShort SEVERITY_FATAL_ERROR
The severity of the error described by the DOMError is fatal error.
UShort code
The code of the exception.
Document createDocument(const DOMString &namespace_uri, const DOMString &qualified_name, const DocumentType &doctype) const
IXmlDocumentHolder * _load(const String &fname, ITraceMng *msg, const String &schemaname)
IXmlDocumentHolder * _newDocument()
The following methods are internal to Arcane.
friend class Document
GenericDocument with UTF8 encoding.
NodePrv * m_p
Class implementation.
static const UShort DOCUMENT_FRAGMENT_NODE
The node is a DocumentFragment.
static const UShort TREE_POSITION_PRECEDING
The node precedes the reference node.
static const UShort TREE_POSITION_ANCESTOR
The node is an ancestor of the reference node.
static const UShort ATTRIBUTE_NODE
The node is an Attr.
static const UShort ENTITY_REFERENCE_NODE
The node is an EntityReference.
static const UShort COMMENT_NODE
The node is a Comment.
static const UShort TREE_POSITION_SAME
void releaseNode()
Destroys the node.
static const UShort TREE_POSITION_DISCONNECTED
The two nodes are disconnected, they do not have any common ancestor.
static const UShort TREE_POSITION_DESCENDANT
The node is a descendant of the reference node.
friend class Document
GenericDocument with UTF8 encoding.
static const UShort DOCUMENT_TYPE_NODE
The node is a DocumentType.
static const UShort TREE_POSITION_FOLLOWING
The node follows the reference node.
static const UShort ENTITY_NODE
The node is an Entity.
static const UShort DOCUMENT_NODE
The node is a Document.
static const UShort CDATA_SECTION_NODE
The node is a CDATASection.
static const UShort TREE_POSITION_EXACT_SAME
static const UShort PROCESSING_INSTRUCTION_NODE
The node is a ProcessingInstruction.
static const UShort ELEMENT_NODE
The node is an Element.
static const UShort TEXT_NODE
The node is a Text node.
static const UShort NOTATION_NODE
The node is a Notation.
friend class Document
GenericDocument with UTF8 encoding.
static const UShort IMPORTED
The node is imported.
static const UShort CLONED
The node is cloned.
static const UShort DELETED
The node is deleted.
static const UShort XPATH_NAMESPACE_NODE
The node is a Namespace.
static const UShort NUMBER_TYPE
The result is a number as defined by XPath 1.0.
static const UShort SINGLE_NODE_TYPE
static const UShort STRING_TYPE
The result is a string as defined by XPath 1.0.
static const UShort ANY_TYPE
static const UShort BOOLEAN_TYPE
The result is a boolean as defined by XPath 1.0.
static const UShort NODE_SET_TYPE
The result is a node set as defined by XPath 1.0.
GenericDocument< UTF8<> > Document
GenericDocument with UTF8 encoding.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Array< Byte > ByteArray
Dynamic one-dimensional array of characters.
UniqueArray< Byte > ByteUniqueArray
Dynamic 1D array of characters.
ConstArrayView< Byte > ByteConstArrayView
C equivalent of a 1D array of characters.