Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
Dom.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* Dom.h (C) 2000-2018 */
9/* */
10/* Implémentation d'un DOM1+DOM2+DOM3(core). */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_DOM_H
13#define ARCANE_DOM_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/DomDeclaration.h"
18#include "arcane/utils/String.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23ARCANE_BEGIN_NAMESPACE
24class IStringImpl;
25class IXmlDocumentHolder;
26ARCANE_END_NAMESPACE
27
28ARCANE_BEGIN_NAMESPACE
29ARCANE_BEGIN_NAMESPACE_DOM
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
37extern NodePrv* toNodePrv(const Node& node);
38
39/*---------------------------------------------------------------------------*/
40/*---------------------------------------------------------------------------*/
41
42typedef String DOMString;
43
44/*---------------------------------------------------------------------------*/
45/*---------------------------------------------------------------------------*/
46
47/*! @name ExceptionCode
48 An integer indicating the type of error generated.
49 \note Other numeric codes are reserved for W3C for possible future
50 use.
51 \relate DOMException
52*/
53//@{
54/*! If index or size is negative, or greater than the allowed value */
55const UShort INDEX_SIZE_ERR = 1;
56/*! If the specified range of text does not fit into a DOMString */
57const UShort DOMSTRING_SIZE_ERR = 2;
58//! If any node is inserted somewhere it doesn't belong
59const UShort HIERARCHY_REQUEST_ERR = 3;
60/*! If a node is used in a different document than the one that
61 created it (that doesn't support it) */
62const UShort WRONG_DOCUMENT_ERR = 4;
63/*! If an invalid or illegal character is specified, such as in a
64 name. See production 2 in the XML specification for the definition of
65 a legal character, and production 5 for the definition of a legal name
66 character. */
67const UShort INVALID_CHARACTER_ERR = 5;
68//! If data is specified for a node which does not support data
69const UShort NO_DATA_ALLOWED_ERR = 6;
70/*! If an attempt is made to modify an object where modifications are
71 not allowed */
73/*! If an attempt is made to reference a node in a context where it
74 does not exist */
75const UShort NOT_FOUND_ERR = 8;
76/*! If the implementation does not support the requested type of
77 object or operation */
78const UShort NOT_SUPPORTED_ERR = 9;
79/*! If an attempt is made to add an attribute that is already in use
80 elsewhere */
81const UShort INUSE_ATTRIBUTE_ERR = 10;
82/*! If an attempt is made to use an object that is not, or is no
83 longer, usable */
84const UShort INVALID_STATE_ERR = 11;
85/*! If an invalid or illegal string is specified */
86const UShort SYNTAX_ERR = 12;
87/*! If an attempt is made to modify the type of the underlying object */
88const UShort INVALID_MODIFICATION_ERR = 13;
89/*! If an attempt is made to create or change an object in a way which
90 is incorrect with regard to namespaces */
91const UShort NAMESPACE_ERR = 14;
92/*! If a parameter or an operation is not supported by the underlying
93 object */
94const UShort INVALID_ACCESS_ERR = 15;
95//@}
96
97const UShort NOT_IMPLEMENTED_ERR = 2500;
98
99/*---------------------------------------------------------------------------*/
100/*---------------------------------------------------------------------------*/
101
102class ARCANE_CORE_EXPORT DOMException
103{
104 public:
105 DOMException(UShort _code) : code(_code) {}
106 public:
107 UShort code; //!< The code of the exception
108};
109
110/*---------------------------------------------------------------------------*/
111/*---------------------------------------------------------------------------*/
112
113class ARCANE_CORE_EXPORT DOMWriter
114{
115 public:
116 /*! @name Constructors and Destructors */
117 //@{
118 DOMWriter();
119 DOMWriter(DOMWriterPrv*);
120 DOMWriter(const DOMWriter& dw);
121 ~DOMWriter();
122 //@}
123 const DOMWriter& operator=(const DOMWriter& from);
124 public:
125 ByteUniqueArray writeNode(const Node& node) const;
126 void encoding(const String& encoding);
127 String encoding() const;
128 private:
129 DOMWriterPrv* m_p;
130 DOMWriterPrv* _impl() const;
131 bool _null() const;
132 void _checkValid() const;
133};
134
135/*---------------------------------------------------------------------------*/
136/*---------------------------------------------------------------------------*/
137
138class ARCANE_CORE_EXPORT DOMImplementation
139{
140 public:
141
142 /*! @name DOM Level 1 operations */
143 //@{
144 bool hasFeature(const DOMString& feature,const DOMString& version) const;
145 //@}
146
147 /*! @name DOM Level 2 operations */
148 //@{
149 DocumentType createDocumentType(const DOMString& qualified_name,const DOMString& public_id,
150 const DOMString& system_id) const;
151
152 private:
153 Document createDocument(const DOMString& namespace_uri,const DOMString& qualified_name,
154 const DocumentType& doctype) const;
155 public:
156 //@}
157
158 /*! @name DOM Level 3 operations */
159 //@{
160 DOMImplementation getInterface(const DOMString& feature) const;
161 //@}
162
163 DOMWriter createDOMWriter() const;
164
165 public:
166 /*! @name Constructors and Destructors */
167 //@{
169 DOMImplementation(ImplementationPrv*);
171 //@}
172
173 public:
174 //! Les méthodes suivantes sont internes à Arcane.
175 //@{
176 IXmlDocumentHolder* _newDocument();
177 IXmlDocumentHolder* _load(const String& fname,ITraceMng* msg,const String& schemaname);
178 IXmlDocumentHolder* _load(const String& fname,ITraceMng* msg,const String& schemaname, ByteConstArrayView schema_data);
179 IXmlDocumentHolder* _load(ByteConstSpan buffer,const String& name,ITraceMng* trace);
180 void _save(ByteArray& bytes,const Document& document,int indent_level);
181 String _implementationName() const;
182 //@}
183 public:
184 static void initialize();
185 static void terminate();
186 private:
187 ImplementationPrv* m_p;
188 ImplementationPrv* _impl() const;
189 void _checkValid() const;
190};
191
192/*---------------------------------------------------------------------------*/
193/*---------------------------------------------------------------------------*/
194
195ARCANE_CORE_EXPORT bool operator==(const Node& n1,const Node& n2);
196ARCANE_CORE_EXPORT bool operator!=(const Node& n1,const Node& n2);
197//class NodePrv;
198
199/*!
200 * \internal
201 * \ingroup Xml
202 */
203class ARCANE_CORE_EXPORT Node
204{
205 public:
206
207 /*! @name NodeType
208 An integer indicating which type of node this is.
209 \note Numeric codes up to 200 are reserved to W3C for possible future use.
210 */
211 //@{
212 //! The node is an Element
213 static const UShort ELEMENT_NODE = 1;
214 //! The node is an Attr
215 static const UShort ATTRIBUTE_NODE = 2;
216 //! The node is a Text node
217 static const UShort TEXT_NODE = 3;
218 //! The node is a CDATASection
219 static const UShort CDATA_SECTION_NODE = 4;
220 //! The node is an EntityReference
221 static const UShort ENTITY_REFERENCE_NODE = 5;
222 //! The node is an Entity
223 static const UShort ENTITY_NODE = 6;
224 //! The node is a ProcessingInstruction
225 static const UShort PROCESSING_INSTRUCTION_NODE = 7;
226 //! The node is a Comment
227 static const UShort COMMENT_NODE = 8;
228 //! The node is a Document
229 static const UShort DOCUMENT_NODE = 9;
230 //! The node is a DocumentType
231 static const UShort DOCUMENT_TYPE_NODE = 10;
232 //! The node is a DocumentFragment
233 static const UShort DOCUMENT_FRAGMENT_NODE = 11;
234 //! The node is a Notation
235 static const UShort NOTATION_NODE = 12;
236 //@}
237
238 public:
239
240 /*! @name Attribute nodeName (DOM Level 1) */
241 //@{
242 DOMString nodeName() const;
243 //@}
244
245 /*! @name Attribute nodeValue (DOM Level 1) */
246 //@{
247 DOMString nodeValue() const;
248 void nodeValue(const DOMString& value) const;
249 //@}
250
251 /*! @name Attribute nodeType (DOM Level 1) */
252 //@{
253 UShort nodeType() const;
254 //@}
255
256 /*! @name Attribute parentNode (DOM Level 1) */
257 //@{
258 Node parentNode() const;
259 //@}
260
261 /*! @name Attribute childNodes (DOM Level 1) */
262 //@{
263 NodeList childNodes() const;
264 //@}
265
266 /*! @name Attribute firstChild() (DOM Level 1) */
267 //@{
268 Node firstChild() const;
269 //@}
270
271 /*! @name Attribute lastChild() (DOM Level 1) */
272 //@{
273 Node lastChild() const;
274 //@}
275
276 /*! @name Attribute previousSibling() (DOM Level 1) */
277 //@{
278 Node previousSibling() const;
279 //@}
280
281 /*! @name Attribute nextSibling() (DOM Level 1) */
282 //@{
283 Node nextSibling() const;
284 //@}
285
286 /*! @name Attribute attributes() (DOM Level 1) */
287 //@{
288 NamedNodeMap attributes() const;
289 //@}
290
291 /*! @name Attribute ownerDocument() (DOM Level 2) */
292 //@{
293 Document ownerDocument() const;
294 //@}
295
296 /*! @name DOM Level 1 operations */
297 //@{
298 Node insertBefore(const Node& new_child,const Node& ref_child) const;
299 Node replaceChild(const Node& new_child,const Node& old_child) const;
300 Node removeChild(const Node& old_child) const;
301 Node appendChild(const Node& new_child) const;
302 bool hasChildNodes() const;
303 Node cloneNode(bool deep) const;
304 //@}
305
306 /*! @name Attribute prefix() (DOM Level 2). */
307 //@{
308 DOMString prefix() const;
309 void prefix(const DOMString& new_prefix) const;
310 //@}
311
312 /*! @name DOM Level 2 operations */
313 //@{
314 void normalize() const;
315 bool isSupported(const DOMString& feature,const DOMString& version) const;
316 DOMString namespaceURI() const;
317
318 DOMString localName() const;
319 //@}
320
321 /*! @name TreePosition
322 A bitmask indicating the relative tree position of a node with
323 respect to another node.
324
325 Issue TreePosition-1:
326 Should we use fewer bits?
327
328 Issue TreePosition-2:
329 How does a node compare to itself?
330 */
331 //@{
332 //! The node precedes the reference node
333 static const UShort TREE_POSITION_PRECEDING = 0x01;
334 //! The node follows the reference node
335 static const UShort TREE_POSITION_FOLLOWING = 0x02;
336 //! The node is an ancestor of the reference node
337 static const UShort TREE_POSITION_ANCESTOR = 0x04;
338 //! The node is a descendant of the reference node
339 static const UShort TREE_POSITION_DESCENDANT = 0x08;
340 /*! The two nodes have the same position. This is the case of two
341 attributes that have the same ownerElement() */
342 static const UShort TREE_POSITION_SAME = 0x10;
343 /*! The two nodes have the exact same position. This is never the
344 case of two attributes, even when they have the same
345 ownerElement. Two nodes that have the exact same position have the
346 same position, though the reverse may not be true.
347 */
348 static const UShort TREE_POSITION_EXACT_SAME = 0x20;
349 //! The two nodes are disconnected, they do not have any common ancestor
350 static const UShort TREE_POSITION_DISCONNECTED = 0x00;
351 //@}
352
353 /*! @name Attribute textContent() (DOM Level 3) */
354 //@{
355 DOMString textContent() const;
356 void textContent(const DOMString& value) const;
357 //@}
358
359 /*! @name Attribute baseURI() (DOM Level 3) */
360 //@{
361 DOMString baseURI() const;
362 //@}
363
364
365 /*! @name DOM Level 3 operations */
366 //@{
367 bool isSameNode(const Node& node) const;
368 UShort compareTreePosition(const Node& other) const;
369 bool isEqualNode(const Node& other) const;
370 Node getInterface(const DOMString& feature) const;
371 DOMString lookupNamespacePrefix(const DOMString& namespace_uri,bool use_default) const;
372 bool isDefaultNamespace(const DOMString& namespace_uri) const;
373 DOMString lookupNamespaceURI(const DOMString& prefix) const;
374 //void normalizeNS() const;
375 DOMObject setUserData(const DOMString& key,const DOMObject& data,
376 const UserDataHandler& handler) const;
377 DOMObject getUserData(const DOMString& key) const;
378 //@}
379
380 /*!
381 * \brief Détruit le noeud.
382 *
383 * Le noeud ne doit pas appartenir à un document.
384 *
385 * Le noeud ne doit plus être utilisé par la suite.
386 *
387 * Cette méthode ne fait pas partie du DOM mais est nécessaire pour
388 * certaines implémentation pour supprimer la mémoire associée à un noeud.
389 */
390 void releaseNode();
391
392 public:
393
394 bool _null() const;
395
396 public:
397
398 friend class IDOM_Node;
399 friend class IDOM_Document;
400 friend class Attr;
401 friend class Element;
402 friend class Document;
403 friend class DOMImplementation;
404 friend class NamedNodeMap;
405 friend class CharacterData;
406 friend class Text;
407 friend class DOMWriter;
408 friend bool ARCANE_CORE_EXPORT operator==(const Node& n1,const Node& n2);
409
410 protected:
411
412 NodePrv* m_p; //!< Implémentation de la classe.
413 //void* m_p;
414 void _assign(const Node&);
415
416 public:
417 Node();
418 Node(const Node&);
419 virtual ~Node();
420 const Node& operator=(const Node& from);
421 public:
422 Node(NodePrv*);
423 protected:
424 void _checkValid() const;
425 protected:
426 NodePrv* _impl() const;
427 friend NodePrv* toNodePrv(const Node& node);
428};
429
430/*---------------------------------------------------------------------------*/
431/*---------------------------------------------------------------------------*/
432
433/*!
434 * \internal
435 * \ingroup Xml
436 */
437class ARCANE_CORE_EXPORT Document
438: public Node
439{
440 public:
441
442 /*! @name Attribute doctype() (DOM Level 1) */
443 //@{
444 DocumentType doctype() const;
445 //@}
446
447 /*! @name Attribute implementation() (DOM Level 1) */
448 //@{
449 DOMImplementation implementation() const;
450 //@}
451
452 /*! @name Attribute documentElement() (DOM Level 1) */
453 //@{
454 Element documentElement() const;
455 //@}
456
457 //! @name DOM Level 1 operations
458 //@{
459 Element createElement(const DOMString& tag_name) const;
460 DocumentFragment createDocumentFragment() const;
461 Text createTextNode(const DOMString& data) const;
462 Comment createComment(const DOMString& data) const;
463 CDATASection createCDATASection(const DOMString& data) const;
464 ProcessingInstruction createProcessingInstruction(const DOMString& target,
465 const DOMString& data) const;
466 Attr createAttribute(const DOMString& name) const;
467 EntityReference createEntityReference(const DOMString& name) const;
468 NodeList getElementsByTagName(const DOMString& tagname) const;
469 //@}
470
471 //! @name DOM Level 2 operations
472 //@{
473 Node importNode(const Node& imported_node,bool deep) const;
474 Element createElementNS(const DOMString& namespace_uri,const DOMString& qualified_name) const;
475 Attr createAttributeNS(const DOMString& namespace_uri,const DOMString& qualified_name) const;
476 NodeList getElementsByTagNameNS(const DOMString& namespace_uri,const DOMString& local_name) const;
477 Element getElementById(const DOMString& element_id) const;
478 //@}
479
480 /*! @name Attribute actualEncoding() (DOM Level 3) */
481 //@{
482 DOMString actualEncoding() const;
483 void actualEncoding(const DOMString&) const;
484 //@}
485
486 /*! @name Attribute encoding() (DOM Level 3) */
487 //@{
488 DOMString encoding() const;
489 void encoding(const DOMString&) const;
490 //@}
491
492 /*! @name Attribute standalone() (DOM Level 3) */
493 //@{
494 bool standalone() const;
495 void standalone(bool) const;
496 //@}
497
498 /*! @name Attribute strictErrorChecking() (DOM Level 3) */
499 //@{
500 bool strictErrorChecking() const;
501 void strictErrorChecking(bool) const;
502 //@}
503
504 /*! @name version() (DOM Level 3) */
505 //@{
506 DOMString version() const;
507 void version(const DOMString&) const;
508 //@}
509
510 /*! @name Attribute errorHandler() (DOM Level 3) */
511 //@{
512 DOMErrorHandler errorHandler() const;
513 void errorHandler(const DOMErrorHandler&) const;
514 //@}
515
516 /*! @name Attribute documentURI() (DOM Level 3) */
517 //@{
518 DOMString documentURI() const;
519 void documentURI(const DOMString&) const;
520 //@}
521
522 //! @name DOM Level 3 operations
523 //@{
524 Node adoptNode(const Node& source) const;
525 void normalizeDocument();
526 /*
527 void setNormalizationFeature(const DOMString& name,bool state);
528 bool getNormalizationFeature(const DOMString& name) const;
529 */
530 Node renameNode(const Node& node,const DOMString& namespace_uri,
531 const DOMString& name);
532 //@}
533
534 public:
535 friend class IDOM_Document;
536 friend class DOMImplementation;
537 public:
538 Document();
539 Document(const Node&);
540 Document(DocumentPrv*);
541 private:
542 DocumentPrv* _impl() const;
543};
544
545class ARCANE_CORE_EXPORT DocumentFragment
546: public Node
547{
548 public:
550 DocumentFragment(DocumentFragmentPrv*);
551};
552
553/*---------------------------------------------------------------------------*/
554/*---------------------------------------------------------------------------*/
555
556/*!
557 * \internal
558 * \ingroup Xml
559 */
560class ARCANE_CORE_EXPORT NodeList
561{
562 public:
563 //! @name DOM Level 1 operations
564 //@{
565 Node item(ULong index) const;
566 ULong length() const;
567 //@}
568 public:
569 NodeList();
570 NodeList(NodeListPrv*);
571 private:
572 NodeListPrv* _impl() const;
573 NodeListPrv* m_p;
574 void _checkValid() const;
575};
576
577/*---------------------------------------------------------------------------*/
578/*---------------------------------------------------------------------------*/
579
580/*!
581 * \internal
582 * \ingroup Xml
583 */
584class ARCANE_CORE_EXPORT CharacterData
585: public Node
586{
587 public:
588 /*! @name Attribute data (DOM Level 1) */
589 //@{
590 DOMString data() const;
591 void data(const DOMString&) const;
592 //@}
593
594 /*! @name Attribute length (DOM Level 1) */
595 //@{
596 ULong length() const;
597 //@}
598
599 //! @name DOM Level 1 operations
600 //@{
601 DOMString substringData(ULong offset,ULong count) const;
602 void appendData(const DOMString& arg) const;
603 void insertData(ULong offset,const DOMString& arg) const;
604 void deleteData(ULong offset,ULong count) const;
605 void replaceData(ULong offset,ULong count,const DOMString& arg) const;
606 //@}
607 protected:
609 CharacterData(const Node& from);
610 CharacterData(const CharacterData& from);
611 CharacterData(CharacterDataPrv*);
612 CharacterDataPrv* _impl() const;
613};
614
615class ARCANE_CORE_EXPORT Attr
616: public Node
617{
618 public:
619 /*! @name Attribute name (DOM Level 1) */
620 //@{
621 DOMString name() const;
622 //@}
623
624 /*! @name Attribute specified (DOM Level 1) */
625 //@{
626 bool specified() const;
627 //@}
628
629 /*! @name Attribute value (DOM Level 1) */
630 //@{
631 DOMString value() const;
632 void value(const DOMString& str) const;
633 //@}
634
635 /*! @name Attribute ownerElement (DOM Level 2) */
636 //@{
637 Element ownerElement() const;
638 //@}
639
640 public:
641 friend class IDOM_Attr;
642 friend class IDOM_Node;
643 friend class Element;
644 public:
645 Attr();
646 Attr(const Node&);
647 Attr(const Attr&);
648 ~Attr();
649 Attr(AttrPrv*);
650 private:
651 AttrPrv* _impl() const;
652};
653
654/*---------------------------------------------------------------------------*/
655/*---------------------------------------------------------------------------*/
656
657class ARCANE_CORE_EXPORT Element
658: public Node
659{
660 public:
661
662 /*! @name Attribut tagName (DOM Level 1) */
663 //@{
664 DOMString tagName() const;
665 //@}
666
667 /*! @name DOM Level 1 operations */
668 //@{
669 DOMString getAttribute(const DOMString& name) const;
670 void setAttribute(const DOMString& name,const DOMString& value) const;
671 void removeAttribute(const DOMString& name) const;
672 Attr getAttributeNode(const DOMString& name) const;
673 Attr setAttributeNode(const Attr& new_attr) const;
674 Attr removeAttributeNode(const Attr& old_attr) const;
675 NodeList getElementsByTagName(const DOMString& name) const;
676 //@}
677 //@{ @name DOM Level 2 operations
678 DOMString getAttributeNS(const DOMString& namespace_uri,const DOMString& local_name) const;
679 void setAttributeNS(const DOMString& namespace_uri,const DOMString& qualified_name,
680 const DOMString& value) const;
681 void removeAttributeNS(const DOMString& namespace_uri,const DOMString& local_name) const;
682 Attr getAttributeNodeNS(const DOMString& namespace_uri,const DOMString& local_name) const;
683 Attr setAttributeNodeNS(const Attr& new_attr) const;
684 NodeList getElementsByTagNameNS(const DOMString& namespace_uri,const DOMString& local_name) const;
685 bool hasAttribute(const DOMString& name) const;
686 bool hasAttributeNS(const DOMString& namespace_uri,const DOMString& local_name) const;
687 //@}
688 public:
689 Element();
690 Element(const Element&);
691 Element(const Node&);
692 private:
693 Element(ElementPrv*);
694 friend class IDOM_Element;
695 friend class Attr;
696 friend class Document;
697 ElementPrv* _impl() const;
698};
699
700/*---------------------------------------------------------------------------*/
701/*---------------------------------------------------------------------------*/
702
703class ARCANE_CORE_EXPORT Text
704: public CharacterData
705{
706 public:
707 /*! @name DOM Level 1 operations */
708 //@{
709 Text splitText(ULong offset) const;
710 //@}
711 /*! @name Attribute isWhiteSpaceInElementContent (DOM Level 3) */
712 //@{
713 bool isWhiteSpaceInElementContent() const;
714 //@}
715 /*! @name Attribute wholeText() (DOM Level 3) */
716 //@{
717 DOMString wholeText() const;
718 //@}
719 /*! @name DOM Level 3 operations */
720 //@{
721 Text replaceWholeText(const DOMString& content) const;
722 //@}
723 public:
724 Text();
725 Text(const Text&);
726 Text(const Node&);
727 Text(TextPrv*);
728 TextPrv* _impl() const;
729 friend class Document;
730};
731
732/*---------------------------------------------------------------------------*/
733/*---------------------------------------------------------------------------*/
734
735class ARCANE_CORE_EXPORT Comment
736: public CharacterData
737{
738 public:
739 Comment();
740 Comment(CommentPrv*);
741 private:
742 CommentPrv* _impl() const;
743};
744
745class ARCANE_CORE_EXPORT CDATASection
746: public Text
747{
748 public:
749 CDATASection();
750 CDATASection(CDATASectionPrv*);
751 private:
752 CDATASectionPrv* _impl() const;
753};
754
756: public Node
757{
758 public:
759 /*! @name Attribute name() (DOM Level 1) */
760 //@{
761 DOMString name() const;
762 //@}
763
764 /*! @name Attribute entities() (DOM Level 1) */
765 //@{
766 NamedNodeMap entities() const;
767 //@}
768
769 /*! @name Attribute notations() (DOM Level 1) */
770 //@{
771 NamedNodeMap notations() const;
772 //@}
773 /*! @name Attribute publicId() (DOM Level 2) */
774 //@{
775 DOMString publicId() const;
776 //@}
777
778 /*! @name Attribute systemId() (DOM Level 2) */
779 //@{
780 DOMString systemId() const;
781 //@}
782
783 /*! @name Attribute internalSubset() (DOM Level 2) */
784 //@{
785 DOMString internalSubset() const;
786 //@}
787 public:
788 DocumentType(DocumentTypePrv*);
789 DocumentType();
790 private:
791 friend class Arcane::dom::DOMImplementation;
792 DocumentTypePrv* _impl() const;
793};
794
795/*---------------------------------------------------------------------------*/
796/*---------------------------------------------------------------------------*/
797
798class ARCANE_CORE_EXPORT Notation
799: public Node
800{
801 public:
802 /*! @name Attribute publicId() (DOM Level 1) */
803 //@{
804 DOMString publicId() const;
805 //@}
806
807 /*! @name Attribute systemId() (DOM Level 1) */
808 //@{
809 DOMString systemId() const;
810 //@}
811 private:
812 NotationPrv* _impl() const;
813};
814
815/*---------------------------------------------------------------------------*/
816/*---------------------------------------------------------------------------*/
817
818class ARCANE_CORE_EXPORT Entity
819: public Node
820{
821 public:
822 /*! @name Attribute publicId() (DOM Level 1) */
823 //@{
824 DOMString publicId() const;
825 //@}
826
827 /*! @name Attribute systemId() (DOM Level 1) */
828 //@{
829 DOMString systemId() const;
830 //@}
831
832 /*! @name Attribute notationName() (DOM Level 1) */
833 //@{
834 DOMString notationName() const;
835 //@}
836 /*! @name Attribute actualEncoding() (DOM Level 3) */
837 //@{
838 DOMString actualEncoding() const;
839 void actualEncoding(const DOMString&) const;
840 //@}
841
842 /*! @name Attribute encoding() (DOM Level 3) */
843 //@{
844 DOMString encoding() const;
845 void encoding(const DOMString&) const;
846 //@}
847
848 /*! @name Attribute version() (DOM Level 3) */
849 //@{
850 DOMString version() const;
851 void version(const DOMString&) const;
852 //@}
853 private:
854 EntityPrv* _impl() const;
855};
856
857/*---------------------------------------------------------------------------*/
858/*---------------------------------------------------------------------------*/
859
861: public Node
862{
863 public:
865 EntityReference(EntityReferencePrv*);
866 private:
867 EntityReferencePrv* _impl() const;
868};
869
870/*---------------------------------------------------------------------------*/
871/*---------------------------------------------------------------------------*/
872
873class ARCANE_CORE_EXPORT ProcessingInstruction
874: public Node
875{
876 public:
877
878 /*! @name Attribute target() (DOM Level 1) */
879 //@{
880 DOMString target() const;
881 //@}
882
883 /*! @name Attribute data() (DOM Level 1) */
884 //@{
885 DOMString data() const;
886 void data(const DOMString& value) const;
887 //@}
888 public:
890 ProcessingInstruction(ProcessingInstructionPrv*);
891 private:
892 ProcessingInstructionPrv* _impl() const;
893};
894
895/*---------------------------------------------------------------------------*/
896/*---------------------------------------------------------------------------*/
897
898class ARCANE_CORE_EXPORT NamedNodeMap
899{
900 public:
901 /*! @name Attribute length (DOM Level 1)*/
902 //@{
903 ULong length() const;
904 //@}
905 /*! @name DOM Level 1 operations */
906 //@{
907 Node getNamedItem(const DOMString& name) const;
908 Node setNamedItem(const Node& arg) const;
909 Node removeNamedItem(const DOMString& name) const;
910 Node item(ULong index) const;
911 //@}
912 /*! @name DOM Level 2 operations */
913 //@{
914 Node getNamedItemNS(const DOMString& namespace_uri,const DOMString& local_name) const;
915 Node setNamedItemNS(const Node& arg) const;
916 Node removeNamedItemNS(const DOMString& namespace_uri,const DOMString& local_name) const;
917 //@}
918 public:
919 bool _null() const;
920 public:
921 friend class IDOM_Node;
922 friend class IDOM_Element;
923 NamedNodeMap();
924 NamedNodeMap(NamedNodeMapPrv*);
926 NamedNodeMap(const NamedNodeMap& from);
927 const NamedNodeMap& operator=(const NamedNodeMap& from);
928 private:
929 //AutoRefT<NamedNodeMapPrv> m_p;
930 NamedNodeMapPrv* m_p;
931 NamedNodeMapPrv* _impl() const;
932};
933
934/*---------------------------------------------------------------------------*/
935/*---------------------------------------------------------------------------*/
936
938{
939 public:
940 DOMImplementation getDOMImplementation(const DOMString& features) const;
941};
942
943/*---------------------------------------------------------------------------*/
944/*---------------------------------------------------------------------------*/
945
947{
948 public:
949 //! @name OperationType
950 //@{
951 //! The node is cloned.
952 static const UShort CLONED = 1;
953 //! The node is imported.
954 static const UShort IMPORTED = 2;
955 //! The node is deleted.
956 static const UShort DELETED = 3;
957 //@}
958
959 void handle(UShort operation,const DOMString& key,const DOMObject& data,
960 const Node& src,const Node& dest) const;
961};
962
963/*---------------------------------------------------------------------------*/
964/*---------------------------------------------------------------------------*/
965
967{
968 public:
969 //! @name ErrorType
970 //@{
971 //! The severity of the error described by the DOMError is warning
972 static const UShort SEVERITY_WARNING = 0;
973 //! The severity of the error described by the DOMError is error
974 static const UShort SEVERITY_ERROR = 1;
975 //! The severity of the error described by the DOMError is fatal error
976 static const UShort SEVERITY_FATAL_ERROR = 2;
977 //@}
978
979 /*! @name Attribute severity (DOM Level 3) */
980 //@{
981 UShort severity() const;
982 //@}
983
984 /*! @name Attribute message (DOM Level 3) */
985 //@{
986 DOMString message() const;
987 //@}
988
989 /*! @name Attribute exception (DOM Level 3) */
990 //@{
991 DOMObject relatedException() const;
992 //@}
993
994 /*! @name Attribute location (DOM Level 3) */
995 //@{
996 DOMLocator location() const;
997 //@}
998 public:
999 DOMError();
1000 DOMError(DOMErrorPrv*);
1001 ~DOMError();
1002 DOMError(const DOMError& from);
1003 const DOMError& operator=(const DOMError& from);
1004 private:
1005 DOMErrorPrv* m_p;
1006 DOMErrorPrv* _impl() const;
1007 bool _null() const;
1008 void _checkValid() const;
1009};
1010
1011/*---------------------------------------------------------------------------*/
1012/*---------------------------------------------------------------------------*/
1013
1015{
1016 public:
1017 /*! @name DOM Level 3 operations */
1018 //@{
1019 bool handleError(const DOMError& error) const;
1020 //@}
1021};
1022
1023/*---------------------------------------------------------------------------*/
1024/*---------------------------------------------------------------------------*/
1025
1027{
1028 public:
1029 /*! @name Attribute lineNumber (DOM Level 3) */
1030 //@{
1031 long lineNumber() const;
1032 //@}
1033 /*! @name Attribute columnNumber (DOM Level 3) */
1034 //@{
1035 long columnNumber() const;
1036 //@}
1037 /*! @name Attribute offset (DOM Level 3) */
1038 //@{
1039 long offset() const;
1040 //@}
1041 /*! @name Attribute errorNode (DOM Level 3) */
1042 //@{
1043 Node errorNode() const;
1044 //@}
1045 /*! @name Attribute uri (DOM Level 3) */
1046 //@{
1047 DOMString uri() const;
1048 //@}
1049 public:
1050 friend class DOMError;
1051 DOMLocator();
1052 DOMLocator(DOMLocatorPrv*);
1053 ~DOMLocator();
1054 DOMLocator(const DOMLocator& from);
1055 const DOMLocator& operator=(const DOMLocator& from);
1056 private:
1057 DOMLocatorPrv* m_p;
1058 DOMLocatorPrv* _impl() const;
1059 bool _null() const;
1060 void _checkValid() const;
1061};
1062
1063/*---------------------------------------------------------------------------*/
1064/*---------------------------------------------------------------------------*/
1065
1066//! @name XPathExceptionCode
1067//@{
1068/*!
1069 If the expression is not a legal expression according to the rules
1070 of the specific XPathEvaluator or contains namespace prefixes which
1071 are not in scope according to the specified XPathNSResolver. If the
1072 XPathEvaluator was obtained by casting the document, the expression
1073 must be XPath 1.0 with no special extension functions.
1074*/
1075const unsigned short INVALID_EXPRESSION_ERR = 1;
1076/*!
1077 If the expression cannot be converted to return the specified type.
1078 Interface XPathEvaluator
1079*/
1080const unsigned short TYPE_ERR = 2;
1081//@}
1082
1083/*---------------------------------------------------------------------------*/
1084/*---------------------------------------------------------------------------*/
1085
1087{
1088 public:
1089 unsigned short code;
1090};
1091
1092/*---------------------------------------------------------------------------*/
1093/*---------------------------------------------------------------------------*/
1094
1096{
1097 public:
1098 XPathExpression createExpression(const DOMString& expression,
1099 const XPathNSResolver& resolver) const;
1100 XPathResult createResult() const;
1101 XPathNSResolver createNSResolver(const Node& node_resolver) const;
1102 XPathResult evaluate(const DOMString& expression,
1103 const Node& context_node,
1104 const XPathNSResolver& resolver,
1105 UShort type,
1106 const XPathResult& result) const;
1107
1108 XPathResult evaluateExpression(const XPathExpression& expression,
1109 const Node& context_node,
1110 UShort type,
1111 const XPathResult& result) const;
1112};
1113
1114/*---------------------------------------------------------------------------*/
1115/*---------------------------------------------------------------------------*/
1116
1118{
1119};
1120
1121/*---------------------------------------------------------------------------*/
1122/*---------------------------------------------------------------------------*/
1123
1125{
1126 public:
1127 DOMString lookupNamespaceURI(const DOMString& prefix) const;
1128};
1129
1130/*---------------------------------------------------------------------------*/
1131/*---------------------------------------------------------------------------*/
1132
1134{
1135 public:
1136 //! @name XPathResultType
1137 //@{
1138 /*!
1139 This code does not represent a specific type. An evaluation of an
1140 XPath expression will never produce this type. If this type is
1141 requested, then the evaluation must return whatever type Integerly
1142 results from evaluation of the expression.
1143 */
1144 static const UShort ANY_TYPE = 0;
1145 //! The result is a number as defined by XPath 1.0.
1146 static const UShort NUMBER_TYPE = 1;
1147 //! The result is a string as defined by XPath 1.0.
1148 static const UShort STRING_TYPE = 2;
1149 //! The result is a boolean as defined by XPath 1.0.
1150 static const UShort BOOLEAN_TYPE = 3;
1151 //! The result is a node set as defined by XPath 1.0.
1152 static const UShort NODE_SET_TYPE = 4;
1153 /*!
1154 The result is a single node, which may be any node of the node set
1155 defined by XPath 1.0, or null if the node set is empty. This is a
1156 convenience that permits optimization where the caller knows that
1157 no more than one such node exists because evaluation can stop
1158 after finding the one node of an expression that would otherwise
1159 return a node set (of type NODE_SET_TYPE).
1160
1161 Where it is possible that multiple nodes may exist and the first
1162 node in document order is required, a NODE_SET_TYPE should be
1163 processed using an ordered iterator, because there is no order
1164 guarantee for a single node.
1165 */
1166 static const UShort SINGLE_NODE_TYPE = 5;
1167 //@}
1168
1169 /*! @name Attribute resultType (DOM Level 3) */
1170 //@{
1171 UShort resultType() const;
1172 //@}
1173
1174 /*! @name Attribute numberValue (DOM Level 3) */
1175 //@{
1176 double numberValue() const;
1177 //@}
1178
1179 /*! @name AttributestringValue (DOM Level 3) */
1180 //@{
1181 DOMString stringValue() const;
1182 //@}
1183
1184 /*! @name Attribute booleanValue (DOM Level 3) */
1185 //@{
1186 bool booleanValue() const;
1187 //@}
1188
1189 /*! @name Attribute singleNodeValue (DOM Level 3) */
1190 //@{
1191 Node singleNodeValue() const;
1192 //@}
1193
1194 /*! @name DOM Level 3 operations */
1195 //@{
1196 XPathSetIterator getSetIterator(bool ordered) const;
1197 XPathSetSnapshot getSetSnapshot(bool ordered) const;
1198 //@}
1199};
1200
1201/*---------------------------------------------------------------------------*/
1202/*---------------------------------------------------------------------------*/
1203
1205{
1206 public:
1207
1208 Node nextNode() const;
1209};
1210
1212{
1213 public:
1214 /*! @name Attribute length (DOM Level 3) */
1215 //@{
1216 ULong length() const;
1217 //@}
1218
1219 /*! @name DOM Level 3 operations */
1220 //@{
1221 Node item(ULong index) const;
1222 //@}
1223};
1224
1225/*---------------------------------------------------------------------------*/
1226/*---------------------------------------------------------------------------*/
1227
1229: public Node
1230{
1231 public:
1232 //! @name XPathNodeType
1233 //@{
1234 //! The node is a Namespace.
1235 static const UShort XPATH_NAMESPACE_NODE = 13;
1236 //@}
1237
1238 /*! @name Attribute ownerElement (DOM Level 3) */
1239 //@{
1240 Element ownerElement() const;
1241 //@}
1242};
1243
1244/*---------------------------------------------------------------------------*/
1245/*---------------------------------------------------------------------------*/
1246
1247ARCANE_END_NAMESPACE_DOM
1248ARCANE_END_NAMESPACE
1249
1250/*---------------------------------------------------------------------------*/
1251/*---------------------------------------------------------------------------*/
1252
1253#endif
1254
UShort code
The code of the exception.
Definition Dom.h:107
Gestionnaire d'un document DOM.
Noeud d'un maillage.
Definition Dom.h:204
NodePrv * m_p
Implémentation de la classe.
Definition Dom.h:412
Classe de base des vecteurs 1D de données.
Vue constante d'un tableau de type T.
Interface du gestionnaire de traces.
Chaîne de caractères unicode.
Vecteur 1D de données avec sémantique par valeur (style STL).
const UShort INUSE_ATTRIBUTE_ERR
Definition Dom.h:81
const UShort INVALID_ACCESS_ERR
Definition Dom.h:94
const UShort HIERARCHY_REQUEST_ERR
If any node is inserted somewhere it doesn't belong.
Definition Dom.h:59
const unsigned short TYPE_ERR
Definition Dom.h:1080
const UShort INVALID_MODIFICATION_ERR
Definition Dom.h:88
const UShort NOT_FOUND_ERR
Definition Dom.h:75
const UShort NO_DATA_ALLOWED_ERR
If data is specified for a node which does not support data.
Definition Dom.h:69
Span< const std::byte > ByteConstSpan
Vue en lecture seule d'un tableau à une dimension de caractères.
Definition UtilsTypes.h:706
const UShort INVALID_STATE_ERR
Definition Dom.h:84
const UShort NOT_SUPPORTED_ERR
Definition Dom.h:78
const UShort INVALID_CHARACTER_ERR
Definition Dom.h:67
const UShort WRONG_DOCUMENT_ERR
Definition Dom.h:62
const UShort SYNTAX_ERR
Definition Dom.h:86
const UShort NO_MODIFICATION_ALLOWED_ERR
Definition Dom.h:72
const UShort DOMSTRING_SIZE_ERR
Definition Dom.h:57
const unsigned short INVALID_EXPRESSION_ERR
Definition Dom.h:1075
const UShort INDEX_SIZE_ERR
Definition Dom.h:55
const UShort NAMESPACE_ERR
Definition Dom.h:91