Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
25d5529e
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
25d5529e
编写于
6月 05, 2019
作者:
S
stooke
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8193830: Xalan Update: Xalan Java 2.7.2
Reviewed-by: lancea, clanger, andrew
上级
5aa20f52
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
501 addition
and
1 deletion
+501
-1
THIRD_PARTY_README
THIRD_PARTY_README
+1
-1
test/javax/xml/jaxp/transform/sort/SortTest.java
test/javax/xml/jaxp/transform/sort/SortTest.java
+126
-0
test/javax/xml/jaxp/transform/sort/sort-alphabet-english.out
test/javax/xml/jaxp/transform/sort/sort-alphabet-english.out
+30
-0
test/javax/xml/jaxp/transform/sort/sort-alphabet-english.xml
test/javax/xml/jaxp/transform/sort/sort-alphabet-english.xml
+46
-0
test/javax/xml/jaxp/transform/sort/sort-alphabet-english.xsl
test/javax/xml/jaxp/transform/sort/sort-alphabet-english.xsl
+40
-0
test/javax/xml/jaxp/transform/sort/sort-alphabet-polish.out
test/javax/xml/jaxp/transform/sort/sort-alphabet-polish.out
+37
-0
test/javax/xml/jaxp/transform/sort/sort-alphabet-polish.xml
test/javax/xml/jaxp/transform/sort/sort-alphabet-polish.xml
+52
-0
test/javax/xml/jaxp/transform/sort/sort-alphabet-polish.xsl
test/javax/xml/jaxp/transform/sort/sort-alphabet-polish.xsl
+39
-0
test/javax/xml/jaxp/transform/sort/sort-alphabet-russian.out
test/javax/xml/jaxp/transform/sort/sort-alphabet-russian.out
+38
-0
test/javax/xml/jaxp/transform/sort/sort-alphabet-russian.xml
test/javax/xml/jaxp/transform/sort/sort-alphabet-russian.xml
+53
-0
test/javax/xml/jaxp/transform/sort/sort-alphabet-russian.xsl
test/javax/xml/jaxp/transform/sort/sort-alphabet-russian.xsl
+39
-0
未找到文件。
THIRD_PARTY_README
浏览文件 @
25d5529e
...
...
@@ -2898,7 +2898,7 @@ included with JRE 8, JDK 8, and OpenJDK 8.
Apache Jakarta BCEL 5.1
Apache Jakarta Regexp 1.4
Apache Santuario XML Security for Java 1.5.4
Apache Xalan-Java 2.7.
1
Apache Xalan-Java 2.7.
2
Apache Xerces Java 2.10.0
Apache XML Resolver 1.1
...
...
test/javax/xml/jaxp/transform/sort/SortTest.java
0 → 100644
浏览文件 @
25d5529e
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import
java.io.StringWriter
;
import
java.net.URI
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.util.List
;
import
javax.xml.transform.Result
;
import
javax.xml.transform.Source
;
import
javax.xml.transform.Templates
;
import
javax.xml.transform.Transformer
;
import
javax.xml.transform.TransformerFactory
;
import
javax.xml.transform.stream.StreamResult
;
import
javax.xml.transform.stream.StreamSource
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.DataProvider
;
import
org.testng.annotations.Listeners
;
import
org.testng.annotations.Test
;
/*
* @test
* @bug 8193830
* @run testng/othervm -DrunSecMngr=true SortTest
* @run testng/othervm SortTest
* @summary verify xsl:sort lang attribute
*/
public
class
SortTest
{
static
final
String
LAND_EN
=
"en"
;
static
final
String
LAND_PL
=
"pl"
;
static
final
String
LAND_RU
=
"ru"
;
String
filepath
;
String
slash
=
""
;
@BeforeClass
public
void
setUpClass
()
throws
Exception
{
String
file1
=
getClass
().
getResource
(
"/sort-alphabet-english.xml"
).
getFile
();
if
(
System
.
getProperty
(
"os.name"
).
contains
(
"Windows"
))
{
filepath
=
file1
.
substring
(
1
,
file1
.
lastIndexOf
(
"/"
)
+
1
);
slash
=
"/"
;
}
else
{
filepath
=
file1
.
substring
(
0
,
file1
.
lastIndexOf
(
"/"
)
+
1
);
}
}
/*
* DataProvider fields:
* lang, xml, xsl, gold file
*/
@DataProvider
(
name
=
"parameters"
)
public
Object
[][]
getParameters
()
{
return
new
Object
[][]{
{
LAND_EN
,
"sort-alphabet-english.xml"
,
"sort-alphabet-english.xsl"
,
"sort-alphabet-english.out"
},
{
LAND_PL
,
"sort-alphabet-polish.xml"
,
"sort-alphabet-polish.xsl"
,
"sort-alphabet-polish.out"
},
{
LAND_RU
,
"sort-alphabet-russian.xml"
,
"sort-alphabet-russian.xsl"
,
"sort-alphabet-russian.out"
},};
}
@Test
(
dataProvider
=
"parameters"
)
public
final
void
testTransform
(
String
lang
,
String
xml
,
String
xsl
,
String
gold
)
throws
Exception
{
StringWriter
sw
=
new
StringWriter
();
// Create transformer factory
TransformerFactory
factory
=
TransformerFactory
.
newInstance
();
// Use the factory to create a template containing the xsl file
Templates
template
=
factory
.
newTemplates
(
new
StreamSource
(
getClass
().
getResourceAsStream
(
xsl
)));
// Use the template to create a transformer
Transformer
xformer
=
template
.
newTransformer
();
xformer
.
setParameter
(
"lang"
,
lang
);
// Prepare the input and output files
Source
source
=
new
StreamSource
(
getClass
().
getResourceAsStream
(
xml
));
/*
* The following may be used to produce gold files.
* Using however the original gold files, and compare without considering
* the format
*/
//String output = getClass().getResource(gold).getPath();
//Result result = new StreamResult(new FileOutputStream(output));
// use the following to verify the output against the pre-generated one
Result
result
=
new
StreamResult
(
sw
);
// Apply the xsl file to the source file and write the result to the
// output file
xformer
.
transform
(
source
,
result
);
String
out
=
sw
.
toString
();
List
<
String
>
lines
=
Files
.
readAllLines
(
Paths
.
get
(
filepath
+
gold
));
String
[]
resultLines
=
out
.
split
(
"\n"
);
int
i
=
0
;
// the purpose is to test sort, so ignore the format of the output
for
(
String
line
:
lines
)
{
Assert
.
assertEquals
(
resultLines
[
i
++].
trim
(),
line
.
trim
());
}
}
}
test/javax/xml/jaxp/transform/sort/sort-alphabet-english.out
0 → 100644
浏览文件 @
25d5529e
<?xml version="1.0" encoding="UTF-8"?>
<root>
<p>
lang: en
</p>
<ul>
<li>
A
</li>
<li>
C
</li>
<li>
D
</li>
<li>
E
</li>
<li>
F
</li>
<li>
G
</li>
<li>
H
</li>
<li>
I
</li>
<li>
J
</li>
<li>
K
</li>
<li>
L
</li>
<li>
M
</li>
<li>
N
</li>
<li>
O
</li>
<li>
P
</li>
<li>
Q
</li>
<li>
R
</li>
<li>
S
</li>
<li>
T
</li>
<li>
U
</li>
<li>
V
</li>
<li>
W
</li>
<li>
X
</li>
<li>
Y
</li>
<li>
Z
</li>
</ul>
</root>
\ No newline at end of file
test/javax/xml/jaxp/transform/sort/sort-alphabet-english.xml
0 → 100644
浏览文件 @
25d5529e
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<alphabet
language=
"en"
>
<character>
A
</character>
<character>
E
</character>
<character>
C
</character>
<character>
D
</character>
<character>
F
</character>
<character>
G
</character>
<character>
H
</character>
<character>
I
</character>
<character>
J
</character>
<character>
K
</character>
<character>
L
</character>
<character>
M
</character>
<character>
N
</character>
<character>
Y
</character>
<character>
O
</character>
<character>
P
</character>
<character>
Q
</character>
<character>
U
</character>
<character>
R
</character>
<character>
S
</character>
<character>
V
</character>
<character>
W
</character>
<character>
T
</character>
<character>
X
</character>
<character>
Z
</character>
</alphabet>
test/javax/xml/jaxp/transform/sort/sort-alphabet-english.xsl
0 → 100644
浏览文件 @
25d5529e
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
version=
"1.0"
>
<xsl:output
method=
"xml"
version=
"1.0"
omit-xml-declaration=
"no"
encoding=
"UTF-8"
indent=
"yes"
xml:space=
"preserve"
/>
<!-- <xsl:output method="html" doctype-system="http://www.w3.org/TR/html4/strict.dtd" doctype-public="-//W3C//DTD HTML
4.01//EN" version="4.0" encoding="UTF-8" indent="yes" xml:lang="$lang" omit-xml-declaration="no"/> -->
<xsl:param
name=
"lang"
/>
<xsl:template
match=
"alphabet"
>
<root>
<p>
lang:
<xsl:value-of
select=
"$lang"
/></p>
<ul>
<xsl:apply-templates
select=
"character"
>
<xsl:sort
select=
"."
lang=
"{$lang}"
order=
"ascending"
/>
</xsl:apply-templates>
</ul>
</root>
</xsl:template>
<xsl:template
match=
"character"
>
<li>
<xsl:value-of
select=
"text()"
/>
</li>
</xsl:template>
</xsl:stylesheet>
test/javax/xml/jaxp/transform/sort/sort-alphabet-polish.out
0 → 100644
浏览文件 @
25d5529e
<?xml version="1.0" encoding="UTF-8"?>
<root>
<p>
lang: pl
</p>
<ul>
<li>
A
</li>
<li>
Ą
</li>
<li>
B
</li>
<li>
C
</li>
<li>
Ć
</li>
<li>
D
</li>
<li>
E
</li>
<li>
Ę
</li>
<li>
F
</li>
<li>
G
</li>
<li>
H
</li>
<li>
I
</li>
<li>
J
</li>
<li>
K
</li>
<li>
L
</li>
<li>
Ł
</li>
<li>
M
</li>
<li>
N
</li>
<li>
Ń
</li>
<li>
O
</li>
<li>
Ó
</li>
<li>
P
</li>
<li>
R
</li>
<li>
S
</li>
<li>
Ś
</li>
<li>
T
</li>
<li>
U
</li>
<li>
W
</li>
<li>
Y
</li>
<li>
Z
</li>
<li>
Ź
</li>
<li>
Ż
</li>
</ul>
</root>
\ No newline at end of file
test/javax/xml/jaxp/transform/sort/sort-alphabet-polish.xml
0 → 100644
浏览文件 @
25d5529e
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<alphabet
language=
"pl"
>
<character>
A
</character>
<character>
Ż
</character>
<character>
B
</character>
<character>
C
</character>
<character>
Ć
</character>
<character>
D
</character>
<character>
Ł
</character>
<character>
E
</character>
<character>
Ę
</character>
<character>
F
</character>
<character>
G
</character>
<character>
H
</character>
<character>
I
</character>
<character>
J
</character>
<character>
K
</character>
<character>
L
</character>
<character>
Z
</character>
<character>
Ź
</character>
<character>
M
</character>
<character>
N
</character>
<character>
Ń
</character>
<character>
O
</character>
<character>
Ó
</character>
<character>
P
</character>
<character>
R
</character>
<character>
S
</character>
<character>
Ś
</character>
<character>
T
</character>
<character>
U
</character>
<character>
W
</character>
<character>
Ą
</character>
<character>
Y
</character>
</alphabet>
\ No newline at end of file
test/javax/xml/jaxp/transform/sort/sort-alphabet-polish.xsl
0 → 100644
浏览文件 @
25d5529e
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
version=
"1.0"
>
<xsl:output
method=
"xml"
version=
"1.0"
omit-xml-declaration=
"no"
encoding=
"UTF-8"
indent=
"yes"
xml:space=
"preserve"
/>
<!-- <xsl:output method="html" doctype-system="http://www.w3.org/TR/html4/strict.dtd" doctype-public="-//W3C//DTD HTML
4.01//EN" version="4.0" encoding="UTF-8" indent="yes" xml:lang="$lang" omit-xml-declaration="no"/> -->
<xsl:param
name=
"lang"
/>
<xsl:template
match=
"alphabet"
>
<root>
<p>
lang:
<xsl:value-of
select=
"$lang"
/></p>
<ul>
<xsl:apply-templates
select=
"character"
>
<xsl:sort
select=
"."
lang=
"{$lang}"
order=
"ascending"
/>
</xsl:apply-templates>
</ul>
</root>
</xsl:template>
<xsl:template
match=
"character"
>
<li>
<xsl:value-of
select=
"text()"
/>
</li>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
test/javax/xml/jaxp/transform/sort/sort-alphabet-russian.out
0 → 100644
浏览文件 @
25d5529e
<?xml version="1.0" encoding="UTF-8"?>
<root>
<p>
lang: ru
</p>
<ul>
<li>
А
</li>
<li>
Б
</li>
<li>
В
</li>
<li>
Г
</li>
<li>
Д
</li>
<li>
Е
</li>
<li>
Ё
</li>
<li>
Ж
</li>
<li>
З
</li>
<li>
И
</li>
<li>
Й
</li>
<li>
К
</li>
<li>
Л
</li>
<li>
М
</li>
<li>
Н
</li>
<li>
О
</li>
<li>
П
</li>
<li>
Р
</li>
<li>
С
</li>
<li>
Т
</li>
<li>
У
</li>
<li>
Ф
</li>
<li>
Х
</li>
<li>
Ц
</li>
<li>
Ч
</li>
<li>
Ш
</li>
<li>
Щ
</li>
<li>
Ъ
</li>
<li>
Ы
</li>
<li>
Ь
</li>
<li>
Э
</li>
<li>
Ю
</li>
<li>
Я
</li>
</ul>
</root>
\ No newline at end of file
test/javax/xml/jaxp/transform/sort/sort-alphabet-russian.xml
0 → 100644
浏览文件 @
25d5529e
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<alphabet
language=
"ru"
>
<character>
А
</character>
<character>
Б
</character>
<character>
В
</character>
<character>
Г
</character>
<character>
Д
</character>
<character>
Е
</character>
<character>
Ё
</character>
<character>
Ж
</character>
<character>
З
</character>
<character>
Й
</character>
<character>
П
</character>
<character>
Я
</character>
<character>
К
</character>
<character>
Л
</character>
<character>
С
</character>
<character>
М
</character>
<character>
Н
</character>
<character>
О
</character>
<character>
Р
</character>
<character>
И
</character>
<character>
Т
</character>
<character>
Ф
</character>
<character>
Х
</character>
<character>
Ц
</character>
<character>
У
</character>
<character>
Ш
</character>
<character>
Щ
</character>
<character>
Ъ
</character>
<character>
Ы
</character>
<character>
Ч
</character>
<character>
Ь
</character>
<character>
Э
</character>
<character>
Ю
</character>
</alphabet>
test/javax/xml/jaxp/transform/sort/sort-alphabet-russian.xsl
0 → 100644
浏览文件 @
25d5529e
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
version=
"1.0"
>
<xsl:output
method=
"xml"
version=
"1.0"
omit-xml-declaration=
"no"
encoding=
"UTF-8"
indent=
"yes"
xml:space=
"preserve"
/>
<!-- <xsl:output method="html" doctype-system="http://www.w3.org/TR/html4/strict.dtd" doctype-public="-//W3C//DTD HTML
4.01//EN" version="4.0" encoding="UTF-8" indent="yes" xml:lang="$lang" omit-xml-declaration="no"/> -->
<xsl:param
name=
"lang"
/>
<xsl:template
match=
"alphabet"
>
<root>
<p>
lang:
<xsl:value-of
select=
"$lang"
/></p>
<ul>
<xsl:apply-templates
select=
"character"
>
<xsl:sort
select=
"."
lang=
"{$lang}"
order=
"ascending"
/>
</xsl:apply-templates>
</ul>
</root>
</xsl:template>
<xsl:template
match=
"character"
>
<li>
<xsl:value-of
select=
"text()"
/>
</li>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录