Package javax.xml.transform

Examples of javax.xml.transform.URIResolver.resolve()


        try {
            // Get a Source from the URIResolver

            URIResolver r = controller.getURIResolver();
            Source source = r.resolve(href, baseURL);

            // if a user URI resolver returns null, try the standard one
            // (Note, the standard URI resolver never returns null)
            if (source==null) {
                r = controller.getStandardURIResolver();
View Full Code Here


            // if a user URI resolver returns null, try the standard one
            // (Note, the standard URI resolver never returns null)
            if (source==null) {
                r = controller.getStandardURIResolver();
                source = r.resolve(href, baseURL);
            }

            DocumentInfo newdoc;
            if (source instanceof NodeInfo || source instanceof DOMSource) {
                NodeInfo startNode = controller.prepareInputTree(source);
View Full Code Here

    {
      Source source = null;

      if (null != uriresolver)
      {
        source = uriresolver.resolve(getHref(),
                                     handler.getBaseIdentifier());

        if (null != source && source instanceof DOMSource)
        {
          Node node = ((DOMSource)source).getNode();
View Full Code Here

    {
      Source source = null;

      if (null != uriresolver)
      {
        source = uriresolver.resolve(getHref(),
                                     handler.getBaseIdentifier());

        if (null != source && source instanceof DOMSource)
        {
          Node node = ((DOMSource)source).getNode();
View Full Code Here

     */
    public void testNonMatchingContract() throws Exception {
        URIResolver resolver = new DataURIResolver();
        Source src;
       
        src = resolver.resolve("http://xmlgraphics.apache.org/fop/index.html", null);
        assertNull(src);

        src = resolver.resolve("index.html", "http://xmlgraphics.apache.org/fop/");
        assertNull(src);
    }
View Full Code Here

        Source src;
       
        src = resolver.resolve("http://xmlgraphics.apache.org/fop/index.html", null);
        assertNull(src);

        src = resolver.resolve("index.html", "http://xmlgraphics.apache.org/fop/");
        assertNull(src);
    }
   
    private static boolean byteCmp(byte[] src, int srcOffset, byte[] cmp) {
        for (int i = 0, c = cmp.length; i < c; i++) {
View Full Code Here

     */
    public void testDataURLHandling() throws Exception {
        URIResolver resolver = new DataURIResolver();
        Source src;
       
        src = resolver.resolve("data:;base64,AAECAwQF", null);
        assertNotNull(src);
        StreamSource streamSource = (StreamSource)src;
        byte[] data = IOUtils.toByteArray(streamSource.getInputStream());
        assertTrue("Decoded data doesn't match the test data", byteCmp(TESTDATA, 0, data));

View Full Code Here

        assertNotNull(src);
        StreamSource streamSource = (StreamSource)src;
        byte[] data = IOUtils.toByteArray(streamSource.getInputStream());
        assertTrue("Decoded data doesn't match the test data", byteCmp(TESTDATA, 0, data));

        src = resolver.resolve(
                "data:application/octet-stream;interpreter=fop;base64,AAECAwQF", null);
        assertNotNull(src);
        streamSource = (StreamSource)src;
        assertNotNull(streamSource.getInputStream());
        assertNull(streamSource.getReader());
View Full Code Here

        assertNotNull(streamSource.getInputStream());
        assertNull(streamSource.getReader());
        data = IOUtils.toByteArray(streamSource.getInputStream());
        assertTrue("Decoded data doesn't match the test data", byteCmp(TESTDATA, 0, data));

        src = resolver.resolve("data:,FOP", null);
        assertNotNull(src);
        streamSource = (StreamSource)src;
        assertNull(streamSource.getInputStream());
        assertNotNull(streamSource.getReader());
        String text = IOUtils.toString(streamSource.getReader());
View Full Code Here

    {
      Source source = null;

      if (null != uriresolver)
      {
        source = uriresolver.resolve(getHref(),
                                     handler.getBaseIdentifier());

        if (null != source && source instanceof DOMSource)
        {
          Node node = ((DOMSource)source).getNode();
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.