Yate: yatexml.h Source File

Yate

- Main Page
- Namespaces
- Classes
- Files

- File List

yatexml.h
1
22 #ifndef __YATEXML_H
23 #define __YATEXML_H
24
25 #ifndef __cplusplus
26 #error C++ is required
27 #endif
28
29 #include <yateclass.h>
30
34 namespace TelEngine {
35
36 class XmlSaxParser;
37 class XmlDomParser;
38 class XmlDeclaration;
39 class XmlFragment;
40 class XmlChild;
41 class XmlParent;
42 class XmlDocument;
43 class XmlElement;
44 class XmlComment;
45 class XmlCData;
46 class XmlText;
47 class XmlDoctype;
48
49
50 struct YATE_API XmlEscape {
54 const char* value;
55
59 char replace;
60 };
61
66 class YATE_API XmlSaxParser : public DebugEnabler
67 {
68 public:
69 enum Error {
70 NoError = 0,
71 NotWellFormed,
72 Unknown,
73 IOError,
74 ElementParse,
75 ReadElementName,
76 InvalidElementName,
77 ReadingAttributes,
78 CommentParse,
79 DeclarationParse,
80 DefinitionParse,
81 CDataParse,
82 ReadingEndTag,
83 Incomplete,
84 InvalidEncoding,
85 UnsupportedEncoding,
86 UnsupportedVersion,
87 };
88 enum Type {
89 None = 0,
90 Text = 1,
91 CData = 2,
92 Element = 3,
93 Doctype = 4,
94 Comment = 5,
95 Declaration = 6,
96 Instruction = 7,
97 EndTag = 8,
98 Special = 9
99 };
100
104 virtual ~XmlSaxParser();
105
110 inline unsigned int offset() const
111 { return m_offset; }
112
117 inline unsigned int row() const
118 { return m_row; }
119
124 inline unsigned int column() const
125 { return m_column; }
126
131 inline const String& buffer() const
132 { return m_buf; }
133
139 bool parse(const char* data);
140
147 bool completeText();
148
153 inline Error error()
154 { return m_error; }
155
162 bool setError(Error error, XmlChild* child = 0);
163
169 inline const char* getError(const char* defVal = "Xml error")
170 { return getError(m_error,defVal); }
171
175 inline Type unparsed()
176 { return m_unparsed; }
177
182 inline void setUnparsed(Type id)
183 { m_unparsed = id;}
184
188 virtual void reset();
189
193 const String& getBuffer() const
194 { return m_buf; }
195
202 static inline const char* getError(int code, const char* defVal = "Xml error")
203 { return lookup(code,s_errorString,defVal); }
204
210 static inline bool blank(char c)
211 { return (c == 0x20) || (c == 0x09) || (c == 0x0d) || (c == 0x0a); }
212
219 static bool checkFirstNameCharacter(unsigned char ch);
220
226 static bool checkDataChar(unsigned char c);
227
233 static bool checkNameCharacter(unsigned char ch);
234
240 static bool validTag(const String& buf);
241
247 static void escape(String& buf, const String& text);
248
252 static const TokenDict s_errorString[];
253
257 static const XmlEscape s_escape[];
258
259 protected:
264 XmlSaxParser(const char* name = "XmlSaxParser");
265
271 bool parseInstruction();
272
278 bool parseCData();
279
285 bool parseComment();
286
292 bool parseElement();
293
299 bool parseDeclaration();
300
306 bool parseSpecial();
307
313 bool parseEndTag();
314
321 bool parseDoctype();
322
328 bool auxParse();
329
336 void unEscape(String& text);
337
341 void skipBlanks();
342
348 inline bool badCharacter(char c)
349 { return c == '<' || c == '>'; }
350
354 inline void resetError()
355 { m_error = NoError; }
356
360 inline void resetParsed()
361 { m_parsed.clear(); m_parsed.clearParams(); }
362
367 String* extractName(bool& empty);
368
373 NamedString* getAttribute();
374
380 virtual void gotComment(const String& text)
381 { }
382
388 virtual void gotProcessing(const NamedString& instr)
389 { }
390
396 virtual void gotDeclaration(const NamedList& decl)
397 { }
398
404 virtual void gotText(const String& text)
405 { }
406
412 virtual void gotCdata(const String& data)
413 { }
414
421 virtual void gotElement(const NamedList& element, bool empty)
422 { }
423
429 virtual void endElement(const String& name)
430 { }
431
437 virtual void gotDoctype(const String& doc)
438 { }
439
445 virtual bool completed()
446 { return true; }
447
454 bool processElement(NamedList& list, bool empty);
455
461 bool processText(String& text);
462
466 unsigned int m_offset;
467
471 unsigned int m_row;
472
476 unsigned int m_column;
477
481 Error m_error;
482
486 String m_buf;
487
492 NamedList m_parsed;
493
497 Type m_unparsed;
498 };
499
504 class YATE_API XmlParent
505 {
506 public:
510 XmlParent()
511 { }
512
516 virtual ~XmlParent()
517 { }
518
524 virtual XmlDocument* document()
525 { return 0; }
526
532 virtual XmlFragment* fragment()
533 { return 0; }
534
540 virtual XmlElement* element()
541 { return 0; }
542
548 virtual XmlSaxParser::Error addChild(XmlChild* child) = 0;
549
556 inline XmlChild* addChildSafe(XmlChild* child, XmlSaxParser::Error* code = 0) {
557 XmlSaxParser::Error err = addChild(child);
558 if (err != XmlSaxParser::NoError) {
559 TelEngine::destruct(child);
560 if (code)
561 *code = err;
562 }
563 return child;
564 }
565
572 virtual XmlChild* removeChild(XmlChild* child, bool delObj = true) = 0;
573
578 virtual void reset()
579 { }
580
586 virtual const ObjList& getChildren() const
587 { return ObjList::empty(); }
588
593 virtual void clearChildren()
594 { }
595
600 inline bool hasChildren() const
601 { return getChildren().skipNull() != 0; }
602 };
603
608 class YATE_API XmlDomParser : public XmlSaxParser
609 {
610 friend class XmlChild;
611 public:
617 XmlDomParser(const char* name = "XmlDomParser", bool fragment = false);
618
624 XmlDomParser(XmlParent* fragment, bool takeOwnership);
625
629 virtual ~XmlDomParser();
630
635 XmlDocument* document()
636 { return m_data->document(); }
637
642 XmlFragment* fragment()
643 { return m_data->fragment(); }
644
648 virtual void reset();
649
655 inline bool isCurrent(const XmlElement* el) const
656 { return el == m_current; }
657
658 protected:
659
664 virtual void gotComment(const String& text);
665
670 virtual void gotProcessing(const NamedString& instr);
671
676 virtual void gotDeclaration(const NamedList& decl);
677
682 virtual void gotText(const String& text);
683
688 virtual void gotCdata(const String& data);
689
695 virtual void gotElement(const NamedList& element, bool empty);
696
701 virtual void endElement(const String& name);
702
707 virtual void gotDoctype(const String& doc);
708
713 virtual bool completed()
714 { return m_current == 0; }
715
716 private:
717 XmlElement* m_current; // The current xml element
718 XmlParent* m_data; // Main xml fragment
719 bool m_ownData; // The DOM owns data
720 };
721
726 class YATE_API XmlChild : public GenObject
727 {
728 YCLASS(XmlChild,GenObject)
729 friend class XmlDomParser;
730 public:
734 XmlChild();
735
740 virtual void setParent(XmlParent* parent)
741 { }
742
747 virtual XmlElement* xmlElement()
748 { return 0; }
749
754 virtual XmlComment* xmlComment()
755 { return 0; }
756
761 virtual XmlCData* xmlCData()
762 { return 0; }
763
768 virtual XmlText* xmlText()
769 { return 0; }
770
775 virtual XmlDeclaration* xmlDeclaration()
776 { return 0; }
777
782 virtual XmlDoctype* xmlDoctype()
783 { return 0; }
784
789 virtual void replaceParams(const NamedList& params)
790 {}
791 };
792
793
798 class YATE_API XmlDeclaration : public XmlChild
799 {
800 YCLASS(XmlDeclaration,XmlChild)
801 public:
807 XmlDeclaration(const char* version = "1.0", const char* enc = "utf-8");
808
813 XmlDeclaration(const NamedList& decl);
814
819 XmlDeclaration(const XmlDeclaration& orig);
820
824 ~XmlDeclaration();
825
830 inline const NamedList& getDec() const
831 { return m_declaration; }
832
838 virtual XmlDeclaration* xmlDeclaration()
839 { return this; }
840
846 void toString(String& dump, bool escape = true) const;
847
848 private:
849 NamedList m_declaration; // The declaration
850 };
851
856 class YATE_API XmlFragment : public XmlParent
857 {
858 public:
859
863 XmlFragment();
864
869 XmlFragment(const XmlFragment& orig);
870
874 virtual ~XmlFragment();
875
880 virtual XmlFragment* fragment()
881 { return this; }
882
887 virtual const ObjList& getChildren() const
888 { return m_list; }
889
895 virtual XmlSaxParser::Error addChild(XmlChild* child);
896
900 virtual void reset();
901
906 inline XmlChild* pop()
907 { return static_cast<XmlChild*>(m_list.remove(false)); }
908
913 XmlElement* popElement();
914
921 virtual XmlChild* removeChild(XmlChild* child, bool delObj = true);
922
926 virtual void clearChildren()
927 { m_list.clear(); }
928
934 void copy(const XmlFragment& other, XmlParent* parent = 0);
935
948 void toString(String& dump, bool escape = true, const String& indent = String::empty(),
949 const String& origIndent = String::empty(), bool completeOnly = true,
950 const String* auth = 0, const XmlElement* parent = 0) const;
951
956 void replaceParams(const NamedList& params);
957
968 static XmlElement* findElement(ObjList* list, const String* name, const String* ns,
969 bool noPrefix = true);
970
971 private:
972 ObjList m_list; // The children list
973 };
974
979 class YATE_API XmlDocument : public XmlParent
980 {
981 public:
982
986 XmlDocument();
987
991 virtual ~XmlDocument();
992
997 virtual XmlDocument* document()
998 { return this; }
999
1009 virtual XmlSaxParser::Error addChild(XmlChild* child);
1010
1015 XmlDeclaration* declaration() const;
1016
1023 inline const XmlFragment& getFragment(bool before) const
1024 { return before ? m_beforeRoot : m_afterRoot; }
1025
1031 XmlElement* root(bool completed = false) const;
1032
1038 inline XmlElement* takeRoot(bool completed = false)
1039 {
1040 XmlElement* r = root(completed);
1041 if (r)
1042 m_root = 0;
1043 return r;
1044 }
1045
1049 virtual void reset();
1050
1057 virtual XmlChild* removeChild(XmlChild* child, bool delObj = true)
1058 { return m_beforeRoot.removeChild(child,delObj); }
1059
1066 virtual XmlSaxParser::Error read(Stream& in, int* error = 0);
1067
1080 virtual int write(Stream& out, bool escape = true,
1081 const String& indent = String::empty(), const String& origIndent = String::empty(),
1082 bool completeOnly = true) const;
1083
1091 XmlSaxParser::Error loadFile(const char* file, int* error = 0);
1092
1103 int saveFile(const char* file = 0, bool escape = true,
1104 const String& indent = String::empty(), bool completeOnly = true,
1105 const char* eoln = "\r\n") const;
1106
1114 void toString(String& dump, bool escape = true, const String& indent = String::empty(),
1115 const String& origIndent = String::empty()) const;
1116
1121 void replaceParams(const NamedList& params);
1122
1123 private:
1124 XmlElement* m_root; // The root element
1125 XmlFragment m_beforeRoot; // XML children before root (declaration ...)
1126 String m_file; // The file name used on load
1127 XmlFragment m_afterRoot; // XML children after root (comments, empty text)
1128 };
1129
1130
1136 class YATE_API XmlElement : public XmlChild, public XmlParent
1137 {
1138 YCLASS(XmlElement,XmlChild)
1139 public:
1146 XmlElement(const NamedList& element, bool empty, XmlParent* parent = 0);
1147
1153 XmlElement(const char* name, bool complete = true);
1154
1161 XmlElement(const char* name, const char* value, bool complete = true);
1162
1167 XmlElement(const XmlElement& orig);
1168
1172 virtual ~XmlElement();
1173
1178 inline const char* tag() const
1179 { return m_element; }
1180
1185 inline bool isDefaultNs() const
1186 { return m_prefixed == 0; }
1187
1192 inline const String& unprefixedTag() const
1193 { return m_prefixed ? m_prefixed->name() : static_cast<const String&>(m_element); }
1194
1199 void setUnprefixedTag(const String& s);
1200
1205 inline const String& getTag() const
1206 { return m_prefixed ? m_prefixed->name() : static_cast<const String&>(m_element); }
1207
1214 bool getTag(const String*& tag, const String*& ns) const;
1215
1220 virtual XmlElement* xmlElement()
1221 { return this; }
1222
1227 virtual XmlElement* element()
1228 { return this; }
1229
1234 virtual XmlSaxParser::Error addChild(XmlChild* child);
1235
1242 virtual XmlChild* removeChild(XmlChild* child, bool delObj = true);
1243
1247 virtual void setCompleted()
1248 { m_complete = true; }
1249
1253 inline bool completed() const
1254 { return m_complete; }
1255
1259 inline bool empty() const
1260 { return m_empty; }
1261
1266 inline XmlElement* parent() const
1267 { return m_parent ? m_parent->element() : 0; }
1268
1272 virtual XmlParent* getParent()
1273 { return m_parent; }
1274
1279 virtual void setParent(XmlParent* parent);
1280
1284 virtual const String& getName() const
1285 { return m_element; }
1286
1290 virtual const NamedList& getElement() const
1291 { return m_element; }
1292
1297 inline const ObjList& getChildren() const
1298 { return m_children.getChildren(); }
1299
1303 inline void clearChildren()
1304 { return m_children.clearChildren(); }
1305
1310 inline const NamedList* inheritedNs() const
1311 { return m_inheritedNs; }
1312
1318 void setInheritedNs(const XmlElement* xml = 0, bool inherit = true);
1319
1324 void addInheritedNs(const NamedList& list);
1325
1330 inline XmlElement* pop() {
1331 XmlElement* x = findFirstChild();
1332 if (!(x && x->completed()))
1333 return 0;
1334 m_children.removeChild(x,false);
1335 return x;
1336 }
1337
1342 virtual const String& toString() const
1343 { return m_element; }
1344
1356 void toString(String& dump, bool escape = true, const String& indent = String::empty(),
1357 const String& origIndent = String::empty(), bool completeOnly = true,
1358 const String* auth = 0) const;
1359
1369 inline XmlElement* findFirstChild(const String* name = 0, const String* ns = 0,
1370 bool noPrefix = true) const
1371 { return XmlFragment::findElement(getChildren().skipNull(),name,ns,noPrefix); }
1372
1382 inline XmlElement* findFirstChild(const String& name, const String* ns = 0,
1383 bool noPrefix = true) const
1384 { return XmlFragment::findElement(getChildren().skipNull(),&name,ns,noPrefix); }
1385
1396 inline XmlElement* findNextChild(const XmlElement* prev = 0, const String* name = 0,
1397 const String* ns = 0, bool noPrefix = true) const {
1398 if (!prev)
1399 return findFirstChild(name,ns,noPrefix);
1400 ObjList* start = getChildren().find(prev);
1401 return start ? XmlFragment::findElement(start->skipNext(),name,ns,noPrefix) : 0;
1402 }
1403
1414 inline XmlElement* findNextChild(const String& name, const XmlElement* prev = 0,
1415 const String* ns = 0, bool noPrefix = true) const
1416 { return findNextChild(prev,&name,ns,noPrefix); }
1417
1427 inline const String* childText(const String& name, const String* ns = 0,
1428 bool noPrefix = true) const {
1429 XmlElement* c = findFirstChild(&name,ns,noPrefix);
1430 return c ? &(c->getText()) : 0;
1431 }
1432
1437 XmlChild* getFirstChild();
1438
1442 const String& getText() const;
1443
1451 XmlText* setText(const char* text);
1452
1457 void addText(const char* text);
1458
1463 inline const NamedList& attributes() const
1464 { return m_element; }
1465
1472 unsigned int copyAttributes(NamedList& list, const String& prefix) const;
1473
1481 void setAttributes(NamedList& list, const String& prefix, bool skipPrefix = true);
1482
1488 inline void setAttribute(const String& name, const char* value)
1489 { m_element.setParam(name,value); }
1490
1496 inline void setAttributeValid(const String& name, const char* value) {
1497 if (!TelEngine::null(value))
1498 m_element.setParam(name,value);
1499 else
1500 removeAttribute(name);
1501 }
1502
1508 inline const char* attribute(const String& name) const
1509 { return m_element.getValue(name); }
1510
1516 inline String* getAttribute(const String& name) const
1517 { return m_element.getParam(name); }
1518
1525 inline bool hasAttribute(const String& name, const String& value) const {
1526 String* a = getAttribute(name);
1527 return a && *a == value;
1528 }
1529
1534 inline void removeAttribute(const String& name)
1535 { m_element.clearParam(name); }
1536
1541 inline String* xmlns() const {
1542 if (!m_prefixed)
1543 return xmlnsAttribute(s_ns);
1544 return xmlnsAttribute(s_nsPrefix + *m_prefixed);
1545 }
1546
1551 String* xmlnsAttribute(const String& name) const;
1552
1558 inline bool hasXmlns(const String& ns) const {
1559 const String* x = xmlns();
1560 return x && *x == ns;
1561 }
1562
1571 bool setXmlns(const String& name = String::empty(), bool addAttr = false,
1572 const String& value = String::empty());
1573
1579 virtual void replaceParams(const NamedList& params);
1580
1587 static inline bool isXmlns(const String& str)
1588 { return str == s_ns || str.startsWith(s_nsPrefix); }
1589
1606 static XmlElement* param2xml(NamedString* param, const String& tag,
1607 bool copyXml = false);
1608
1618 static NamedString* xml2param(XmlElement* xml, const String* tag,
1619 bool copyXml = false);
1620
1631 static void xml2param(NamedList& list, XmlElement* parent, const String* tag,
1632 bool copyXml = false);
1633
1637 static const String s_ns;
1638
1642 static const String s_nsPrefix;
1643
1644 private:
1645 // Set prefixed data (tag and prefix)
1646 inline void setPrefixed() {
1647 TelEngine::destruct(m_prefixed);
1648 int pos = m_element.find(":");
1649 if (pos != -1)
1650 m_prefixed = new NamedString(m_element.substr(pos + 1),m_element.substr(0,pos));
1651 }
1652
1653 XmlFragment m_children; // Children of this element
1654 NamedList m_element; // The element
1655 NamedString* m_prefixed; // Splitted prefixed tag (the value is the namespace prefix)
1656 XmlParent* m_parent; // The XmlElement who holds this element
1657 NamedList* m_inheritedNs; // Inherited namespaces (if parent is 0)
1658 bool m_empty; // True if this element does not have any children
1659 bool m_complete; // True if the end element tag war reported
1660 };
1661
1666 class YATE_API XmlComment : public XmlChild
1667 {
1668 YCLASS(XmlComment,XmlChild)
1669 public:
1674 XmlComment(const String& comm);
1675
1680 XmlComment(const XmlComment& orig);
1681
1685 virtual ~XmlComment();
1686
1691 inline const String& getComment() const
1692 { return m_comment; }
1693
1699 void toString(String& dump, const String& indent = String::empty()) const;
1700
1705 virtual XmlComment* xmlComment()
1706 { return this; }
1707
1708 private:
1709 String m_comment; // The comment
1710 };
1711
1716 class YATE_API XmlCData : public XmlChild
1717 {
1718 YCLASS(XmlCData,XmlChild)
1719 public:
1720
1725 XmlCData(const String& data);
1726
1731 XmlCData(const XmlCData& orig);
1732
1736 virtual ~XmlCData();
1737
1742 inline const String& getCData() const
1743 { return m_data;}
1744
1750 void toString(String& dump, const String& indent = String::empty()) const;
1751
1756 virtual XmlCData* xmlCData()
1757 { return this; }
1758
1759 private:
1760 String m_data; // The data
1761 };
1762
1767 class YATE_API XmlText : public XmlChild
1768 {
1769 YCLASS(XmlText,XmlChild)
1770 public:
1775 XmlText(const String& text);
1776
1781 XmlText(const XmlText& orig);
1782
1786 virtual ~XmlText();
1787
1791 inline const String& getText() const
1792 { return m_text; }
1793
1798 inline void setText(const char* text)
1799 { m_text = text; }
1800
1811 void toString(String& dump, bool escape = true, const String& indent = String::empty(),
1812 const String* auth = 0, const XmlElement* parent = 0) const;
1813
1818 virtual XmlText* xmlText()
1819 { return this; }
1820
1825 bool onlySpaces();
1826
1831 virtual void replaceParams(const NamedList& params);
1832
1833 private:
1834 String m_text; // The text
1835 };
1836
1837 class YATE_API XmlDoctype : public XmlChild
1838 {
1839 YCLASS(XmlDoctype,XmlChild)
1840 public:
1845 XmlDoctype(const String& doctype);
1846
1851 XmlDoctype(const XmlDoctype& orig);
1852
1856 virtual ~XmlDoctype();
1857
1862 inline const String& getDoctype() const
1863 { return m_doctype; }
1864
1869 virtual XmlDoctype* xmlDoctype()
1870 { return this; }
1871
1877 void toString(String& dump, const String& indent = String::empty()) const;
1878
1879 private:
1880 String m_doctype; // The document type
1881 };
1882
1883 }; // namespace TelEngine
1884
1885 #endif /* __YATEXML_H */
1886
1887 /* vi: set ts=8 sw=4 sts=4 noet: */
TelEngine::XmlSaxParser::getError
const char * getError(const char *defVal="Xml error")
Definition: yatexml.h:169
TelEngine::XmlElement::childText
const String * childText(const String &name, const String *ns=0, bool noPrefix=true) const
Definition: yatexml.h:1427
TelEngine::XmlText::xmlText
virtual XmlText * xmlText()
Definition: yatexml.h:1818
TelEngine::XmlDeclaration
Xml Declaration.
Definition: yatexml.h:798
TelEngine::XmlParent::~XmlParent
virtual ~XmlParent()
Definition: yatexml.h:516
TelEngine::String::startsWith
bool startsWith(const char *what, bool wordBreak=false, bool caseInsensitive=false) const
TelEngine::XmlElement::clearChildren
void clearChildren()
Definition: yatexml.h:1303
TelEngine::XmlElement::tag
const char * tag() const
Definition: yatexml.h:1178
TelEngine::XmlDomParser
Document Object Model XML Parser.
Definition: yatexml.h:608
TelEngine::XmlDoctype::getDoctype
const String & getDoctype() const
Definition: yatexml.h:1862
TelEngine::XmlChild::xmlCData
virtual XmlCData * xmlCData()
Definition: yatexml.h:761
TelEngine::XmlSaxParser::m_buf
String m_buf
Definition: yatexml.h:486
TelEngine::XmlDocument
Xml Document.
Definition: yatexml.h:979
TelEngine::XmlFragment::getChildren
virtual const ObjList & getChildren() const
Definition: yatexml.h:887
TelEngine::XmlElement::getChildren
const ObjList & getChildren() const
Definition: yatexml.h:1297
TelEngine::XmlFragment::pop
XmlChild * pop()
Definition: yatexml.h:906
TelEngine::XmlText
Xml Declaration.
Definition: yatexml.h:1767
TelEngine::XmlSaxParser::gotText
virtual void gotText(const String &text)
Definition: yatexml.h:404
TelEngine::XmlSaxParser::gotElement
virtual void gotElement(const NamedList &element, bool empty)
Definition: yatexml.h:421
TelEngine::XmlDomParser::document
XmlDocument * document()
Definition: yatexml.h:635
TelEngine::XmlParent::XmlParent
XmlParent()
Definition: yatexml.h:510
TelEngine::XmlEscape::replace
char replace
Definition: yatexml.h:59
TelEngine::XmlDomParser::completed
virtual bool completed()
Definition: yatexml.h:713
TelEngine::XmlSaxParser::m_parsed
NamedList m_parsed
Definition: yatexml.h:492
TelEngine::XmlFragment
Xml Fragment.
Definition: yatexml.h:856
TelEngine::XmlSaxParser
Serial Access XML Parser.
Definition: yatexml.h:66
TelEngine::XmlParent::addChildSafe
XmlChild * addChildSafe(XmlChild *child, XmlSaxParser::Error *code=0)
Definition: yatexml.h:556
TelEngine::XmlSaxParser::column
unsigned int column() const
Definition: yatexml.h:124
TelEngine::XmlChild
Xml Child.
Definition: yatexml.h:726
TelEngine::XmlDocument::removeChild
virtual XmlChild * removeChild(XmlChild *child, bool delObj=true)
Definition: yatexml.h:1057
TelEngine::XmlChild::xmlDoctype
virtual XmlDoctype * xmlDoctype()
Definition: yatexml.h:782
TelEngine::XmlParent::getChildren
virtual const ObjList & getChildren() const
Definition: yatexml.h:586
TelEngine::XmlElement
Xml Element.
Definition: yatexml.h:1136
TelEngine::XmlComment
Xml Comment.
Definition: yatexml.h:1666
TelEngine::XmlElement::setAttribute
void setAttribute(const String &name, const char *value)
Definition: yatexml.h:1488
TelEngine::XmlComment::getComment
const String & getComment() const
Definition: yatexml.h:1691
TelEngine::XmlSaxParser::resetError
void resetError()
Definition: yatexml.h:354
TelEngine::XmlElement::getText
const String & getText() const
TelEngine::XmlSaxParser::m_column
unsigned int m_column
Definition: yatexml.h:476
TelEngine::XmlCData::xmlCData
virtual XmlCData * xmlCData()
Definition: yatexml.h:1756
TelEngine::XmlCData::getCData
const String & getCData() const
Definition: yatexml.h:1742
TelEngine::ObjList::find
ObjList * find(const GenObject *obj) const
TelEngine::lookup
int lookup(const char *str, const TokenDict *tokens, int defvalue=0, int base=0)
TelEngine::XmlDomParser::isCurrent
bool isCurrent(const XmlElement *el) const
Definition: yatexml.h:655
TelEngine::destruct
void destruct(GenObject *obj)
Definition: yateclass.h:951
TelEngine::XmlParent::fragment
virtual XmlFragment * fragment()
Definition: yatexml.h:532
TelEngine::XmlSaxParser::gotProcessing
virtual void gotProcessing(const NamedString &instr)
Definition: yatexml.h:388
TelEngine::XmlSaxParser::gotDeclaration
virtual void gotDeclaration(const NamedList &decl)
Definition: yatexml.h:396
TelEngine::XmlElement::hasAttribute
bool hasAttribute(const String &name, const String &value) const
Definition: yatexml.h:1525
TelEngine::XmlDoctype::xmlDoctype
virtual XmlDoctype * xmlDoctype()
Definition: yatexml.h:1869
TelEngine::XmlElement::getTag
const String & getTag() const
Definition: yatexml.h:1205
TelEngine::XmlElement::attribute
const char * attribute(const String &name) const
Definition: yatexml.h:1508
TelEngine::XmlParent::hasChildren
bool hasChildren() const
Definition: yatexml.h:600
TelEngine::XmlSaxParser::getError
static const char * getError(int code, const char *defVal="Xml error")
Definition: yatexml.h:202
TelEngine::DebugEnabler
A holder for a debug level.
Definition: yateclass.h:309
TelEngine::XmlElement::parent
XmlElement * parent() const
Definition: yatexml.h:1266
TelEngine::XmlElement::setCompleted
virtual void setCompleted()
Definition: yatexml.h:1247
TelEngine::XmlSaxParser::completed
virtual bool completed()
Definition: yatexml.h:445
TelEngine::XmlElement::getName
virtual const String & getName() const
Definition: yatexml.h:1284
TelEngine::XmlElement::getElement
virtual const NamedList & getElement() const
Definition: yatexml.h:1290
TelEngine::XmlElement::hasXmlns
bool hasXmlns(const String &ns) const
Definition: yatexml.h:1558
TelEngine::XmlChild::replaceParams
virtual void replaceParams(const NamedList &params)
Definition: yatexml.h:789
TelEngine::ObjList::empty
static const ObjList & empty()
TelEngine::XmlParent::clearChildren
virtual void clearChildren()
Definition: yatexml.h:593
TelEngine::XmlSaxParser::endElement
virtual void endElement(const String &name)
Definition: yatexml.h:429
TelEngine::NamedString
A named string class.
Definition: yateclass.h:3260
TelEngine::XmlSaxParser::gotCdata
virtual void gotCdata(const String &data)
Definition: yatexml.h:412
TelEngine::XmlFragment::fragment
virtual XmlFragment * fragment()
Definition: yatexml.h:880
TelEngine::XmlElement::attributes
const NamedList & attributes() const
Definition: yatexml.h:1463
TelEngine::XmlSaxParser::gotComment
virtual void gotComment(const String &text)
Definition: yatexml.h:380
TelEngine::XmlText::getText
const String & getText() const
Definition: yatexml.h:1791
TelEngine::null
bool null(const char *str)
Definition: yateclass.h:2960
TelEngine::XmlChild::xmlText
virtual XmlText * xmlText()
Definition: yatexml.h:768
TelEngine::XmlParent::reset
virtual void reset()
Definition: yatexml.h:578
TelEngine::NamedList
A named string container class.
Definition: yateclass.h:4773
TelEngine::XmlComment::xmlComment
virtual XmlComment * xmlComment()
Definition: yatexml.h:1705
TelEngine::XmlEscape
Definition: yatexml.h:50
TelEngine::XmlElement::inheritedNs
const NamedList * inheritedNs() const
Definition: yatexml.h:1310
TelEngine::XmlElement::xmlElement
virtual XmlElement * xmlElement()
Definition: yatexml.h:1220
TelEngine::XmlText::setText
void setText(const char *text)
Definition: yatexml.h:1798
TelEngine::XmlElement::completed
bool completed() const
Definition: yatexml.h:1253
TelEngine::XmlSaxParser::m_unparsed
Type m_unparsed
Definition: yatexml.h:497
TelEngine::XmlDeclaration::getDec
const NamedList & getDec() const
Definition: yatexml.h:830
TelEngine::Stream
An abstract stream class capable of reading and writing.
Definition: yateclass.h:6542
TelEngine::XmlElement::toString
virtual const String & toString() const
Definition: yatexml.h:1342
TelEngine::XmlSaxParser::setUnparsed
void setUnparsed(Type id)
Definition: yatexml.h:182
TelEngine::XmlSaxParser::m_offset
unsigned int m_offset
Definition: yatexml.h:466
TelEngine::XmlDoctype
Definition: yatexml.h:1837
TelEngine::XmlElement::setAttributeValid
void setAttributeValid(const String &name, const char *value)
Definition: yatexml.h:1496
TelEngine::XmlDeclaration::xmlDeclaration
virtual XmlDeclaration * xmlDeclaration()
Definition: yatexml.h:838
TelEngine::XmlSaxParser::buffer
const String & buffer() const
Definition: yatexml.h:131
TelEngine::XmlElement::findFirstChild
XmlElement * findFirstChild(const String &name, const String *ns=0, bool noPrefix=true) const
Definition: yatexml.h:1382
TelEngine::ObjList::skipNext
ObjList * skipNext() const
TelEngine::XmlEscape::value
const char * value
Definition: yatexml.h:54
TelEngine::XmlElement::element
virtual XmlElement * element()
Definition: yatexml.h:1227
TelEngine::XmlElement::unprefixedTag
const String & unprefixedTag() const
Definition: yatexml.h:1192
TelEngine::XmlChild::setParent
virtual void setParent(XmlParent *parent)
Definition: yatexml.h:740
TelEngine
Definition: yateclass.h:217
TelEngine::XmlElement::pop
XmlElement * pop()
Definition: yatexml.h:1330
TelEngine::XmlElement::getParent
virtual XmlParent * getParent()
Definition: yatexml.h:1272
TelEngine::XmlSaxParser::offset
unsigned int offset() const
Definition: yatexml.h:110
TelEngine::XmlElement::findNextChild
XmlElement * findNextChild(const XmlElement *prev=0, const String *name=0, const String *ns=0, bool noPrefix=true) const
Definition: yatexml.h:1396
TelEngine::XmlElement::removeAttribute
void removeAttribute(const String &name)
Definition: yatexml.h:1534
TelEngine::XmlSaxParser::blank
static bool blank(char c)
Definition: yatexml.h:210
TelEngine::String
A C-style string handling class.
Definition: yateclass.h:1924
TelEngine::XmlSaxParser::error
Error error()
Definition: yatexml.h:153
TelEngine::XmlDocument::getFragment
const XmlFragment & getFragment(bool before) const
Definition: yatexml.h:1023
TelEngine::XmlSaxParser::m_error
Error m_error
Definition: yatexml.h:481
TelEngine::TokenDict
Definition: yateclass.h:683
TelEngine::XmlElement::s_nsPrefix
static const String s_nsPrefix
Definition: yatexml.h:1642
TelEngine::XmlDocument::document
virtual XmlDocument * document()
Definition: yatexml.h:997
TelEngine::XmlSaxParser::unparsed
Type unparsed()
Definition: yatexml.h:175
TelEngine::ObjList
An object list class.
Definition: yateclass.h:1247
TelEngine::XmlElement::getAttribute
String * getAttribute(const String &name) const
Definition: yatexml.h:1516
TelEngine::XmlDomParser::fragment
XmlFragment * fragment()
Definition: yatexml.h:642
TelEngine::XmlElement::isXmlns
static bool isXmlns(const String &str)
Definition: yatexml.h:1587
TelEngine::XmlElement::findFirstChild
XmlElement * findFirstChild(const String *name=0, const String *ns=0, bool noPrefix=true) const
Definition: yatexml.h:1369
TelEngine::XmlSaxParser::resetParsed
void resetParsed()
Definition: yatexml.h:360
TelEngine::YCLASS
void YCLASS(class type, class base)
TelEngine::XmlParent::element
virtual XmlElement * element()
Definition: yatexml.h:540
TelEngine::XmlElement::isDefaultNs
bool isDefaultNs() const
Definition: yatexml.h:1185
TelEngine::XmlDocument::takeRoot
XmlElement * takeRoot(bool completed=false)
Definition: yatexml.h:1038
TelEngine::XmlCData
Xml Declaration.
Definition: yatexml.h:1716
TelEngine::XmlSaxParser::badCharacter
bool badCharacter(char c)
Definition: yatexml.h:348
TelEngine::String::empty
static const String & empty()
TelEngine::XmlElement::empty
bool empty() const
Definition: yatexml.h:1259
TelEngine::XmlElement::findNextChild
XmlElement * findNextChild(const String &name, const XmlElement *prev=0, const String *ns=0, bool noPrefix=true) const
Definition: yatexml.h:1414
TelEngine::XmlSaxParser::gotDoctype
virtual void gotDoctype(const String &doc)
Definition: yatexml.h:437
TelEngine::XmlChild::xmlComment
virtual XmlComment * xmlComment()
Definition: yatexml.h:754
TelEngine::XmlSaxParser::row
unsigned int row() const
Definition: yatexml.h:117
TelEngine::XmlParent::document
virtual XmlDocument * document()
Definition: yatexml.h:524
TelEngine::XmlChild::xmlElement
virtual XmlElement * xmlElement()
Definition: yatexml.h:747
TelEngine::XmlParent
Xml Parent.
Definition: yatexml.h:504
TelEngine::XmlElement::xmlns
String * xmlns() const
Definition: yatexml.h:1541
TelEngine::XmlSaxParser::getBuffer
const String & getBuffer() const
Definition: yatexml.h:193
TelEngine::XmlElement::s_ns
static const String s_ns
Definition: yatexml.h:1637
TelEngine::XmlChild::xmlDeclaration
virtual XmlDeclaration * xmlDeclaration()
Definition: yatexml.h:775
TelEngine::XmlFragment::findElement
static XmlElement * findElement(ObjList *list, const String *name, const String *ns, bool noPrefix=true)
TelEngine::GenObject
Definition: yateclass.h:848
TelEngine::XmlFragment::clearChildren
virtual void clearChildren()
Definition: yatexml.h:926
TelEngine::XmlSaxParser::m_row
unsigned int m_row
Definition: yatexml.h:471