summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Wang2012-12-05 00:22:22 (EST)
committerNick Sandonato2012-12-14 15:58:45 (EST)
commit0bf127e89c4d0fc707b83a7f9d8745e57517f7e4 (patch)
treec938497c8bee08fddc6c4ced94957cc47c8b18a5
parent767eea4eb14c06b1cb31b0dc5572db33052f8f99 (diff)
downloadwebtools.sourceediting-0bf127e89c4d0fc707b83a7f9d8745e57517f7e4.zip
webtools.sourceediting-0bf127e89c4d0fc707b83a7f9d8745e57517f7e4.tar.gz
webtools.sourceediting-0bf127e89c4d0fc707b83a7f9d8745e57517f7e4.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)
{