Examples of resolveEntity()


Examples of org.apache.xml.security.test.resource.TestVectorResolver.resolveEntity()

      NodeList nodes = xpathAPI.selectNodeList(doc, xpath, nscontext);
      Canonicalizer c14n =
         Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS);
      byte c14nBytes[] = c14n.canonicalizeXPathNodeSet(nodes);
      InputStream refStream = resolver.resolveEntity(null,
                                 fileRef).getByteStream();
      byte refBytes[] = JavaUtils.getBytesFromStream(refStream);
      assertEquals(new String(refBytes),new String(c14nBytes));
   }
View Full Code Here

Examples of org.apache.xml.security.test.resource.TestVectorResolver.resolveEntity()

      byte utf16[] = convertToUTF16(val.getBytes());
      Canonicalizer c14n =
         Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS);
      byte c14nBytes[] = c14n.canonicalize(utf16);
      org.xml.sax.EntityResolver resolver = new TestVectorResolver();
      InputStream refStream = resolver.resolveEntity(
         null,
            prefix + "/in/testTranslationFromUTF16toUTF8.xml")
               .getByteStream();
      byte refBytes[] = JavaUtils.getBytesFromStream(refStream);
      boolean equal = java.security.MessageDigest.isEqual(refBytes, c14nBytes);
View Full Code Here

Examples of org.jboss.ws.core.utils.JBossWSEntityResolver.resolveEntity()

            URL url = resURL != null ? resURL : orgURL;
           
            log.debug("Load schema: " + nsURI + "=" + url);
            XMLInputSource inputSource = new XMLInputSource(null, url.toExternalForm(), null);

            InputSource tmpSrc = resolver.resolveEntity(null, url.toExternalForm());
            in = tmpSrc.getByteStream() != null ? tmpSrc.getByteStream() : new ResourceURL(url).openStream();
            inputSource.setByteStream(in);
           
            SchemaGrammar grammar = (SchemaGrammar)loader.loadGrammar(inputSource);
            if (grammar == null)
View Full Code Here

Examples of org.springframework.beans.factory.xml.PluggableSchemaResolver.resolveEntity()

            // avoid going to the net to pull down the spring schema,
            // REVISIT may need to be smarter in osgi
            final PluggableSchemaResolver springResolver =
                    new PluggableSchemaResolver(getClass().getClassLoader());
            final InputSource beanInputSource =
                    springResolver.resolveEntity(
                            "http://www.springframework.org/schema/beans",
                            "http://www.springframework.org/schema/beans/spring-beans.xsd");
            if (beanInputSource != null) {
                schemas.add(new StreamSource(beanInputSource.getByteStream()));
            } else {
View Full Code Here

Examples of org.xml.sax.EntityResolver.resolveEntity()

public class CeltixXmlBeanFactoryTest extends TestCase {

    public void testEntityResolver() throws SAXException, IOException, NoSuchMethodException {
        EntityResolver resolver = new CeltixBeansDtdResolver();
        assertNull(resolver.resolveEntity("-//SPRING//DTD BEAN//EN",
            "http://www.springframework.org/dtd/spring-beans.dtd"));
        assertNotNull(resolver.resolveEntity(null,
            "http://celtix.objectweb.org/configuration/spring/celtix-spring-beans.dtd"));
       
       
View Full Code Here

Examples of org.xml.sax.EntityResolver.resolveEntity()

    public void testEntityResolver() throws SAXException, IOException, NoSuchMethodException {
        EntityResolver resolver = new CeltixBeansDtdResolver();
        assertNull(resolver.resolveEntity("-//SPRING//DTD BEAN//EN",
            "http://www.springframework.org/dtd/spring-beans.dtd"));
        assertNotNull(resolver.resolveEntity(null,
            "http://celtix.objectweb.org/configuration/spring/celtix-spring-beans.dtd"));
       
       
        CeltixBeansDtdResolver cer  = EasyMock.createMock(CeltixBeansDtdResolver.class,
            new Method[] {CeltixBeansDtdResolver.class.getDeclaredMethod("getDtdFile", (Class[])null)});
View Full Code Here

Examples of org.xml.sax.EntityResolver.resolveEntity()

      if (resolver == null) {
        String msg = "No EntityResolver available for resolving URI: ";
        throw new InvalidSchemaException(msg + schemaInstanceURI);
      }

      InputSource inputSource = resolver.resolveEntity(null,
          schemaInstanceURI);

      if (resolver == null) {
        throw new InvalidSchemaException("Could not resolve the URI: "
            + schemaInstanceURI);
View Full Code Here

Examples of org.xml.sax.EntityResolver.resolveEntity()

      if (resolver == null) {
        String msg = "No EntityResolver available for resolving URI: ";
        throw new InvalidSchemaException(msg + schemaInstanceURI);
      }

      InputSource inputSource = resolver.resolveEntity(null,
          schemaInstanceURI);

      if (resolver == null) {
        throw new InvalidSchemaException("Could not resolve the URI: "
            + schemaInstanceURI);
View Full Code Here

Examples of org.xml.sax.EntityResolver.resolveEntity()

          if (resolver == null) {
            String msg = "No EntityResolver available";
            throw new InvalidSchemaException(msg);
          }

          InputSource inputSource = resolver.resolveEntity(null,
              inclSchemaInstanceURI);

          if (inputSource == null) {
            String msg = "Could not resolve the schema URI: "
                + inclSchemaInstanceURI;
View Full Code Here

Examples of org.xml.sax.EntityResolver.resolveEntity()

         // expand it before passing it to the parser
         InputSource source = null;
         EntityResolver currentER = parser.getEntityResolver();
         if (currentER != null) {
            source = currentER.resolveEntity("", loc);
         }
         if (source == null) {
            loc = fEntityHandler.expandSystemId(loc);
            source = new InputSource(loc);
         }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.