|
Lines 10-21
Link Here
|
| 10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
| 11 |
package org.eclipse.wst.wsi.internal.core.profile.impl; |
11 |
package org.eclipse.wst.wsi.internal.core.profile.impl; |
| 12 |
|
12 |
|
|
|
13 |
import java.io.IOException; |
| 13 |
import java.io.Reader; |
14 |
import java.io.Reader; |
|
|
15 |
import java.net.URL; |
| 14 |
import java.util.Iterator; |
16 |
import java.util.Iterator; |
| 15 |
import java.util.LinkedList; |
17 |
import java.util.LinkedList; |
| 16 |
import java.util.List; |
18 |
import java.util.List; |
| 17 |
import java.util.TreeMap; |
19 |
import java.util.TreeMap; |
| 18 |
|
20 |
|
|
|
21 |
import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver; |
| 22 |
import org.eclipse.wst.wsi.internal.WSITestToolsEclipseProperties; |
| 23 |
import org.eclipse.wst.wsi.internal.WSITestToolsProperties; |
| 19 |
import org.eclipse.wst.wsi.internal.core.WSIConstants; |
24 |
import org.eclipse.wst.wsi.internal.core.WSIConstants; |
| 20 |
import org.eclipse.wst.wsi.internal.core.WSIException; |
25 |
import org.eclipse.wst.wsi.internal.core.WSIException; |
| 21 |
import org.eclipse.wst.wsi.internal.core.profile.EntryTypeList; |
26 |
import org.eclipse.wst.wsi.internal.core.profile.EntryTypeList; |
|
Lines 27-33
Link Here
|
| 27 |
import org.eclipse.wst.wsi.internal.core.util.Utils; |
32 |
import org.eclipse.wst.wsi.internal.core.util.Utils; |
| 28 |
import org.eclipse.wst.wsi.internal.core.xml.XMLUtils; |
33 |
import org.eclipse.wst.wsi.internal.core.xml.XMLUtils; |
| 29 |
import org.xml.sax.Attributes; |
34 |
import org.xml.sax.Attributes; |
|
|
35 |
import org.xml.sax.EntityResolver; |
| 30 |
import org.xml.sax.InputSource; |
36 |
import org.xml.sax.InputSource; |
|
|
37 |
import org.xml.sax.SAXException; |
| 31 |
import org.xml.sax.XMLReader; |
38 |
import org.xml.sax.XMLReader; |
| 32 |
import org.xml.sax.helpers.DefaultHandler; |
39 |
import org.xml.sax.helpers.DefaultHandler; |
| 33 |
|
40 |
|
|
Lines 93-99
Link Here
|
| 93 |
|
100 |
|
| 94 |
// Set content handler to inner class |
101 |
// Set content handler to inner class |
| 95 |
reader.setContentHandler(new ProfileAssertionsHandler()); |
102 |
reader.setContentHandler(new ProfileAssertionsHandler()); |
|
|
103 |
|
| 104 |
if(WSITestToolsProperties.getEclipseContext()) |
| 105 |
{ |
| 106 |
EntityResolver resolver = new EntityResolver(){ |
| 96 |
|
107 |
|
|
|
108 |
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { |
| 109 |
URIResolver resolver = WSITestToolsEclipseProperties.getURIResolver(); |
| 110 |
String uri = resolver.resolve("", publicId, systemId); |
| 111 |
String physicalLocation = resolver.resolvePhysicalLocation("", publicId, uri); |
| 112 |
InputSource is = null; |
| 113 |
try |
| 114 |
{ |
| 115 |
URL url = new URL(physicalLocation); |
| 116 |
is = new InputSource(uri); |
| 117 |
is.setByteStream(url.openStream()); |
| 118 |
} |
| 119 |
catch(Exception e) |
| 120 |
{ |
| 121 |
// Do nothing if opening the stream fails. |
| 122 |
} |
| 123 |
return is; |
| 124 |
} |
| 125 |
|
| 126 |
}; |
| 127 |
reader.setEntityResolver(resolver); |
| 128 |
} |
| 97 |
// Parse profile definition file |
129 |
// Parse profile definition file |
| 98 |
reader.parse(inputSource); |
130 |
reader.parse(inputSource); |
| 99 |
} |
131 |
} |