-
Notifications
You must be signed in to change notification settings - Fork 0
net.rtml.rtmlLoader
Peter edited this page Aug 23, 2024
·
2 revisions
local rtmlLoader = pos.require('net.rtml.rtmlLoader')
Important
This is a loaded library and must loaded and referenced using 'net.rtml.rtmlLoader'
It is NOT injected into the global table
Signature | Return | Description |
---|---|---|
loadFile(filename) |
table? |
Load an RTML file by filename |
load(file) |
table? |
Load RTML from plaintext LUA object or XML |
parseTag(line) |
string?, {string: any}?, boolean?, string? |
Get XML tag name and attributes |
rtmlLoader.loadFile(filename: string): table?
Load an RTML file by filename
-
filename: string
- Path to file to load and parse
-
rtml: table?
- RTML as Lua object ORnil
if it could not be parsed
rtmlLoader.load(file: string): table?
Load RTML from plaintext LUA object or XML
-
file: string
- File as string to parse
-
rtml: table?
- RTML as Lua object ORnil
if it could not be parsed
rtmlLoader.parseTag(line: string): string?, {string: any}?, boolean?, string?
Get XML tag name and attributes. Returns nil
if no tag could be found
-
line: string
- Line to parse for XML tag
-
name: string?
- Name of the tag -
attributes: {string: any}?
- Attribute table of tag (will benil
if tag is closing tag) -
closingTag: boolean?
- If the tag is self closing or a closing tag -
line: string?
- Remaining portion of line after XML tag