diff --git a/ExperimentalTaglet.java b/ExperimentalTaglet.java new file mode 100644 index 0000000..d3350fc --- /dev/null +++ b/ExperimentalTaglet.java @@ -0,0 +1,131 @@ +/* + * 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. + */ + +package org.apache.xerces.util; + +import java.util.Map; + +import com.sun.javadoc.Tag; +import com.sun.tools.doclets.Taglet; + +/** + * This class provides support for a 'xerces.experimental' tag + * in javadoc comments. The tag creates a warning in the generated + * html for users. + * + * @author Ankit Pasricha, IBM + */ +public class ExperimentalTaglet implements Taglet { + + private static final String NAME = "xerces.experimental"; + private static final String HEADER = "EXPERIMENTAL:"; + /* (non-Javadoc) + * @see com.sun.tools.doclets.Taglet#inConstructor() + */ + public boolean inConstructor() { + return false; + } + + /* (non-Javadoc) + * @see com.sun.tools.doclets.Taglet#inField() + */ + public boolean inField() { + return false; + } + + /* (non-Javadoc) + * @see com.sun.tools.doclets.Taglet#inMethod() + */ + public boolean inMethod() { + return true; + } + + /* (non-Javadoc) + * @see com.sun.tools.doclets.Taglet#inOverview() + */ + public boolean inOverview() { + return true; + } + + /* (non-Javadoc) + * @see com.sun.tools.doclets.Taglet#inPackage() + */ + public boolean inPackage() { + return false; + } + + /* (non-Javadoc) + * @see com.sun.tools.doclets.Taglet#inType() + */ + public boolean inType() { + return true; + } + + /* (non-Javadoc) + * @see com.sun.tools.doclets.Taglet#isInlineTag() + */ + public boolean isInlineTag() { + return false; + } + + /* (non-Javadoc) + * @see com.sun.tools.doclets.Taglet#getName() + */ + public String getName() { + return NAME; + } + + /* (non-Javadoc) + * @see com.sun.tools.doclets.Taglet#toString(com.sun.javadoc.Tag) + */ + public String toString(Tag arg0) { + return "
null
++ * if a legal pseudo attribute name could not be scanned.
++ */
++ private String scanPseudoAttributeName() throws IOException, XNIException {
++ final int ch = fEntityScanner.peekChar();
++ switch (ch) {
++ case 'v':
++ if (fEntityScanner.skipString(fVersionSymbol)) {
++ return fVersionSymbol;
++ }
++ break;
++ case 'e':
++ if (fEntityScanner.skipString(fEncodingSymbol)) {
++ return fEncodingSymbol;
++ }
++ break;
++ case 's':
++ if (fEntityScanner.skipString(fStandaloneSymbol)) {
++ return fStandaloneSymbol;
++ }
++ break;
++ }
++ return null;
++ } // scanPseudoAttributeName()
++
++ /**
+ * Scans a processing instruction.
+ * + *
diff --git a/xerces-j2-build.patch b/xerces-j2-build.patch new file mode 100644 index 0000000..dde254c --- /dev/null +++ b/xerces-j2-build.patch @@ -0,0 +1,72 @@ +--- build.xml.orig 2010-11-26 20:42:11.000000000 +0000 ++++ build.xml 2010-12-11 19:20:35.913500731 +0000 +@@ -108,7 +108,6 @@ ++ + +- + + + +@@ -247,30 +246,6 @@ + + +- +- +- +- + ++- +@@ -1231,30 +1206,6 @@ + + +- +- +- +- + + + diff --git a/xerces-j2-constants.1 b/xerces-j2-constants.1 new file mode 100644 index 0000000..86c7e54 --- /dev/null +++ b/xerces-j2-constants.1 @@ -0,0 +1,12 @@ +.TH XERCES-J2-CONSTANTS 1 "08 April 2013" "xerces-2.11.0" "User commands" + +.SH NAME +xerces-j2-constants \- display constants used by Xerces2 Java Parser + +.SH SYNOPSIS +.BR xerces-j2-constants + +.SH DESCRIPTION + +Xerces-J2-Constants dumps common constants used by Xerces2 Java Parser +to standard output. diff --git a/xerces-j2-constants.sh b/xerces-j2-constants.sh new file mode 100644 index 0000000..e722360 --- /dev/null +++ b/xerces-j2-constants.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Xerces-J2 constants script +# JPackage Project (http://www.jpackage.org/) +# $Id: xerces-j2-constants.sh,v 1.3 2005/05/26 14:21:22 gbenson Exp $ + +# Source functions library +. /usr/share/java-utils/java-functions + +# Configuration +MAIN_CLASS=org.apache.xerces.impl.Constants + +# Set parameters +set_jvm +export CLASSPATH=$(build-classpath xerces-j2) +set_flags $BASE_FLAGS +set_options $BASE_OPTIONS + +# Let's start +run "$@" diff --git a/xerces-j2-manifest.patch b/xerces-j2-manifest.patch new file mode 100644 index 0000000..524e8ec --- /dev/null +++ b/xerces-j2-manifest.patch @@ -0,0 +1,17 @@ +--- src/manifest.xerces.orig 2010-11-26 22:42:07.000000000 +0200 ++++ src/manifest.xerces 2012-12-17 11:11:52.200392844 +0200 +@@ -1,5 +1,14 @@ + Manifest-Version: 1.0 + Created-By: @java.version@ (@java.vendor@) ++Bundle-RequiredExecutionEnvironment: J2SE-1.5 ++Bundle-SymbolicName: org.apache.xerces ++Bundle-ManifestVersion: 2 ++Bundle-Name: @impl.name@ ++Bundle-Localization: plugin ++Bundle-Version: @impl.version@ ++Bundle-Vendor: Apache Software Foundation ++Require-Bundle: system.bundle,javax.xml;visibility:=reexport, org.apache.xml.resolver;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,org.apache.xml.serializer;bundle-version="[2.7.1,3.0.0)" ++Export-Package: META-INF.services;version="@impl.version@",org.apache.html.dom;version="@impl.version@",org.apache.wml;version="@impl.version@",org.apache.wml.dom;version="@impl.version@",org.apache.xerces.dom;version="@impl.version@",org.apache.xerces.dom.events;version="@impl.version@",org.apache.xerces.dom3.as;version="@impl.version@",org.apache.xerces.impl;version="@impl.version@",org.apache.xerces.impl.dtd;version="@impl.version@",org.apache.xerces.impl.dtd.models;version="@impl.version@",org.apache.xerces.impl.dv;version="@impl.version@",org.apache.xerces.impl.dv.dtd;version="@impl.version@",org.apache.xerces.impl.dv.util;version="@impl.version@",org.apache.xerces.impl.dv.xs;version="@impl.version@",org.apache.xerces.impl.io;version="@impl.version@",org.apache.xerces.impl.msg;version="@impl.version@",org.apache.xerces.impl.validation;version="@impl.version@",org.apache.xerces.impl.xpath;version="@impl.version@",org.apache.xerces.impl.xpath.regex;version="@impl.version@",org.apache.xerces.impl.xs;version="@impl.version@",org.apache.xerces.impl.xs.identity;version="@impl.version@",org.apache.xerces.impl.xs.models;version="@impl.version@",org.apache.xerces.impl.xs.opti;version="@impl.version@",org.apache.xerces.impl.xs.traversers;version="@impl.version@",org.apache.xerces.impl.xs.util;version="@impl.version@",org.apache.xerces.jaxp;version="@impl.version@",org.apache.xerces.jaxp.datatype;version="@impl.version@",org.apache.xerces.jaxp.validation;version="@impl.version@",org.apache.xerces.parsers;version="@impl.version@",org.apache.xerces.stax;version="@impl.version@",org.apache.xerces.stax.events;version="@impl.version@",org.apache.xerces.util;version="@impl.version@",org.apache.xerces.xinclude;version="@impl.version@",org.apache.xerces.xni;version="@impl.version@",org.apache.xerces.xni.grammars;version="@impl.version@",org.apache.xerces.xni.parser;version="@impl.version@",org.apache.xerces.xpointer;version="@impl.version@",org.apache.xerces.xs;version="@impl.version@",org.apache.xerces.xs.datatypes;version="@impl.version@",org.apache.xml.serialize;version="@impl.version@",org.w3c.dom.html;version="@impl.version@" + + Name: org/apache/xerces/impl/Version.class + Comment: @impl.name@ diff --git a/xerces-j2-pom.xml b/xerces-j2-pom.xml new file mode 100644 index 0000000..e4a3c72 --- /dev/null +++ b/xerces-j2-pom.xml @@ -0,0 +1,48 @@ + ++- + + \ No newline at end of file diff --git a/xerces-j2-version.1 b/xerces-j2-version.1 new file mode 100644 index 0000000..bccee19 --- /dev/null +++ b/xerces-j2-version.1 @@ -0,0 +1,12 @@ +.TH XERCES-J2-VERSION 1 "08 April 2013" "xerces-2.11.0" "User commands" + +.SH NAME +xerces-j2-version \- display version of Xerces2 Java Parser + +.SH SYNOPSIS +.BR xerces-j2-version + +.SH DESCRIPTION + +Xerces-J2-Version prints version of Xerces2 Java Parser to standard +output. diff --git a/xerces-j2-version.sh b/xerces-j2-version.sh new file mode 100644 index 0000000..bd5e7c2 --- /dev/null +++ b/xerces-j2-version.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Xerces-J2 version script +# JPackage Project (http://www.jpackage.org/) +# $Id: xerces-j2-version.sh,v 1.3 2005/05/26 14:21:22 gbenson Exp $ + +# Source functions library +. /usr/share/java-utils/java-functions + +# Configuration +MAIN_CLASS=org.apache.xerces.impl.Version + +# Set parameters +set_jvm +export CLASSPATH=$(build-classpath xerces-j2) +set_flags $BASE_FLAGS +set_options $BASE_OPTIONS + +# Let's start +run "$@" diff --git a/xerces-j2.spec b/xerces-j2.spec new file mode 100644 index 0000000..e6e3625 --- /dev/null +++ b/xerces-j2.spec @@ -0,0 +1,136 @@ +Name: xerces-j2 +Version: 2.11.0 +Release: 36 +Summary: Java XML parser +License: ASL 2.0 and W3C +URL: http://xerces.apache.org/xerces2-j/ + +Source0: http://archive.apache.org/dist/xerces/j/Xerces-J-src.%{version}.tar.gz +Source1: %{name}-version.sh +Source2: %{name}-constants.sh +Source11: %{name}-version.1 +Source12: %{name}-constants.1 +Source3: https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_2_11_0/tools/src/XJavac.java +Source5: https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_2_11_0/tools/src/ExperimentalTaglet.java +Source6: https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_2_11_0/tools/src/InternalTaglet.java +Source7: %{name}-pom.xml + +Patch0: %{name}-build.patch +Patch1: %{name}-manifest.patch +Patch2: xerces-j2-CVE-2013-4002.patch + +BuildRequires: javapackages-local ant apache-parent xalan-j2 >= 2.7.1 +BuildRequires: xml-commons-apis >= 1.4.01 xml-commons-resolver >= 1.2 + +Requires: xalan-j2 >= 2.7.1 xml-commons-resolver >= 1.2 +Requires: xml-commons-apis >= 1.4.01 javapackages-tools + +Provides: jaxp_parser_impl = 1.4 +Provides: %{name}-scripts = %{version}-%{release} + +Obsoletes: %{name}-scripts < 2.11.0-6 +Obsoletes: %{name}-javadoc-apis < %{version}-%{release} +Obsoletes: %{name}-manual < %{version}-%{release} + +Provides: %{name}-demo = %{version}-%{release} +Obsoletes: %{name}-demo < %{version}-%{release} + +BuildArch: noarch + +%description +Welcome to the future! Xerces2 is the next generation of high +performance, fully compliant XML parsers in the Apache Xerces family. +This new version of Xerces introduces the Xerces Native Interface (XNI), +a complete framework for building parser components and configurations +that is extremely modular and easy to program. + +The Apache Xerces2 parser is the reference implementation of XNI but +other parser components, configurations, and parsers can be written +using the Xerces Native Interface. For complete design and +implementation documents, refer to the XNI Manual. + +Xerces 2 is a fully conforming XML Schema processor. For more +information, refer to the XML Schema page. + +Xerces 2 also provides a partial implementation of Document Object Model +Level 3 Core, Load and Save and Abstract Schemas [deprecated] Working +Drafts. For more information, refer to the DOM Level 3 Implementation +page. + +%package help +Summary: Documents for %{name} +Buildarch: noarch +Requires: man info +Provides: %{name}-javadoc = %{version}-%{release} +Obsoletes: %{name}-javadoc < %{version}-%{release} +Obsoletes: %{name}-javadoc-impl < %{version}-%{release} +Obsoletes: %{name}-javadoc-xs < %{version}-%{release} +Obsoletes: %{name}-javadoc-xni < %{version}-%{release} +Obsoletes: %{name}-javadoc-other < %{version}-%{release} + +%description help +Man pages and other related documents for %{name}. + +%prep +%autosetup -p0 -n xerces-2_11_0 +install -d tools/org/apache/xerces/util +install -d tools/bin +cp -a %{SOURCE3} %{SOURCE5} %{SOURCE6} tools/org/apache/xerces/util +find -name '*.class' -exec rm -f '{}' \; +find -name '*.jar' -exec rm -f '{}' \; +sed -i 's/\r//' LICENSE README NOTICE +%mvn_alias : xerces:xerces xerces:xmlParserAPIs apache:%{name} +%mvn_file : %{name} jaxp_parser_impl + +%build +pushd tools +javac -classpath $(build-classpath ant) org/apache/xerces/util/XJavac.java +jar cf bin/xjavac.jar org/apache/xerces/util/XJavac.class +javac -classpath /usr/lib/jvm/java/lib/tools.jar org/apache/xerces/util/*Taglet.java +jar cf bin/xerces2taglets.jar org/apache/xerces/util/*Taglet.class +ln -sf $(build-classpath xalan-j2-serializer) serializer.jar +ln -sf $(build-classpath xml-commons-apis) xml-apis.jar +ln -sf $(build-classpath xml-commons-resolver) resolver.jar +ln -sf $(build-classpath %{name}) x.jar +popd +export ANT_OPTS="-Xmx256m -Djava.endorsed.dirs=$(pwd)/tools -Djava.awt.headless=true -Dbuild.sysclasspath=first -Ddisconnected=true" +ant -Djavac.source=1.5 -Djavac.target=1.5 -Dbuild.compiler=modern clean jars javadocs +%mvn_artifact %{SOURCE7} build/xercesImpl.jar + +%install +%mvn_install + +install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name} +install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}/impl +install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}/xs +install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}/xni +install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}/other +cp -pr build/docs/javadocs/xerces2/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}/impl +cp -pr build/docs/javadocs/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}/xs +cp -pr build/docs/javadocs/xni/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}/xni +cp -pr build/docs/javadocs/other/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}/other +install -pD -m755 -T %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name}-version +install -pD -m755 -T %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}-constants +install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1 +install -p -m 644 %{SOURCE11} $RPM_BUILD_ROOT%{_mandir}/man1 +install -p -m 644 %{SOURCE12} $RPM_BUILD_ROOT%{_mandir}/man1 +install -pD -T build/xercesSamples.jar $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name}-samples.jar +cp -pr data $RPM_BUILD_ROOT%{_datadir}/%{name} + +%post +update-alternatives --remove jaxp_parser_impl %{_javadir}/%{name}.jar >/dev/null 2>&1 || : +ln -sf %{name}.jar %{_javadir}/jaxp_parser_impl.jar + +%files -f .mfiles +%doc LICENSE +%{_bindir}/* +%{_datadir}/%{name} + +%files help +%doc NOTICE README +%{_javadocdir}/%{name} +%{_mandir}/*/* + +%changelog +* Mon Feb 17 2020 zhouyihang4.0.0 ++ +org.apache +apache +4 + +xerces +xercesImpl +2.11.0 +Xerces2 Java Parser ++ Xerces2 is the next generation of high performance, fully compliant XML parsers in the + Apache Xerces family. This new version of Xerces introduces the Xerces Native Interface (XNI), + a complete framework for building parser components and configurations that is extremely + modular and easy to program. + + +http://xerces.apache.org/xerces2-j + ++ + + ++ +xml-apis +xml-apis +1.4.01 + ++ + +xml-resolver +xml-resolver +1.2 +true ++ + +src +- 2.11.0-36 +- Package init