You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
3.0 KiB
72 lines
3.0 KiB
3 months ago
|
From 7e16acad31d6a546375a110207e03c1d1703cbb6 Mon Sep 17 00:00:00 2001
|
||
|
From: Marian Koncek <mkoncek@redhat.com>
|
||
|
Date: Mon, 16 Jan 2023 15:38:39 +0100
|
||
|
Subject: [PATCH] Port to jaxb-xsom 4.0.1
|
||
|
|
||
|
---
|
||
|
.../com/sun/xml/analysis/frequency/SchemaProcessor.java | 7 ++++++-
|
||
|
.../java/com/sun/xml/analysis/types/SchemaProcessor.java | 7 ++++++-
|
||
|
2 files changed, 12 insertions(+), 2 deletions(-)
|
||
|
|
||
|
diff --git a/utilities/src/main/java/com/sun/xml/analysis/frequency/SchemaProcessor.java b/utilities/src/main/java/com/sun/xml/analysis/frequency/SchemaProcessor.java
|
||
|
index 32532fa..497255a 100644
|
||
|
--- a/utilities/src/main/java/com/sun/xml/analysis/frequency/SchemaProcessor.java
|
||
|
+++ b/utilities/src/main/java/com/sun/xml/analysis/frequency/SchemaProcessor.java
|
||
|
@@ -42,6 +42,7 @@ import com.sun.xml.xsom.XSUnionSimpleType;
|
||
|
import com.sun.xml.xsom.XSWildcard;
|
||
|
import com.sun.xml.xsom.XSXPath;
|
||
|
import com.sun.xml.xsom.parser.XSOMParser;
|
||
|
+import com.sun.xml.xsom.parser.JAXPParser;
|
||
|
import com.sun.xml.xsom.visitor.XSSimpleTypeVisitor;
|
||
|
import com.sun.xml.xsom.visitor.XSVisitor;
|
||
|
import java.io.File;
|
||
|
@@ -56,6 +57,7 @@ import java.util.Map;
|
||
|
import java.util.Set;
|
||
|
import javax.xml.XMLConstants;
|
||
|
import javax.xml.namespace.QName;
|
||
|
+import javax.xml.parsers.SAXParserFactory;
|
||
|
import org.xml.sax.ErrorHandler;
|
||
|
import org.xml.sax.InputSource;
|
||
|
import org.xml.sax.SAXException;
|
||
|
@@ -415,7 +417,10 @@ public class SchemaProcessor {
|
||
|
* information items.
|
||
|
*/
|
||
|
public void process() throws Exception {
|
||
|
- XSOMParser parser = new XSOMParser();
|
||
|
+ SAXParserFactory factory = SAXParserFactory.newInstance();
|
||
|
+ factory.setNamespaceAware(true);
|
||
|
+ factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
|
||
|
+ XSOMParser parser = new XSOMParser(factory);
|
||
|
parser.setErrorHandler(new ErrorHandlerImpl());
|
||
|
|
||
|
for (URL u : _schema) {
|
||
|
diff --git a/utilities/src/main/java/com/sun/xml/analysis/types/SchemaProcessor.java b/utilities/src/main/java/com/sun/xml/analysis/types/SchemaProcessor.java
|
||
|
index 81e1c17..596b130 100644
|
||
|
--- a/utilities/src/main/java/com/sun/xml/analysis/types/SchemaProcessor.java
|
||
|
+++ b/utilities/src/main/java/com/sun/xml/analysis/types/SchemaProcessor.java
|
||
|
@@ -56,7 +56,9 @@ import java.util.Iterator;
|
||
|
import java.util.List;
|
||
|
import java.util.Map;
|
||
|
import java.util.Set;
|
||
|
+import javax.xml.XMLConstants;
|
||
|
import javax.xml.namespace.QName;
|
||
|
+import javax.xml.parsers.SAXParserFactory;
|
||
|
import org.xml.sax.ErrorHandler;
|
||
|
import org.xml.sax.InputSource;
|
||
|
import org.xml.sax.SAXException;
|
||
|
@@ -334,7 +336,10 @@ public class SchemaProcessor {
|
||
|
public void process(Set<XSDataType> filter) throws Exception {
|
||
|
_filter = filter;
|
||
|
|
||
|
- XSOMParser parser = new XSOMParser();
|
||
|
+ SAXParserFactory factory = SAXParserFactory.newInstance();
|
||
|
+ factory.setNamespaceAware(true);
|
||
|
+ factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
|
||
|
+ XSOMParser parser = new XSOMParser(factory);
|
||
|
parser.setErrorHandler(new ErrorHandlerImpl());
|
||
|
|
||
|
for (URL u : _schema) {
|
||
|
--
|
||
|
2.39.0
|
||
|
|