Documentation
¶
Index ¶
- func AddByXPathFromFile(inputFile, outputFile, expr, key, value string) error
- func AddByXPathFromString(xmlStr, expr, key, value string) (string, error)
- func RemoveByXPathFromFile(inputFile, outputFile, expr string) error
- func RemoveByXPathFromString(xmlStr, expr string) (string, error)
- func UpdateByXPathFromFile(inputFile, outputFile, expr, newValue string) error
- func UpdateByXPathFromString(xmlStr, expr, newValue string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddByXPathFromFile ¶
AddByXPathFromFile adds a node or attribute at the XPath location in the XML document. If the XPath targets an attribute, it will be added to the parent node. If the XPath targets an element, a new child node with the specified value will be created.
func AddByXPathFromString ¶
AddByXPathFromString adds a node or attribute at the XPath location in the given XML string. Returns the updated XML string or an error if the operation fails.
func RemoveByXPathFromFile ¶
RemoveByXPathFromFile removes a node or attribute at the specified XPath from the XML document. If the XPath targets an attribute, it will be removed from the parent node. If the XPath targets an element, the node and its subtree will be removed.
func RemoveByXPathFromString ¶
RemoveByXPathFromString removes a node or attribute at the specified XPath from the given XML string. Returns the updated XML string or an error if the operation fails.
func UpdateByXPathFromFile ¶
UpdateByXPathFromFile updates the value of a node or attribute at the specified XPath in the XML document. If the XPath targets an attribute, its value is updated. If the XPath targets an element, its content is replaced.
func UpdateByXPathFromString ¶
UpdateByXPathFromString updates the value of a node or attribute at the specified XPath in the XML string. Returns the updated XML string or an error if the operation fails.
Types ¶
This section is empty.