TSDuck v3.41-4217
MPEG Transport Stream Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages Concepts
ts::xml Namespace Reference

Namespace for XML classes. More...

Classes

class  Attribute
 Attribute of an XML element. More...
 
class  Comment
 Comment in an XML document. More...
 
class  Declaration
 Declaration in an XML document. More...
 
class  Document
 Representation of an XML document. More...
 
class  Element
 Structured element in an XML document. More...
 
class  JSONConverter
 XML-to-JSON converter. More...
 
class  ModelDocument
 Representation of the model of an XML document. More...
 
class  Node
 Base class for all XML objects in a document. More...
 
class  PatchDocument
 Representation of an XML document which is used to patch another XML document. More...
 
class  RunningDocument
 Representation of a "running" XML document which is displayed on the fly. More...
 
class  Text
 Text element in an XML document. More...
 
class  Tweaks
 Global tweaks to manipulate, parse and format XML documents. More...
 
class  Unknown
 Unknown element in an XML document. More...
 

Typedefs

using ElementVector = std::vector< const Element * >
 Vector of constant elements.
 

Enumerations

enum class  MergeAttributes {
  MergeAttributes::NONE ,
  MergeAttributes::ADD ,
  MergeAttributes::REPLACE
}
 How to process attributes when merging XML elements. More...
 

Variables

static constexpr size_t UNLIMITED = std::numeric_limits<size_t>::max()
 Specify an unlimited number of elements.
 

Detailed Description

Namespace for XML classes.

The XML features of TSDuck are freely inspired from TinyXML-2, a simple and lightweight XML library originally developed by Lee Thomason.

TSDuck used to embed TinyXML-2 in the past but no longer does to allow more specialized operations. This set of classes is probably less fast than TinyXML-2 but TSDuck does not manipulate huge XML files. So, this should be OK.

Among the differences between TinyXML-2 and this set of classes:

  • Uses Unicode strings from the beginning.
  • Error reporting using ts::Report.
  • Case-insensitive search of names and attributes.
  • Getting values and attributes with cardinality and value bounds checks.
  • Print / format any subset of a document.
  • XML document validation using a template.