MCPcopy Create free account

hub / github.com/beevik/etree / functions

Functions270 in github.com/beevik/etree

↓ 37 callersFunctionNewDocument
NewDocument creates an XML document without a root element.
etree.go:299
↓ 25 callersFunctioncheckStrEq
(t *testing.T, got, want string)
etree_test.go:35
↓ 23 callersMethodError
Error returns the string describing a path error.
path.go:99
↓ 23 callersMethodWriteToString
WriteToString serializes this document into a string.
etree.go:476
↓ 19 callersMethodCreateElement
CreateElement creates a new element with the specified tag (i.e., name) and adds it as the last child of element 'e'. The tag may include a prefix fol
etree.go:764
↓ 17 callersMethodReadFromString
ReadFromString reads XML from the string 's' into this document.
etree.go:401
↓ 14 callersFunctionnewDocumentFromString
(t *testing.T, s string)
etree_test.go:20
↓ 12 callersFunctionspaceDecompose
spaceDecompose breaks a namespace:tag identifier at the ':' and returns the two parts.
helpers.go:262
↓ 11 callersMethodIndex
()
etree.go:216
↓ 11 callersMethodText
Text returns all character data immediately following the element's opening tag.
etree.go:633
↓ 10 callersMethodIndent
Indent modifies the document's element tree by inserting character data tokens containing newlines and spaces for indentation. The amount of indentati
etree.go:488
↓ 10 callersMethodRoot
Root returns the root element of the document. It returns nil if there is no root element.
etree.go:325
↓ 10 callersMethodSelectElement
SelectElement returns the first child element with the given 'tag' (i.e., name). The function returns nil if no child element matching the tag is foun
etree.go:1056
↓ 9 callersMethodFindElement
FindElement returns the first element matched by the XPath-like 'path' string. The function returns nil if no child element is found using the path. I
etree.go:1088
↓ 9 callersMethodSetText
SetText replaces all character data immediately following an element's opening tag with the requested string.
etree.go:657
↓ 8 callersMethodCreateAttr
CreateAttr creates an attribute with the specified 'key' and 'value' and adds it to this element. If an attribute with same key already exists on this
etree.go:1438
↓ 8 callersMethodaddChild
addChild adds a child token to the element e.
etree.go:1428
↓ 8 callersFunctionnewCharData
newCharData creates a character data token and binds it to a parent element. If parent is nil, the CharData token remains unbound.
etree.go:1563
↓ 8 callersMethodsetIndex
(index int)
etree.go:220
↓ 8 callersFunctionspaceMatch
spaceMatch returns true if namespace a is the empty string or if namespace a equals namespace b.
helpers.go:251
↓ 7 callersMethodRemoveChildAt
RemoveChildAt removes the child token appearing in slot 'index' of this element's list of child tokens. The removed child token is then returned. If t
etree.go:871
↓ 6 callersMethodCreateCData
CreateCData creates a CharData token containing a CDATA section with 'data' as its content and adds it to the end of this element's list of child toke
etree.go:1585
↓ 6 callersMethodCreateComment
CreateComment creates a comment token using the specified 'comment' string and adds it as the last child token of this element.
etree.go:1693
↓ 6 callersMethodCreateProcInst
CreateProcInst creates an XML processing instruction token with the specified 'target' and instruction 'inst'. It is then added as the last child toke
etree.go:1824
↓ 6 callersMethodFindElements
FindElements returns a slice of elements matched by the XPath-like 'path' string. The function returns nil if no child element is found using the path
etree.go:1104
↓ 6 callersMethodIndentWithSettings
IndentWithSettings modifies the document's element tree by inserting character data tokens containing newlines and indentation. The behavior of the in
etree.go:507
↓ 6 callersFunctionNewIndentSettings
NewIndentSettings creates a default IndentSettings record.
etree.go:173
↓ 6 callersMethodParent
()
etree.go:215
↓ 6 callersFunctionnewDocumentFromString2
(t *testing.T, s string, settings ReadSettings)
etree_test.go:24
↓ 5 callersMethodsetParent
(parent *Element)
etree.go:219
↓ 4 callersMethodAddChild
AddChild adds the token 't' as the last child of the element. If token 't' was already the child of another element, it is first removed from its pare
etree.go:793
↓ 4 callersFunctionNewElement
NewElement creates an unparented element with the specified tag (i.e., name). The tag may include a namespace prefix followed by a colon.
etree.go:532
↓ 4 callersMethodRemoveChild
RemoveChild attempts to remove the token 't' from this element's list of child tokens. If the token 't' was a child of this element, then it is remove
etree.go:861
↓ 4 callersMethodWriteTo
(w Writer, s *WriteSettings)
etree.go:217
↓ 4 callersFunctioncheckIntEq
(t *testing.T, got, want int)
etree_test.go:49
↓ 4 callersFunctioncheckTokenIsolation
checkTokenIsolation re-reads the XML string 's', which is expected to contain a lone root element 't' holding a single token. It confirms that the tok
etree_test.go:829
↓ 4 callersMethodlen
()
helpers.go:62
↓ 3 callersMethodChildElements
ChildElements returns all elements that are children of this element.
etree.go:1035
↓ 3 callersMethodCreateCharData
CreateCharData creates a CharData token containing simple text data and adds it to the end of this element's list of child tokens. Deprecated: Create
etree.go:1594
↓ 3 callersMethodCreateDirective
CreateDirective creates an XML directive token with the specified 'data' value and adds it as the last child token of this element.
etree.go:1757
↓ 3 callersMethodCreateText
CreateText creates a CharData token containing simple text data and adds it to the end of this element's list of child tokens.
etree.go:1578
↓ 3 callersMethodFindElementsPathSeq
FindElementsPathSeq returns an iterator over elements matched by the 'path' object.
etree.go:1123
↓ 3 callersMethodIndentTabs
IndentTabs modifies the document's element tree by inserting CharData tokens containing newlines and tabs for indentation. One tab is used per indenta
etree.go:498
↓ 3 callersMethodIndex
Index returns the index of this element within its parent element's list of child tokens. If this element has no parent, then the function returns -1.
etree.go:1386
↓ 3 callersMethodInsertChildAt
InsertChildAt inserts the token 't' into this element's list of child tokens just before the requested 'index'. If the index is greater than or equal
etree.go:834
↓ 3 callersMethodIsWhitespace
IsWhitespace returns true if this CharData token contains only whitespace.
etree.go:1618
↓ 3 callersFunctionMustCompilePath
MustCompilePath creates an optimized version of an XPath-like string that can be used to query elements in an element tree. Panics if an error occurs
path.go:118
↓ 3 callersMethodParent
Parent returns this element's parent element. It returns nil if this element has no parent.
etree.go:1379
↓ 3 callersMethodRead
(p []byte)
helpers.go:89
↓ 3 callersMethodReadFromBytes
ReadFromBytes reads XML from the byte slice 'b' into the this document.
etree.go:390
↓ 3 callersMethodSelectElementsSeq
SelectElementsSeq returns an iterator over all child elements with the given 'tag' (i.e., name). The tag may include a namespace prefix followed by a
etree.go:1072
↓ 3 callersMethodWriteTo
WriteTo serializes the document out to the writer 'w'. The function returns the number of bytes written and any error encountered.
etree.go:445
↓ 3 callersMethodadd
(value E)
helpers.go:42
↓ 3 callersFunctioncheckIndexes
(t *testing.T, e *Element)
etree_test.go:82
↓ 3 callersFunctionescapeString
escapeString writes an escaped version of a string to the writer.
helpers.go:332
↓ 3 callersFunctionnewComment
NewComment creates a comment token and sets its parent element to 'parent'.
etree.go:1679
↓ 3 callersFunctionnewDirective
newDirective creates an XML directive and binds it to a parent element. If parent is nil, the Directive remains unbound.
etree.go:1743
↓ 3 callersFunctionnewElement
newElement is a helper function that creates an element and binds it to a parent element if possible.
etree.go:539
↓ 3 callersFunctionnewProcInst
newProcInst creates an XML processing instruction and binds it to a parent element. If parent is nil, the ProcInst remains unbound.
etree.go:1808
↓ 3 callersMethodreadFrom
ReadFrom reads XML from the reader 'ri' and stores the result as a new child of this element.
etree.go:909
↓ 3 callersMethodreplaceText
replaceText is a helper function that replaces a series of chardata tokens starting at index i with the requested text.
etree.go:705
↓ 3 callersMethodupdatePeekBuf
()
helpers.go:197
↓ 3 callersFunctionvalidateXML
validateXML determines if the data read from the reader 'r' contains well-formed XML according to the rules set by the go xml package.
etree.go:413
↓ 2 callersMethodBytes
()
helpers.go:88
↓ 2 callersFunctionCompilePath
CompilePath creates an optimized version of an XPath-like string that can be used to query elements in an element tree.
path.go:105
↓ 2 callersMethodCopy
Copy creates a recursive, deep copy of the element and all its attributes and children. The returned element has no parent but can be parented to a an
etree.go:558
↓ 2 callersMethodFindElementPath
FindElementPath returns the first element matched by the 'path' object. The function returns nil if no element is found using the path.
etree.go:1094
↓ 2 callersMethodFindElementsPath
FindElementsPath returns a slice of elements matched by the 'path' object.
etree.go:1117
↓ 2 callersMethodFindElementsSeq
FindElementsSeq returns an iterator over elements matched by the XPath-like 'path' string. This function uses Go's iterator support for memory-efficie
etree.go:1112
↓ 2 callersMethodFullTag
FullTag returns the element e's complete tag, including namespace prefix if present.
etree.go:564
↓ 2 callersMethodNamespaceURI
NamespaceURI returns the XML namespace URI associated with this attribute. The function returns the empty string if the attribute is unprefixed or if
etree.go:1512
↓ 2 callersMethodReadFrom
ReadFrom reads XML from the reader 'r' into this document. The function returns the number of bytes read and any error encountered.
etree.go:362
↓ 2 callersMethodReadFromFile
ReadFromFile reads XML from a local file at path 'filepath' into this document.
etree.go:378
↓ 2 callersMethodRemoveAttr
RemoveAttr removes the first attribute of this element whose key matches 'key'. It returns a copy of the removed attribute if a match is found. If no
etree.go:1469
↓ 2 callersMethodSelectAttrValue
SelectAttrValue finds an element attribute matching the requested 'key' and returns its value if found. If no matching attribute is found, the functio
etree.go:1024
↓ 2 callersMethodSelectElements
SelectElements returns a slice of all child elements with the given 'tag' (i.e., name). The tag may include a namespace prefix followed by a colon.
etree.go:1065
↓ 2 callersMethodSetCData
SetCData replaces all character data immediately following an element's opening tag with a CDATA section.
etree.go:663
↓ 2 callersMethodSetRoot
SetRoot replaces the document's root element with the element 'e'. If the document already has a root element when this function is called, then the e
etree.go:338
↓ 2 callersMethodUnindent
Unindent modifies the document's element tree by removing character data tokens containing only whitespace. Other than the removal of indentation, def
etree.go:524
↓ 2 callersMethodWrite
(p []byte)
helpers.go:232
↓ 2 callersMethodaddAttr
addAttr is a helper function that adds an attribute to an element. Returns the index of the added attribute.
etree.go:1454
↓ 2 callersMethodapply
(p *pather)
path.go:163
↓ 2 callersFunctioncheckDocEq
(t *testing.T, doc *Document, expected string)
etree_test.go:70
↓ 2 callersMethoddup
(parent *Element)
etree.go:218
↓ 2 callersMethodempty
()
helpers.go:17
↓ 2 callersMethodfindLocalNamespaceURI
findLocalNamespaceURI finds the namespace URI corresponding to the requested prefix.
etree.go:583
↓ 2 callersFunctiongetIndentFunc
(s *IndentSettings)
etree.go:185
↓ 2 callersMethodindent
indent recursively inserts proper indentation between an XML element's child tokens.
etree.go:1247
↓ 2 callersFunctionisWhitespace
isWhitespace returns true if the byte slice contains only whitespace characters.
helpers.go:240
↓ 2 callersFunctionnewDecoder
newDecoder creates an XML decoder for the reader 'r' configured using the provided read settings.
etree.go:431
↓ 2 callersMethodpeek
()
helpers.go:33
↓ 2 callersMethodpop
()
helpers.go:25
↓ 2 callersMethodremove
()
helpers.go:52
↓ 2 callersMethodtraverse
traverse follows the path from the element e, yielding elements that match the path's selectors and filters using iterators.
path.go:128
↓ 1 callersMethodChildElementsSeq
ChildElementsSeq returns an iterator over all child elements of this element.
etree.go:1041
↓ 1 callersMethodCreateChild
CreateChild performs the same task as CreateElement but calls a continuation function after the child element is created, allowing additional actions
etree.go:784
↓ 1 callersMethodElement
Element returns a pointer to the element containing this attribute.
etree.go:1505
↓ 1 callersMethodFullKey
FullKey returns this attribute's complete key, including namespace prefix if present.
etree.go:1497
↓ 1 callersMethodGetPath
GetPath returns the absolute path of the element. The absolute path is the full path from the document's root.
etree.go:1148
↓ 1 callersMethodGetRelativePath
GetRelativePath returns the path of this element relative to the 'source' element. If the two elements are not part of the same element tree, then the
etree.go:1167
next →1–100 of 270, ranked by callers