Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
92432ec2
Commit
92432ec2
authored
Jan 22, 2011
by
Jean-Philippe André
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lua: fix module simplexml using the new API
parent
06fb88fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
share/lua/modules/simplexml.lua
share/lua/modules/simplexml.lua
+9
-10
No files found.
share/lua/modules/simplexml.lua
View file @
92432ec2
...
...
@@ -36,16 +36,15 @@ local function parsexml(stream, errormsg)
local
tree
local
parents
=
{}
local
nodetype
=
reader
:
next_node
()
local
nodetype
,
nodename
=
reader
:
next_node
()
while
nodetype
>
0
do
--print(nodetype, reader:name())
if
nodetype
==
1
then
local
n
ame
=
reader
:
name
()
local
node
=
{
name
=
''
,
attributes
=
{},
children
=
{}
}
node
.
name
=
name
while
reader
:
next_attr
()
==
0
do
node
.
attributes
[
reader
:
name
()]
=
reader
:
value
()
local
n
ode
=
{
name
=
nodename
,
attributes
=
{},
children
=
{}
}
local
attr
=
reader
:
next_attr
()
while
attr
~=
nil
do
node
.
attributes
[
attr
]
=
reader
:
value
()
attr
=
reader
:
next_attr
()
end
if
tree
then
table.insert
(
tree
.
children
,
node
)
...
...
@@ -54,10 +53,8 @@ local function parsexml(stream, errormsg)
tree
=
node
elseif
nodetype
==
2
then
if
#
parents
>
0
then
local
name
=
reader
:
name
()
local
tmp
=
{}
--print(name, tree.name, #parents)
while
name
~=
tree
.
name
do
while
nodename
~=
tree
.
name
do
if
#
parents
==
0
then
error
(
"XML parser error/faulty logic"
)
end
...
...
@@ -80,6 +77,7 @@ local function parsexml(stream, errormsg)
elseif
nodetype
==
3
then
table.insert
(
tree
.
children
,
reader
:
value
())
end
nodetype
,
nodename
=
reader
:
next_node
()
end
if
#
parents
>
0
then
...
...
@@ -108,3 +106,4 @@ function add_name_maps(tree)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment