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
f3f7dd4d
Commit
f3f7dd4d
authored
Apr 07, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xslt: Import upstream release 1.1.35.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a279c278
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
109 additions
and
157 deletions
+109
-157
extensions.c
libs/xslt/libxslt/extensions.c
+0
-6
extensions.h
libs/xslt/libxslt/extensions.h
+1
-1
functions.c
libs/xslt/libxslt/functions.c
+13
-1
numbers.c
libs/xslt/libxslt/numbers.c
+2
-2
pattern.c
libs/xslt/libxslt/pattern.c
+0
-0
preproc.c
libs/xslt/libxslt/preproc.c
+2
-0
preproc.h
libs/xslt/libxslt/preproc.h
+1
-1
security.c
libs/xslt/libxslt/security.c
+1
-1
templates.c
libs/xslt/libxslt/templates.c
+8
-0
transform.c
libs/xslt/libxslt/transform.c
+11
-113
xslt.c
libs/xslt/libxslt/xslt.c
+2
-6
xsltInternals.h
libs/xslt/libxslt/xsltInternals.h
+15
-11
xsltconfig.h
libs/xslt/libxslt/xsltconfig.h
+3
-3
xsltlocale.c
libs/xslt/libxslt/xsltlocale.c
+2
-1
xsltutils.c
libs/xslt/libxslt/xsltutils.c
+48
-11
No files found.
libs/xslt/libxslt/extensions.c
View file @
f3f7dd4d
...
@@ -1970,12 +1970,6 @@ xsltGetExtInfo(xsltStylesheetPtr style, const xmlChar * URI)
...
@@ -1970,12 +1970,6 @@ xsltGetExtInfo(xsltStylesheetPtr style, const xmlChar * URI)
/************************************************************************
/************************************************************************
* *
* *
* Test module http://xmlsoft.org/XSLT/ *
* *
************************************************************************/
/************************************************************************
* *
* Test of the extension module API *
* Test of the extension module API *
* *
* *
************************************************************************/
************************************************************************/
...
...
libs/xslt/libxslt/extensions.h
View file @
f3f7dd4d
...
@@ -246,7 +246,7 @@ XSLTPUBFUN xmlHashTablePtr XSLTCALL
...
@@ -246,7 +246,7 @@ XSLTPUBFUN xmlHashTablePtr XSLTCALL
const
xmlChar
*
URI
);
const
xmlChar
*
URI
);
/**
/**
* Test
module http://xmlsoft.org/XSLT/
* Test
of the extension module API
*/
*/
XSLTPUBFUN
void
XSLTCALL
XSLTPUBFUN
void
XSLTCALL
xsltRegisterTestModule
(
void
);
xsltRegisterTestModule
(
void
);
...
...
libs/xslt/libxslt/functions.c
View file @
f3f7dd4d
...
@@ -178,10 +178,22 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
...
@@ -178,10 +178,22 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
goto
out_fragment
;
goto
out_fragment
;
}
}
#if LIBXML_VERSION >= 20911 || \
defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
xptrctxt
->
opLimit
=
ctxt
->
context
->
opLimit
;
xptrctxt
->
opCount
=
ctxt
->
context
->
opCount
;
xptrctxt
->
depth
=
ctxt
->
context
->
depth
;
resObj
=
xmlXPtrEval
(
fragment
,
xptrctxt
);
ctxt
->
context
->
opCount
=
xptrctxt
->
opCount
;
#else
resObj
=
xmlXPtrEval
(
fragment
,
xptrctxt
);
resObj
=
xmlXPtrEval
(
fragment
,
xptrctxt
);
xmlXPathFreeContext
(
xptrctxt
);
#endif
#endif
xmlXPathFreeContext
(
xptrctxt
);
#endif
/* LIBXML_XPTR_ENABLED */
if
(
resObj
==
NULL
)
if
(
resObj
==
NULL
)
goto
out_fragment
;
goto
out_fragment
;
...
...
libs/xslt/libxslt/numbers.c
View file @
f3f7dd4d
...
@@ -177,7 +177,7 @@ xsltNumberFormatDecimal(xmlBufferPtr buffer,
...
@@ -177,7 +177,7 @@ xsltNumberFormatDecimal(xmlBufferPtr buffer,
i
=
-
1
;
i
=
-
1
;
break
;
break
;
}
}
*
(
--
pointer
)
=
val
;
*
(
--
pointer
)
=
(
xmlChar
)
val
;
}
}
else
{
else
{
/*
/*
...
@@ -960,7 +960,7 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
...
@@ -960,7 +960,7 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
xmlChar
*
nprefix
,
*
nsuffix
=
NULL
;
xmlChar
*
nprefix
,
*
nsuffix
=
NULL
;
int
prefix_length
,
suffix_length
=
0
,
nprefix_length
,
nsuffix_length
;
int
prefix_length
,
suffix_length
=
0
,
nprefix_length
,
nsuffix_length
;
double
scale
;
double
scale
;
int
j
,
len
;
int
j
,
len
=
0
;
int
self_grouping_len
;
int
self_grouping_len
;
xsltFormatNumberInfo
format_info
;
xsltFormatNumberInfo
format_info
;
/*
/*
...
...
libs/xslt/libxslt/pattern.c
View file @
f3f7dd4d
This diff is collapsed.
Click to expand it.
libs/xslt/libxslt/preproc.c
View file @
f3f7dd4d
...
@@ -1494,6 +1494,8 @@ xsltNumberComp(xsltStylesheetPtr style, xmlNodePtr cur) {
...
@@ -1494,6 +1494,8 @@ xsltNumberComp(xsltStylesheetPtr style, xmlNodePtr cur) {
comp
->
numdata
.
groupingCharacterLen
=
xmlStrlen
(
prop
);
comp
->
numdata
.
groupingCharacterLen
=
xmlStrlen
(
prop
);
comp
->
numdata
.
groupingCharacter
=
comp
->
numdata
.
groupingCharacter
=
xsltGetUTF8Char
(
prop
,
&
(
comp
->
numdata
.
groupingCharacterLen
));
xsltGetUTF8Char
(
prop
,
&
(
comp
->
numdata
.
groupingCharacterLen
));
if
(
comp
->
numdata
.
groupingCharacter
<
0
)
comp
->
numdata
.
groupingCharacter
=
0
;
}
}
prop
=
xsltGetCNsProp
(
style
,
cur
,
(
const
xmlChar
*
)
"grouping-size"
,
XSLT_NAMESPACE
);
prop
=
xsltGetCNsProp
(
style
,
cur
,
(
const
xmlChar
*
)
"grouping-size"
,
XSLT_NAMESPACE
);
...
...
libs/xslt/libxslt/preproc.h
View file @
f3f7dd4d
...
@@ -22,7 +22,7 @@ extern "C" {
...
@@ -22,7 +22,7 @@ extern "C" {
/*
/*
* Interfaces
* Interfaces
*/
*/
extern
const
xmlChar
*
xsltExtMarker
;
XSLTPUBVAR
const
xmlChar
*
xsltExtMarker
;
XSLTPUBFUN
xsltElemPreCompPtr
XSLTCALL
XSLTPUBFUN
xsltElemPreCompPtr
XSLTCALL
xsltDocumentComp
(
xsltStylesheetPtr
style
,
xsltDocumentComp
(
xsltStylesheetPtr
style
,
...
...
libs/xslt/libxslt/security.c
View file @
f3f7dd4d
...
@@ -282,7 +282,7 @@ xsltCheckFilename (const char *path)
...
@@ -282,7 +282,7 @@ xsltCheckFilename (const char *path)
#if defined(_WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(__CYGWIN__)
DWORD
dwAttrs
;
DWORD
dwAttrs
;
dwAttrs
=
GetFileAttributes
(
path
);
dwAttrs
=
GetFileAttributes
A
(
path
);
if
(
dwAttrs
!=
INVALID_FILE_ATTRIBUTES
)
{
if
(
dwAttrs
!=
INVALID_FILE_ATTRIBUTES
)
{
if
(
dwAttrs
&
FILE_ATTRIBUTE_DIRECTORY
)
{
if
(
dwAttrs
&
FILE_ATTRIBUTE_DIRECTORY
)
{
return
2
;
return
2
;
...
...
libs/xslt/libxslt/templates.c
View file @
f3f7dd4d
...
@@ -210,6 +210,8 @@ xsltEvalTemplateString(xsltTransformContextPtr ctxt,
...
@@ -210,6 +210,8 @@ xsltEvalTemplateString(xsltTransformContextPtr ctxt,
{
{
xmlNodePtr
oldInsert
,
insert
=
NULL
;
xmlNodePtr
oldInsert
,
insert
=
NULL
;
xmlChar
*
ret
;
xmlChar
*
ret
;
const
xmlChar
*
oldLastText
;
int
oldLastTextSize
,
oldLastTextUse
;
if
((
ctxt
==
NULL
)
||
(
contextNode
==
NULL
)
||
(
inst
==
NULL
)
||
if
((
ctxt
==
NULL
)
||
(
contextNode
==
NULL
)
||
(
inst
==
NULL
)
||
(
inst
->
type
!=
XML_ELEMENT_NODE
))
(
inst
->
type
!=
XML_ELEMENT_NODE
))
...
@@ -233,12 +235,18 @@ xsltEvalTemplateString(xsltTransformContextPtr ctxt,
...
@@ -233,12 +235,18 @@ xsltEvalTemplateString(xsltTransformContextPtr ctxt,
}
}
oldInsert
=
ctxt
->
insert
;
oldInsert
=
ctxt
->
insert
;
ctxt
->
insert
=
insert
;
ctxt
->
insert
=
insert
;
oldLastText
=
ctxt
->
lasttext
;
oldLastTextSize
=
ctxt
->
lasttsize
;
oldLastTextUse
=
ctxt
->
lasttuse
;
/*
/*
* OPTIMIZE TODO: if inst->children consists only of text-nodes.
* OPTIMIZE TODO: if inst->children consists only of text-nodes.
*/
*/
xsltApplyOneTemplate
(
ctxt
,
contextNode
,
inst
->
children
,
NULL
,
NULL
);
xsltApplyOneTemplate
(
ctxt
,
contextNode
,
inst
->
children
,
NULL
,
NULL
);
ctxt
->
insert
=
oldInsert
;
ctxt
->
insert
=
oldInsert
;
ctxt
->
lasttext
=
oldLastText
;
ctxt
->
lasttsize
=
oldLastTextSize
;
ctxt
->
lasttuse
=
oldLastTextUse
;
ret
=
xmlNodeGetContent
(
insert
);
ret
=
xmlNodeGetContent
(
insert
);
if
(
insert
!=
NULL
)
if
(
insert
!=
NULL
)
...
...
libs/xslt/libxslt/transform.c
View file @
f3f7dd4d
...
@@ -1895,7 +1895,7 @@ static void
...
@@ -1895,7 +1895,7 @@ static void
xsltDefaultProcessOneNode
(
xsltTransformContextPtr
ctxt
,
xmlNodePtr
node
,
xsltDefaultProcessOneNode
(
xsltTransformContextPtr
ctxt
,
xmlNodePtr
node
,
xsltStackElemPtr
params
)
{
xsltStackElemPtr
params
)
{
xmlNodePtr
copy
;
xmlNodePtr
copy
;
xmlNodePtr
delete
=
NULL
,
cur
;
xmlNodePtr
cur
;
int
nbchild
=
0
,
oldSize
;
int
nbchild
=
0
,
oldSize
;
int
childno
=
0
,
oldPos
;
int
childno
=
0
,
oldPos
;
xsltTemplatePtr
template
;
xsltTemplatePtr
template
;
...
@@ -1968,54 +1968,13 @@ xsltDefaultProcessOneNode(xsltTransformContextPtr ctxt, xmlNodePtr node,
...
@@ -1968,54 +1968,13 @@ xsltDefaultProcessOneNode(xsltTransformContextPtr ctxt, xmlNodePtr node,
return
;
return
;
}
}
/*
/*
* Handling of Elements: first pass, c
leanup and c
ounting
* Handling of Elements: first pass, counting
*/
*/
cur
=
node
->
children
;
cur
=
node
->
children
;
while
(
cur
!=
NULL
)
{
while
(
cur
!=
NULL
)
{
switch
(
cur
->
type
)
{
if
(
IS_XSLT_REAL_NODE
(
cur
))
case
XML_TEXT_NODE
:
nbchild
++
;
case
XML_CDATA_SECTION_NODE
:
case
XML_DOCUMENT_NODE
:
case
XML_HTML_DOCUMENT_NODE
:
case
XML_ELEMENT_NODE
:
case
XML_PI_NODE
:
case
XML_COMMENT_NODE
:
nbchild
++
;
break
;
case
XML_DTD_NODE
:
/* Unlink the DTD, it's still reachable using doc->intSubset */
if
(
cur
->
next
!=
NULL
)
cur
->
next
->
prev
=
cur
->
prev
;
if
(
cur
->
prev
!=
NULL
)
cur
->
prev
->
next
=
cur
->
next
;
break
;
default:
#ifdef WITH_XSLT_DEBUG_PROCESS
XSLT_TRACE
(
ctxt
,
XSLT_TRACE_PROCESS_NODE
,
xsltGenericDebug
(
xsltGenericDebugContext
,
"xsltDefaultProcessOneNode: skipping node type %d
\n
"
,
cur
->
type
));
#endif
delete
=
cur
;
}
cur
=
cur
->
next
;
cur
=
cur
->
next
;
if
(
delete
!=
NULL
)
{
#ifdef WITH_XSLT_DEBUG_PROCESS
XSLT_TRACE
(
ctxt
,
XSLT_TRACE_PROCESS_NODE
,
xsltGenericDebug
(
xsltGenericDebugContext
,
"xsltDefaultProcessOneNode: removing ignorable blank node
\n
"
));
#endif
xmlUnlinkNode
(
delete
);
xmlFreeNode
(
delete
);
delete
=
NULL
;
}
}
if
(
delete
!=
NULL
)
{
#ifdef WITH_XSLT_DEBUG_PROCESS
XSLT_TRACE
(
ctxt
,
XSLT_TRACE_PROCESS_NODE
,
xsltGenericDebug
(
xsltGenericDebugContext
,
"xsltDefaultProcessOneNode: removing ignorable blank node
\n
"
));
#endif
xmlUnlinkNode
(
delete
);
xmlFreeNode
(
delete
);
delete
=
NULL
;
}
}
/*
/*
...
@@ -3672,8 +3631,10 @@ xsltDocumentElem(xsltTransformContextPtr ctxt, xmlNodePtr node,
...
@@ -3672,8 +3631,10 @@ xsltDocumentElem(xsltTransformContextPtr ctxt, xmlNodePtr node,
if
(
elements
!=
NULL
)
{
if
(
elements
!=
NULL
)
{
if
(
style
->
stripSpaces
==
NULL
)
if
(
style
->
stripSpaces
==
NULL
)
style
->
stripSpaces
=
xmlHashCreate
(
10
);
style
->
stripSpaces
=
xmlHashCreate
(
10
);
if
(
style
->
stripSpaces
==
NULL
)
if
(
style
->
stripSpaces
==
NULL
)
{
xmlFree
(
elements
);
return
;
return
;
}
element
=
elements
;
element
=
elements
;
while
(
*
element
!=
0
)
{
while
(
*
element
!=
0
)
{
...
@@ -4864,7 +4825,7 @@ xsltApplyTemplates(xsltTransformContextPtr ctxt, xmlNodePtr node,
...
@@ -4864,7 +4825,7 @@ xsltApplyTemplates(xsltTransformContextPtr ctxt, xmlNodePtr node,
xsltStylePreCompPtr
comp
=
(
xsltStylePreCompPtr
)
castedComp
;
xsltStylePreCompPtr
comp
=
(
xsltStylePreCompPtr
)
castedComp
;
#endif
#endif
int
i
;
int
i
;
xmlNodePtr
cur
,
delNode
=
NULL
,
oldContextNode
;
xmlNodePtr
cur
,
oldContextNode
;
xmlNodeSetPtr
list
=
NULL
,
oldList
;
xmlNodeSetPtr
list
=
NULL
,
oldList
;
xsltStackElemPtr
withParams
=
NULL
;
xsltStackElemPtr
withParams
=
NULL
;
int
oldXPProximityPosition
,
oldXPContextSize
;
int
oldXPProximityPosition
,
oldXPContextSize
;
...
@@ -4998,73 +4959,9 @@ xsltApplyTemplates(xsltTransformContextPtr ctxt, xmlNodePtr node,
...
@@ -4998,73 +4959,9 @@ xsltApplyTemplates(xsltTransformContextPtr ctxt, xmlNodePtr node,
else
else
cur
=
NULL
;
cur
=
NULL
;
while
(
cur
!=
NULL
)
{
while
(
cur
!=
NULL
)
{
switch
(
cur
->
type
)
{
if
(
IS_XSLT_REAL_NODE
(
cur
))
case
XML_TEXT_NODE
:
xmlXPathNodeSetAddUnique
(
list
,
cur
);
if
((
IS_BLANK_NODE
(
cur
))
&&
(
cur
->
parent
!=
NULL
)
&&
(
cur
->
parent
->
type
==
XML_ELEMENT_NODE
)
&&
(
ctxt
->
style
->
stripSpaces
!=
NULL
))
{
const
xmlChar
*
val
;
if
(
cur
->
parent
->
ns
!=
NULL
)
{
val
=
(
const
xmlChar
*
)
xmlHashLookup2
(
ctxt
->
style
->
stripSpaces
,
cur
->
parent
->
name
,
cur
->
parent
->
ns
->
href
);
if
(
val
==
NULL
)
{
val
=
(
const
xmlChar
*
)
xmlHashLookup2
(
ctxt
->
style
->
stripSpaces
,
BAD_CAST
"*"
,
cur
->
parent
->
ns
->
href
);
}
}
else
{
val
=
(
const
xmlChar
*
)
xmlHashLookup2
(
ctxt
->
style
->
stripSpaces
,
cur
->
parent
->
name
,
NULL
);
}
if
((
val
!=
NULL
)
&&
(
xmlStrEqual
(
val
,
(
xmlChar
*
)
"strip"
)))
{
delNode
=
cur
;
break
;
}
}
/* Intentional fall-through */
case
XML_ELEMENT_NODE
:
case
XML_DOCUMENT_NODE
:
case
XML_HTML_DOCUMENT_NODE
:
case
XML_CDATA_SECTION_NODE
:
case
XML_PI_NODE
:
case
XML_COMMENT_NODE
:
xmlXPathNodeSetAddUnique
(
list
,
cur
);
break
;
case
XML_DTD_NODE
:
/* Unlink the DTD, it's still reachable
* using doc->intSubset */
if
(
cur
->
next
!=
NULL
)
cur
->
next
->
prev
=
cur
->
prev
;
if
(
cur
->
prev
!=
NULL
)
cur
->
prev
->
next
=
cur
->
next
;
break
;
case
XML_NAMESPACE_DECL
:
break
;
default:
#ifdef WITH_XSLT_DEBUG_PROCESS
XSLT_TRACE
(
ctxt
,
XSLT_TRACE_APPLY_TEMPLATES
,
xsltGenericDebug
(
xsltGenericDebugContext
,
"xsltApplyTemplates: skipping cur type %d
\n
"
,
cur
->
type
));
#endif
delNode
=
cur
;
}
cur
=
cur
->
next
;
cur
=
cur
->
next
;
if
(
delNode
!=
NULL
)
{
#ifdef WITH_XSLT_DEBUG_PROCESS
XSLT_TRACE
(
ctxt
,
XSLT_TRACE_APPLY_TEMPLATES
,
xsltGenericDebug
(
xsltGenericDebugContext
,
"xsltApplyTemplates: removing ignorable blank cur
\n
"
));
#endif
xmlUnlinkNode
(
delNode
);
xmlFreeNode
(
delNode
);
delNode
=
NULL
;
}
}
}
}
}
...
@@ -5121,6 +5018,7 @@ xsltApplyTemplates(xsltTransformContextPtr ctxt, xmlNodePtr node,
...
@@ -5121,6 +5018,7 @@ xsltApplyTemplates(xsltTransformContextPtr ctxt, xmlNodePtr node,
xmlNodePtr
sorts
[
XSLT_MAX_SORT
];
xmlNodePtr
sorts
[
XSLT_MAX_SORT
];
sorts
[
nbsorts
++
]
=
cur
;
sorts
[
nbsorts
++
]
=
cur
;
cur
=
cur
->
next
;
while
(
cur
)
{
while
(
cur
)
{
...
...
libs/xslt/libxslt/xslt.c
View file @
f3f7dd4d
...
@@ -3656,12 +3656,8 @@ xsltPreprocessStylesheet(xsltStylesheetPtr style, xmlNodePtr cur)
...
@@ -3656,12 +3656,8 @@ xsltPreprocessStylesheet(xsltStylesheetPtr style, xmlNodePtr cur)
(
!
xsltCheckExtURI
(
style
,
cur
->
ns
->
href
)))
{
(
!
xsltCheckExtURI
(
style
,
cur
->
ns
->
href
)))
{
goto
skip_children
;
goto
skip_children
;
}
else
if
(
cur
->
children
!=
NULL
)
{
}
else
if
(
cur
->
children
!=
NULL
)
{
if
((
cur
->
children
->
type
!=
XML_ENTITY_DECL
)
&&
cur
=
cur
->
children
;
(
cur
->
children
->
type
!=
XML_ENTITY_REF_NODE
)
&&
continue
;
(
cur
->
children
->
type
!=
XML_ENTITY_NODE
))
{
cur
=
cur
->
children
;
continue
;
}
}
}
skip_children:
skip_children:
...
...
libs/xslt/libxslt/xsltInternals.h
View file @
f3f7dd4d
...
@@ -291,6 +291,9 @@ struct _xsltTemplate {
...
@@ -291,6 +291,9 @@ struct _xsltTemplate {
int
templMax
;
/* Size of the templtes stack */
int
templMax
;
/* Size of the templtes stack */
xsltTemplatePtr
*
templCalledTab
;
/* templates called */
xsltTemplatePtr
*
templCalledTab
;
/* templates called */
int
*
templCountTab
;
/* .. and how often */
int
*
templCountTab
;
/* .. and how often */
/* Conflict resolution */
int
position
;
};
};
/**
/**
...
@@ -1500,17 +1503,18 @@ struct _xsltStylesheet {
...
@@ -1500,17 +1503,18 @@ struct _xsltStylesheet {
/*
/*
* Template descriptions.
* Template descriptions.
*/
*/
xsltTemplatePtr
templates
;
/* the ordered list of templates */
xsltTemplatePtr
templates
;
/* the ordered list of templates */
void
*
templatesHash
;
/* hash table or wherever compiled templates
xmlHashTablePtr
templatesHash
;
/* hash table or wherever compiled
information is stored */
templates information is stored */
void
*
rootMatch
;
/* template based on / */
struct
_xsltCompMatch
*
rootMatch
;
/* template based on / */
void
*
keyMatch
;
/* template based on key() */
struct
_xsltCompMatch
*
keyMatch
;
/* template based on key() */
void
*
elemMatch
;
/* template based on * */
struct
_xsltCompMatch
*
elemMatch
;
/* template based on * */
void
*
attrMatch
;
/* template based on @* */
struct
_xsltCompMatch
*
attrMatch
;
/* template based on @* */
void
*
parentMatch
;
/* template based on .. */
struct
_xsltCompMatch
*
parentMatch
;
/* template based on .. */
void
*
textMatch
;
/* template based on text() */
struct
_xsltCompMatch
*
textMatch
;
/* template based on text() */
void
*
piMatch
;
/* template based on processing-instruction() */
struct
_xsltCompMatch
*
piMatch
;
/* template based on
void
*
commentMatch
;
/* template based on comment() */
processing-instruction() */
struct
_xsltCompMatch
*
commentMatch
;
/* template based on comment() */
/*
/*
* Namespace aliases.
* Namespace aliases.
...
...
libs/xslt/libxslt/xsltconfig.h
View file @
f3f7dd4d
...
@@ -20,21 +20,21 @@ extern "C" {
...
@@ -20,21 +20,21 @@ extern "C" {
*
*
* the version string like "1.2.3"
* the version string like "1.2.3"
*/
*/
#define LIBXSLT_DOTTED_VERSION "1.1.3
4
"
#define LIBXSLT_DOTTED_VERSION "1.1.3
5
"
/**
/**
* LIBXSLT_VERSION:
* LIBXSLT_VERSION:
*
*
* the version number: 1.2.3 value is 10203
* the version number: 1.2.3 value is 10203
*/
*/
#define LIBXSLT_VERSION 1013
4
#define LIBXSLT_VERSION 1013
5
/**
/**
* LIBXSLT_VERSION_STRING:
* LIBXSLT_VERSION_STRING:
*
*
* the version number string, 1.2.3 value is "10203"
* the version number string, 1.2.3 value is "10203"
*/
*/
#define LIBXSLT_VERSION_STRING "1013
4
"
#define LIBXSLT_VERSION_STRING "1013
5
"
/**
/**
* LIBXSLT_VERSION_EXTRA:
* LIBXSLT_VERSION_EXTRA:
...
...
libs/xslt/libxslt/xsltlocale.c
View file @
f3f7dd4d
...
@@ -346,7 +346,8 @@ xsltDefaultRegion(const xmlChar *localeName) {
...
@@ -346,7 +346,8 @@ xsltDefaultRegion(const xmlChar *localeName) {
void
void
xsltFreeLocale
(
xsltLocale
locale
)
{
xsltFreeLocale
(
xsltLocale
locale
)
{
#ifdef XSLT_LOCALE_POSIX
#ifdef XSLT_LOCALE_POSIX
freelocale
(
locale
);
if
(
locale
!=
NULL
)
freelocale
(
locale
);
#endif
#endif
}
}
...
...
libs/xslt/libxslt/xsltutils.c
View file @
f3f7dd4d
...
@@ -948,17 +948,19 @@ xsltDocumentSortFunction(xmlNodeSetPtr list) {
...
@@ -948,17 +948,19 @@ xsltDocumentSortFunction(xmlNodeSetPtr list) {
}
}
/**
/**
* xsltComputeSortResult:
* xsltComputeSortResult
iInternal
:
* @ctxt: a XSLT process context
* @ctxt: a XSLT process context
* @sort: node list
* @sort: node list
* @xfrm: Transform strings according to locale
*
*
* reorder the current node list accordingly to the set of sorting
* reorder the current node list accordingly to the set of sorting
* requirement provided by the array of nodes.
* requirement provided by the array of nodes.
*
*
* Returns a ordered XPath nodeset or NULL in case of error.
* Returns a ordered XPath nodeset or NULL in case of error.
*/
*/
xmlXPathObjectPtr
*
static
xmlXPathObjectPtr
*
xsltComputeSortResult
(
xsltTransformContextPtr
ctxt
,
xmlNodePtr
sort
)
{
xsltComputeSortResultInternal
(
xsltTransformContextPtr
ctxt
,
xmlNodePtr
sort
,
int
xfrm
)
{
#ifdef XSLT_REFACTORED
#ifdef XSLT_REFACTORED
xsltStyleItemSortPtr
comp
;
xsltStyleItemSortPtr
comp
;
#else
#else
...
@@ -1045,7 +1047,7 @@ xsltComputeSortResult(xsltTransformContextPtr ctxt, xmlNodePtr sort) {
...
@@ -1045,7 +1047,7 @@ xsltComputeSortResult(xsltTransformContextPtr ctxt, xmlNodePtr sort) {
}
}
}
else
{
}
else
{
if
(
res
->
type
==
XPATH_STRING
)
{
if
(
res
->
type
==
XPATH_STRING
)
{
if
(
comp
->
locale
!=
(
xsltLocale
)
0
)
{
if
(
(
xfrm
)
&&
(
comp
->
locale
!=
(
xsltLocale
)
0
)
)
{
xmlChar
*
str
=
res
->
stringval
;
xmlChar
*
str
=
res
->
stringval
;
res
->
stringval
=
(
xmlChar
*
)
xsltStrxfrm
(
comp
->
locale
,
str
);
res
->
stringval
=
(
xmlChar
*
)
xsltStrxfrm
(
comp
->
locale
,
str
);
xmlFree
(
str
);
xmlFree
(
str
);
...
@@ -1076,6 +1078,21 @@ xsltComputeSortResult(xsltTransformContextPtr ctxt, xmlNodePtr sort) {
...
@@ -1076,6 +1078,21 @@ xsltComputeSortResult(xsltTransformContextPtr ctxt, xmlNodePtr sort) {
}
}
/**
/**
* xsltComputeSortResult:
* @ctxt: a XSLT process context
* @sort: node list
*
* reorder the current node list accordingly to the set of sorting
* requirement provided by the array of nodes.
*
* Returns a ordered XPath nodeset or NULL in case of error.
*/
xmlXPathObjectPtr
*
xsltComputeSortResult
(
xsltTransformContextPtr
ctxt
,
xmlNodePtr
sort
)
{
return
xsltComputeSortResultInternal
(
ctxt
,
sort
,
/* xfrm */
0
);
}
/**
* xsltDefaultSortFunction:
* xsltDefaultSortFunction:
* @ctxt: a XSLT process context
* @ctxt: a XSLT process context
* @sorts: array of sort nodes
* @sorts: array of sort nodes
...
@@ -1102,7 +1119,8 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
...
@@ -1102,7 +1119,8 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
int
depth
;
int
depth
;
xmlNodePtr
node
;
xmlNodePtr
node
;
xmlXPathObjectPtr
tmp
;
xmlXPathObjectPtr
tmp
;
int
tempstype
[
XSLT_MAX_SORT
],
temporder
[
XSLT_MAX_SORT
];
int
tempstype
[
XSLT_MAX_SORT
],
temporder
[
XSLT_MAX_SORT
],
templang
[
XSLT_MAX_SORT
];
if
((
ctxt
==
NULL
)
||
(
sorts
==
NULL
)
||
(
nbsorts
<=
0
)
||
if
((
ctxt
==
NULL
)
||
(
sorts
==
NULL
)
||
(
nbsorts
<=
0
)
||
(
nbsorts
>=
XSLT_MAX_SORT
))
(
nbsorts
>=
XSLT_MAX_SORT
))
...
@@ -1124,7 +1142,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
...
@@ -1124,7 +1142,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
comp
->
stype
=
comp
->
stype
=
xsltEvalAttrValueTemplate
(
ctxt
,
sorts
[
j
],
xsltEvalAttrValueTemplate
(
ctxt
,
sorts
[
j
],
(
const
xmlChar
*
)
"data-type"
,
(
const
xmlChar
*
)
"data-type"
,
XSLT_NAMESPACE
);
NULL
);
if
(
comp
->
stype
!=
NULL
)
{
if
(
comp
->
stype
!=
NULL
)
{
tempstype
[
j
]
=
1
;
tempstype
[
j
]
=
1
;
if
(
xmlStrEqual
(
comp
->
stype
,
(
const
xmlChar
*
)
"text"
))
if
(
xmlStrEqual
(
comp
->
stype
,
(
const
xmlChar
*
)
"text"
))
...
@@ -1143,7 +1161,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
...
@@ -1143,7 +1161,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
if
((
comp
->
order
==
NULL
)
&&
(
comp
->
has_order
!=
0
))
{
if
((
comp
->
order
==
NULL
)
&&
(
comp
->
has_order
!=
0
))
{
comp
->
order
=
xsltEvalAttrValueTemplate
(
ctxt
,
sorts
[
j
],
comp
->
order
=
xsltEvalAttrValueTemplate
(
ctxt
,
sorts
[
j
],
(
const
xmlChar
*
)
"order"
,
(
const
xmlChar
*
)
"order"
,
XSLT_NAMESPACE
);
NULL
);
if
(
comp
->
order
!=
NULL
)
{
if
(
comp
->
order
!=
NULL
)
{
temporder
[
j
]
=
1
;
temporder
[
j
]
=
1
;
if
(
xmlStrEqual
(
comp
->
order
,
(
const
xmlChar
*
)
"ascending"
))
if
(
xmlStrEqual
(
comp
->
order
,
(
const
xmlChar
*
)
"ascending"
))
...
@@ -1159,11 +1177,23 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
...
@@ -1159,11 +1177,23 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
}
}
}
}
}
}
templang
[
j
]
=
0
;
if
((
comp
->
lang
==
NULL
)
&&
(
comp
->
has_lang
!=
0
))
{
xmlChar
*
lang
=
xsltEvalAttrValueTemplate
(
ctxt
,
sorts
[
j
],
(
xmlChar
*
)
"lang"
,
NULL
);
if
(
lang
!=
NULL
)
{
templang
[
j
]
=
1
;
comp
->
locale
=
xsltNewLocale
(
lang
);
xmlFree
(
lang
);
}
}
}
}
len
=
list
->
nodeNr
;
len
=
list
->
nodeNr
;
resultsTab
[
0
]
=
xsltComputeSortResult
(
ctxt
,
sorts
[
0
]);
resultsTab
[
0
]
=
xsltComputeSortResultInternal
(
ctxt
,
sorts
[
0
],
/* xfrm */
1
);
for
(
i
=
1
;
i
<
XSLT_MAX_SORT
;
i
++
)
for
(
i
=
1
;
i
<
XSLT_MAX_SORT
;
i
++
)
resultsTab
[
i
]
=
NULL
;
resultsTab
[
i
]
=
NULL
;
...
@@ -1173,7 +1203,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
...
@@ -1173,7 +1203,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
descending
=
comp
->
descending
;
descending
=
comp
->
descending
;
number
=
comp
->
number
;
number
=
comp
->
number
;
if
(
results
==
NULL
)
if
(
results
==
NULL
)
return
;
goto
cleanup
;
/* Shell's sort of node-set */
/* Shell's sort of node-set */
for
(
incr
=
len
/
2
;
incr
>
0
;
incr
/=
2
)
{
for
(
incr
=
len
/
2
;
incr
>
0
;
incr
/=
2
)
{
...
@@ -1234,8 +1264,10 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
...
@@ -1234,8 +1264,10 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
* full set, this might be optimized ... or not
* full set, this might be optimized ... or not
*/
*/
if
(
resultsTab
[
depth
]
==
NULL
)
if
(
resultsTab
[
depth
]
==
NULL
)
resultsTab
[
depth
]
=
xsltComputeSortResult
(
ctxt
,
resultsTab
[
depth
]
=
sorts
[
depth
]);
xsltComputeSortResultInternal
(
ctxt
,
sorts
[
depth
],
/* xfrm */
1
);
res
=
resultsTab
[
depth
];
res
=
resultsTab
[
depth
];
if
(
res
==
NULL
)
if
(
res
==
NULL
)
break
;
break
;
...
@@ -1315,6 +1347,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
...
@@ -1315,6 +1347,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
}
}
}
}
cleanup:
for
(
j
=
0
;
j
<
nbsorts
;
j
++
)
{
for
(
j
=
0
;
j
<
nbsorts
;
j
++
)
{
comp
=
sorts
[
j
]
->
psvi
;
comp
=
sorts
[
j
]
->
psvi
;
if
(
tempstype
[
j
]
==
1
)
{
if
(
tempstype
[
j
]
==
1
)
{
...
@@ -1327,6 +1360,10 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
...
@@ -1327,6 +1360,10 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
xmlFree
((
void
*
)(
comp
->
order
));
xmlFree
((
void
*
)(
comp
->
order
));
comp
->
order
=
NULL
;
comp
->
order
=
NULL
;
}
}
if
(
templang
[
j
]
==
1
)
{
xsltFreeLocale
(
comp
->
locale
);
comp
->
locale
=
(
xsltLocale
)
0
;
}
if
(
resultsTab
[
j
]
!=
NULL
)
{
if
(
resultsTab
[
j
]
!=
NULL
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
for
(
i
=
0
;
i
<
len
;
i
++
)
xmlXPathFreeObject
(
resultsTab
[
j
][
i
]);
xmlXPathFreeObject
(
resultsTab
[
j
][
i
]);
...
...
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