Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
e1691496
Commit
e1691496
authored
Nov 02, 2010
by
Adam Martinson
Committed by
Alexandre Julliard
Nov 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Implement XSLPattern collection methods.
parent
42ccbc51
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
186 additions
and
147 deletions
+186
-147
queryresult.c
dlls/msxml3/queryresult.c
+0
-1
domdoc.c
dlls/msxml3/tests/domdoc.c
+89
-134
xslpattern.y
dlls/msxml3/xslpattern.y
+97
-12
No files found.
dlls/msxml3/queryresult.c
View file @
e1691496
...
...
@@ -522,7 +522,6 @@ HRESULT queryresult_create(xmlNodePtr node, LPCWSTR szQuery, IXMLDOMNodeList **o
{
xmlChar
*
tmp
;
int
len
;
WARN
(
"Attempting XSLPattern emulation (experimental).
\n
"
);
tmp
=
XSLPattern_to_XPath
(
ctxt
,
str
);
len
=
(
xmlStrlen
(
tmp
)
+
1
)
*
sizeof
(
xmlChar
);
str
=
heap_realloc
(
str
,
len
);
...
...
dlls/msxml3/tests/domdoc.c
View file @
e1691496
This diff is collapsed.
Click to expand it.
dlls/msxml3/xslpattern.y
View file @
e1691496
...
...
@@ -34,6 +34,13 @@ static const xmlChar NameTest_mod_post[] = "']";
#define U(str) BAD_CAST str
static inline BOOL is_literal(xmlChar const* tok)
{
return (tok && tok[0] && tok[1] &&
tok[0]== tok[xmlStrlen(tok)-1] &&
(tok[0] == '\'' || tok[0] == '"'));
}
%}
%token TOK_Parent TOK_Self TOK_DblFSlash TOK_FSlash TOK_Axis TOK_Colon
...
...
@@ -54,6 +61,8 @@ static const xmlChar NameTest_mod_post[] = "']";
%left TOK_OpEq TOK_OpIEq TOK_OpNEq TOK_OpINEq
%left TOK_OpLt TOK_OpILt TOK_OpGt TOK_OpIGt TOK_OpLEq TOK_OpILEq TOK_OpGEq TOK_OpIGEq
%expect 14
%%
XSLPattern : Expr
...
...
@@ -118,7 +127,7 @@ static const xmlChar NameTest_mod_post[] = "']";
| AbbreviatedRelativeLocationPath
;
/* [2.1] Location Steps */
Step : AxisSpecifier N
am
eTest Predicates
Step : AxisSpecifier N
od
eTest Predicates
{
TRACE("Got Step: \"%s%s%s\"\n", $1, $2, $3);
$$=$1;
...
...
@@ -127,21 +136,21 @@ static const xmlChar NameTest_mod_post[] = "']";
$$=xmlStrcat($$,$3);
xmlFree($3);
}
| N
am
eTest Predicates
| N
od
eTest Predicates
{
TRACE("Got Step: \"%s%s\"\n", $1, $2);
$$=$1;
$$=xmlStrcat($$,$2);
xmlFree($2);
}
| AxisSpecifier N
am
eTest
| AxisSpecifier N
od
eTest
{
TRACE("Got Step: \"%s%s\"\n", $1, $2);
$$=$1;
$$=xmlStrcat($$,$2);
xmlFree($2);
}
| N
am
eTest
| N
od
eTest
| Attribute
| AbbreviatedStep
;
...
...
@@ -162,6 +171,9 @@ static const xmlChar NameTest_mod_post[] = "']";
;
/* [2.3] Node Tests */
NodeTest : NameTest
| FunctionCall
;
NameTest : '*'
{
TRACE("Got NameTest: \"*\"\n");
...
...
@@ -285,23 +297,96 @@ static const xmlChar NameTest_mod_post[] = "']";
}
| TOK_Literal
| TOK_Number
| FunctionCall
;
/* [3.2] Function Calls */
FunctionCall : QName '(' Arguments ')'
{
TRACE("Got FunctionCall: \"%s(%s)\"\n", $1, $3);
$$=$1;
$$=xmlStrcat($$,U("("));
$$=xmlStrcat($$,$3);
xmlFree($3);
$$=xmlStrcat($$,U(")"));
if (xmlStrEqual($1,U("ancestor")))
{
$$=$1;
$$=xmlStrcat($$,U("::"));
$$=xmlStrcat($$,$3);
xmlFree($3);
}
else if (xmlStrEqual($1,U("attribute")))
{
if (is_literal($3))
{
$$=xmlStrdup(U("@*[name()="));
xmlFree($1);
$$=xmlStrcat($$,$3);
xmlFree($3);
$$=xmlStrcat($$,U("]"));
}
else
{
/* XML_XPATH_INVALID_TYPE */
$$=xmlStrdup(U("error(1211, 'Error: attribute("));
xmlFree($1);
$$=xmlStrcat($$,$3);
xmlFree($3);
$$=xmlStrcat($$,U("): invalid argument')"));
}
}
else if (xmlStrEqual($1,U("element")))
{
if (is_literal($3))
{
$$=xmlStrdup(U("node()[nodeType()=1][name()="));
xmlFree($1);
$$=xmlStrcat($$,$3);
xmlFree($3);
$$=xmlStrcat($$,U("]"));
}
else
{
/* XML_XPATH_INVALID_TYPE */
$$=xmlStrdup(U("error(1211, 'Error: element("));
xmlFree($1);
$$=xmlStrcat($$,$3);
xmlFree($3);
$$=xmlStrcat($$,U("): invalid argument')"));
}
}
else
{
$$=$1;
$$=xmlStrcat($$,U("("));
$$=xmlStrcat($$,$3);
xmlFree($3);
$$=xmlStrcat($$,U(")"));
}
}
| QName '(' ')'
{
TRACE("Got FunctionCall: \"%s()\"\n", $1);
$$=$1;
$$=xmlStrcat($$,U("()"));
/* comment() & node() work the same in XPath */
if (xmlStrEqual($1,U("attribute")))
{
$$=xmlStrdup(U("@*"));
xmlFree($1);
}
else if (xmlStrEqual($1,U("element")))
{
$$=xmlStrdup(U("node()[nodeType()=1]"));
xmlFree($1);
}
else if (xmlStrEqual($1,U("pi")))
{
$$=xmlStrdup(U("processing-instruction()"));
xmlFree($1);
}
else if (xmlStrEqual($1,U("textnode")))
{
$$=xmlStrdup(U("text()"));
xmlFree($1);
}
else
{
$$=$1;
$$=xmlStrcat($$,U("()"));
}
}
;
Arguments : Argument ',' Arguments
...
...
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