diff options
| author | ruki <[email protected]> | 2025-11-15 00:40:08 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-11-15 00:40:08 +0800 |
| commit | dc6a23d0752243d950b81628124fcaa9b907dabe (patch) | |
| tree | 04d65b63f6062c0e15636da283edfd04f65df6be /xmake/core/sandbox/modules/import | |
| parent | e8aa6bd86dcfc67fb2fd5d9bb4319a956097f9c1 (diff) | |
add new apis
Diffstat (limited to 'xmake/core/sandbox/modules/import')
| -rw-r--r-- | xmake/core/sandbox/modules/import/core/base/xml.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/xmake/core/sandbox/modules/import/core/base/xml.lua b/xmake/core/sandbox/modules/import/core/base/xml.lua index 6af763e47..1aed8b159 100644 --- a/xmake/core/sandbox/modules/import/core/base/xml.lua +++ b/xmake/core/sandbox/modules/import/core/base/xml.lua @@ -45,6 +45,15 @@ function sandbox_core_base_xml.decode(data, opt) return node end +-- stream parse xml data +function sandbox_core_base_xml.scan(data, callback, opt) + local ok, errors = xml.scan(data, callback, opt) + if ok == nil then + raise(errors) + end + return ok +end + -- load xml file to the lua table function sandbox_core_base_xml.load(filepath, opt) local node, errors = xml.load(filepath, opt) |
