Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
6ab47275
Commit
6ab47275
authored
Jan 23, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite: Complete content parsing with implemented parts and stubs.
parent
d6105c5f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
7 deletions
+55
-7
reader.c
dlls/xmllite/reader.c
+50
-6
reader.c
dlls/xmllite/tests/reader.c
+5
-1
No files found.
dlls/xmllite/reader.c
View file @
6ab47275
...
...
@@ -69,7 +69,10 @@ static const WCHAR utf8W[] = {'U','T','F','-','8',0};
static
const
WCHAR
dblquoteW
[]
=
{
'\"'
,
0
};
static
const
WCHAR
quoteW
[]
=
{
'\''
,
0
};
static
const
WCHAR
ltW
[]
=
{
'<'
,
0
};
static
const
WCHAR
gtW
[]
=
{
'>'
,
0
};
static
const
WCHAR
commentW
[]
=
{
'<'
,
'!'
,
'-'
,
'-'
,
0
};
static
const
WCHAR
piW
[]
=
{
'<'
,
'?'
,
0
};
struct
xml_encoding_data
{
...
...
@@ -1264,8 +1267,6 @@ static HRESULT reader_parse_misc(xmlreader *reader)
while
(
1
)
{
static
const
WCHAR
commentW
[]
=
{
'<'
,
'!'
,
'-'
,
'-'
,
0
};
static
const
WCHAR
piW
[]
=
{
'<'
,
'?'
,
0
};
const
WCHAR
*
cur
=
reader_get_cur
(
reader
);
if
(
is_wchar_space
(
*
cur
))
...
...
@@ -1519,7 +1520,6 @@ static HRESULT reader_parse_stag(xmlreader *reader, strval *prefix, strval *loca
/* [39] element ::= EmptyElemTag | STag content ETag */
static
HRESULT
reader_parse_element
(
xmlreader
*
reader
)
{
static
const
WCHAR
ltW
[]
=
{
'<'
,
0
};
strval
qname
,
prefix
,
local
;
HRESULT
hr
;
int
empty
;
...
...
@@ -1584,18 +1584,62 @@ static HRESULT reader_parse_endtag(xmlreader *reader)
return
S_OK
;
}
/* [18] CDSect ::= CDStart CData CDEnd
[19] CDStart ::= '<![CDATA['
[20] CData ::= (Char* - (Char* ']]>' Char*))
[21] CDEnd ::= ']]>' */
static
HRESULT
reader_parse_cdata
(
xmlreader
*
reader
)
{
FIXME
(
"CDATA sections are not supported
\n
"
);
return
E_NOTIMPL
;
}
/* [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'
[67] Reference ::= EntityRef | CharRef
[68] EntityRef ::= '&' Name ';' */
static
HRESULT
reader_parse_reference
(
xmlreader
*
reader
)
{
FIXME
(
"References not supported
\n
"
);
return
E_NOTIMPL
;
}
/* [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) */
static
HRESULT
reader_parse_chardata
(
xmlreader
*
reader
)
{
FIXME
(
"CharData not supported
\n
"
);
return
E_NOTIMPL
;
}
/* [43] content ::= CharData? ((element | Reference | CDSect | PI | Comment) CharData?)* */
static
HRESULT
reader_parse_content
(
xmlreader
*
reader
)
{
static
const
WCHAR
cdstartW
[]
=
{
'<'
,
'!'
,
'['
,
'C'
,
'D'
,
'A'
,
'T'
,
'A'
,
'['
,
0
};
static
const
WCHAR
etagW
[]
=
{
'<'
,
'/'
,
0
};
static
const
WCHAR
ampW
[]
=
{
'&'
,
0
};
reader_shrink
(
reader
);
/* handle end tag */
/* handle end tag
here, it indicates end of content as well
*/
if
(
!
reader_cmp
(
reader
,
etagW
))
return
reader_parse_endtag
(
reader
);
/* FIXME: handle the rest of possible content nodes */
return
reader_parse_element
(
reader
);
if
(
!
reader_cmp
(
reader
,
commentW
))
return
reader_parse_comment
(
reader
);
if
(
!
reader_cmp
(
reader
,
piW
))
return
reader_parse_pi
(
reader
);
if
(
!
reader_cmp
(
reader
,
cdstartW
))
return
reader_parse_cdata
(
reader
);
if
(
!
reader_cmp
(
reader
,
ampW
))
return
reader_parse_reference
(
reader
);
if
(
!
reader_cmp
(
reader
,
ltW
))
return
reader_parse_element
(
reader
);
/* what's left must be CharData */
return
reader_parse_chardata
(
reader
);
}
static
HRESULT
reader_parse_nextnode
(
xmlreader
*
reader
)
...
...
dlls/xmllite/tests/reader.c
View file @
6ab47275
...
...
@@ -877,7 +877,7 @@ static void test_read_pi(void)
struct
nodes_test
{
const
char
*
xml
;
XmlNodeType
types
[
1
0
];
XmlNodeType
types
[
2
0
];
};
static
const
char
misc_test_xml
[]
=
...
...
@@ -889,6 +889,8 @@ static const char misc_test_xml[] =
"<!-- comment4 -->"
"<a>"
"<b/>"
"<!-- comment -->"
"<?pi pibody ?>"
"</a>"
;
...
...
@@ -903,6 +905,8 @@ static struct nodes_test misc_test = {
XmlNodeType_Comment
,
XmlNodeType_Element
,
XmlNodeType_Element
,
XmlNodeType_Comment
,
XmlNodeType_ProcessingInstruction
,
XmlNodeType_EndElement
,
XmlNodeType_None
}
...
...
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