Package javax.xml.transform

Examples of javax.xml.transform.URIResolver


    }
   
    public void testTransformWithError() throws Exception {
        result = new XSLTResult(){
            protected URIResolver getURIResolver() {
                return new URIResolver() {
                    public Source resolve(String href, String base) throws TransformerException {
                        throw new TransformerException("Some random error");
                    }
                };
            }
View Full Code Here


      */
      String outputType = null;
      String media = null;
      Vector params = new Vector();
      boolean quietConflictWarnings = false;
      URIResolver uriResolver = null;
      EntityResolver entityResolver = null;
      ContentHandler contentHandler = null;
      int recursionLimit=-1;

      for (int i = 0; i < argv.length; i++)
View Full Code Here

  protected void parse(
          StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
            throws org.xml.sax.SAXException
  {
    TransformerFactoryImpl processor = handler.getStylesheetProcessor();
    URIResolver uriresolver = processor.getURIResolver();

    try
    {
      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

      PrintTraceListener tracer = null;
      String outputType = null;
      String media = null;
      Vector params = new Vector();
      boolean quietConflictWarnings = false;
      URIResolver uriResolver = null;
      EntityResolver entityResolver = null;
      ContentHandler contentHandler = null;

      for (int i = 0; i < argv.length; i++)
      {
View Full Code Here

        assertEquals(17000, info.getSize().getWidthMpt());
        assertEquals(17000, info.getSize().getHeightMpt());
    }
    public void testSAXSourceWithSystemID() throws Exception {
        URIResolver resolver = new URIResolver() {
            public Source resolve(String href, String base) throws TransformerException {
                if (href.startsWith("img:")) {
                    String filename = href.substring(4);
                    InputSource is = new InputSource(base + filename);
                    return new SAXSource(is);
View Full Code Here

        };
        checkImageFound("img:asf-logo.png", resolver);
    }
   
    public void testSAXSourceWithInputStream() throws Exception {
        URIResolver resolver = new URIResolver() {
            public Source resolve(String href, String base) throws TransformerException {
                if (href.startsWith("img:")) {
                    String filename = href.substring(4);
                    InputSource is;
                    try {
View Full Code Here

    public ImageSessionContextTestCase(String name) {
        super(name);
    }
   
    public void testStreamSourceWithSystemID() throws Exception {
        URIResolver resolver = new URIResolver() {
            public Source resolve(String href, String base) throws TransformerException {
                if (href.startsWith("img:")) {
                    String filename = href.substring(4);
                    return new StreamSource(base + filename);
                } else {
View Full Code Here

        ImageSource imgSrc = checkImageInputStreamAvailable(uri, resolver);
        assertTrue(imgSrc.isFastSource()); //Access through local file system
    }

    public void testStreamSourceWithInputStream() throws Exception {
        URIResolver resolver = new URIResolver() {
            public Source resolve(String href, String base) throws TransformerException {
                if (href.startsWith("img:")) {
                    String filename = href.substring(4);
                    try {
                        return new StreamSource(new java.io.FileInputStream(
View Full Code Here

        //We don't pass in the URI, so no fast source is possible
        assertTrue(!imgSrc.isFastSource());
    }

    public void testStreamSourceWithFile() throws Exception {
        URIResolver resolver = new URIResolver() {
            public Source resolve(String href, String base) throws TransformerException {
                if (href.startsWith("img:")) {
                    String filename = href.substring(4);
                    File f = new File(MockImageSessionContext.IMAGE_BASE_DIR, filename);
                    return new StreamSource(f);
View Full Code Here

        ImageSource imgSrc = checkImageInputStreamAvailable(uri, resolver);
        assertTrue(imgSrc.isFastSource()); //Accessed through the local file system
    }

    public void testStreamSourceWithInputStreamAndSystemID() throws Exception {
        URIResolver resolver = new URIResolver() {
            public Source resolve(String href, String base) throws TransformerException {
                if (href.startsWith("img:")) {
                    String filename = href.substring(4);
                    try {
                        File f = new File(MockImageSessionContext.IMAGE_BASE_DIR, filename);
View Full Code Here

TOP

Related Classes of javax.xml.transform.URIResolver

Copyright © 2018 www.massapicom. 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.