Classes
The following classes are available globally.
-
Instances of this class parse XML documents into a tree of DOM objects.
See moreDeclaration
Swift
public class Parser
-
The
See moreDocumentclass represents the entire document. Conceptually, it is the root of the document tree, and provides the primary access to the document’s data.Declaration
Swift
public final class Document: ParentNode
-
By far the vast majority of objects (apart from text) that authors encounter when traversing a document are Element nodes. Assume the following XML document:
<elementExample id="demo"> <subelement1/> <subelement2><subsubelement/></subelement2> </elementExample>When represented using the DOM, the top node is an
Elementnode forelementExample, which contains two childElementnodes, one forsubelement1and one forsubelement2.subelement1contains no child nodes.Elements may have attributes associated with them; since the
See moreElementclass implements theNodeprotocol, theattributesproperty of theNodeprotocol may be used to retrieve a dictionary of the attributes for an element.Declaration
Swift
public final class Element: ParentNode
-
The
See moreTextclass represents the textual content (termed character data in XML) of anElement. If there is no markup inside an element’s content, the text is contained in a single object implementing theTextprotocol that is the only child of the element. If there is markup, it is parsed into a sequence of elements andTextnodes that form the array of children of the element.Declaration
Swift
public final class Text: TextNode
-
CDATA sections are used to escape blocks of text containing characters that would otherwise be regarded as markup. The only delimiter that is recognized in a CDATA section is the
"]]>"string that ends the CDATA section. CDATA sections can not be nested. The primary purpose is for including material such as XML fragments, without needing to escape all the delimiters.The
See moretextproperty holds the text that is contained by the CDATA section. Note that this may contain characters that need to be escaped outside of CDATA sections.Declaration
Swift
public final class CDATASection: TextNode
View on GitHub
Install in Dash
Classes Reference