Code polish

This commit is contained in:
2025-12-19 13:24:44 +01:00
parent a4bbaf9f27
commit 8dd212fc71
2 changed files with 56 additions and 7 deletions

View File

@@ -470,7 +470,8 @@ TABLE FUNCTIONS:
isArray(t) - Returns true if table is a sequential array
XML HELPER FUNCTIONS:
findElements(root, tagName) - Find all elements with specific tag name
findElements(root, tagName) - Find all elements with specific tag name (recursive)
findFirstElement(parent, tagName) - Find first direct child with specific tag name
visitElements(root, callback) - Visit all elements recursively
callback(element, depth, path)
filterElements(root, predicate) - Find elements matching condition
@@ -484,11 +485,15 @@ XML HELPER FUNCTIONS:
setAttr(element, attrName, value) - Set attribute value
getText(element) - Get element text content
setText(element, text) - Set element text content
addChild(parent, child) - Add child element to parent
removeChildren(parent, tagName) - Remove all children with specific tag name
getChildren(parent, tagName) - Get all direct children with specific tag name
countChildren(parent, tagName) - Count direct children with specific tag name
JSON HELPER FUNCTIONS:
visitJSON(data, callback) - Visit all values in JSON structure
visitJSON(data, callback) - Visit all values in JSON structure
callback(value, key, parent)
findInJSON(data, predicate) - Find values matching condition
findInJSON(data, predicate) - Find values matching condition
predicate(value, key, parent) returns true/false
modifyJSONNumbers(data, predicate, modifier) - Modify numeric values
predicate(value, key, parent) returns true/false