summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Wang2012-12-05 00:22:22 (EST)
committerNick Sandonato2012-12-14 15:19:33 (EST)
commitc460c0a0d23be4da07519824f263342fa41b9cbd (patch)
tree3cc3a55d5389c3706c286d1375fba3c8950f1d0d
parent96f598666353a83872004e5841f190318bab8644 (diff)
downloadwebtools.sourceediting-c460c0a0d23be4da07519824f263342fa41b9cbd.zip
webtools.sourceediting-c460c0a0d23be4da07519824f263342fa41b9cbd.tar.gz
webtools.sourceediting-c460c0a0d23be4da07519824f263342fa41b9cbd.tar.bz2
[390826]
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java10
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java11
2 files changed, 19 insertions, 2 deletions
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java
index cd4631d..2161dd6 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java
@@ -68,7 +68,15 @@ public class ValidatorHelper
protected XMLReader createXMLReader(String uri) throws SAXNotRecognizedException, SAXNotSupportedException {
XMLReader reader = null;
- reader = new org.apache.xerces.parsers.SAXParser();
+ ClassLoader originalClzLoader = Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+
+ try{
+ reader = new org.apache.xerces.parsers.SAXParser();
+ }finally{
+ Thread.currentThread().setContextClassLoader(originalClzLoader);
+ }
+
reader.setFeature("http://apache.org/xml/features/continue-after-fatal-error", false); //$NON-NLS-1$
reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); //$NON-NLS-1$
reader.setFeature("http://xml.org/sax/features/namespaces", false); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java
index 4277255..1606eb7 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java
@@ -359,7 +359,16 @@ public class XMLValidator
InputSource inputSource = new InputSource(uri);
inputSource.setCharacterStream(reader2);
- reader.parse(inputSource);
+
+ ClassLoader originalClzLoader = Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+
+ try{
+ reader.parse(inputSource);
+ }finally{
+ Thread.currentThread().setContextClassLoader(originalClzLoader);
+ }
+
if(configuration.getIntFeature(XMLValidationConfiguration.INDICATE_NO_GRAMMAR) > 0 &&
valinfo.isValid() && !isGrammarEncountered)
{