Package javax.xml.transform.sax

Examples of javax.xml.transform.sax.SAXSource


    }

    @Test
    public void testGetQNameForSaxSource() throws Exception {
        String contents = "<prefix:localname xmlns:prefix='namespace'/>";
        Source source = new SAXSource(new InputSource(new StringReader(contents)));
        QName qName = PayloadRootUtils.getPayloadRootQName(source, TransformerFactory.newInstance());
        Assert.assertNotNull("getQNameForNode returns null", qName);
        Assert.assertEquals("QName has invalid localname", "localname", qName.getLocalPart());
        Assert.assertEquals("Qname has invalid namespace", "namespace", qName.getNamespaceURI());
        Assert.assertEquals("Qname has invalid prefix", "prefix", qName.getPrefix());
View Full Code Here


            result = unmarshaller.unmarshal(node, declaredType);
        }

        @Override
        public void saxSource(XMLReader reader, InputSource inputSource) throws JAXBException {
            result = unmarshaller.unmarshal(new SAXSource(reader, inputSource), declaredType);
        }
View Full Code Here

            }
        }
        else if (SAXSource.class.isAssignableFrom(parameterType)) {
            ByteArrayInputStream bis = convertToByteArrayInputStream(requestPayload);
            InputSource inputSource = new InputSource(bis);
            return new SAXSource(inputSource);
        }
        else if (StreamSource.class.isAssignableFrom(parameterType)) {
            ByteArrayInputStream bis = convertToByteArrayInputStream(requestPayload);
            return new StreamSource(bis);
        }
View Full Code Here

    @Test
    public void testNamespacesPrefixes() throws Exception {
        saajReader.setFeature("http://xml.org/sax/features/namespaces", true);
        saajReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
        DOMResult result = new DOMResult();
        Source source = new SAXSource(saajReader, new InputSource());
        transformer.transform(source, result);
        DOMResult expected = new DOMResult();
        transformer.transform(new DOMSource(message.getSOAPPart().getEnvelope()), expected);
        assertXMLEqual((Document) expected.getNode(), (Document) result.getNode());
    }
View Full Code Here

    @Test
    public void testNamespacesNoPrefixes() throws Exception {
        saajReader.setFeature("http://xml.org/sax/features/namespaces", true);
        saajReader.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
        DOMResult result = new DOMResult();
        Source source = new SAXSource(saajReader, new InputSource());
        transformer.transform(source, result);
        DOMResult expected = new DOMResult();
        transformer.transform(new DOMSource(message.getSOAPPart().getEnvelope()), expected);
        assertXMLEqual((Document) expected.getNode(), (Document) result.getNode());
    }
View Full Code Here

    String pathToPipelineFile = "classpath:///pdf.xpl"; //use "classpath:///path" for this to work

    String sourceFileNameNormalized = sourceFile.toURI().toString();
    //from super
    final InputSource inputSource = new InputSource(sourceFileNameNormalized);
    Source source = new SAXSource(filter, inputSource);

    Map<String, Object> localMap = new HashMap<String, Object>(map);
    localMap.put("outputType", "pdf");

    //removing webhelp specific settings from map
View Full Code Here

        try {
            if (!(source instanceof SAXSource)) {
                throw new MojoExecutionException("Expecting a SAXSource");
            }
            SAXSource saxSource = (SAXSource) source;

            return run(log, pipelineURI, saxSource.getInputSource(),map);
        } catch (FileNotFoundException e) {
            throw new MojoExecutionException("Failed to find source.", e);
        }
       
    }
View Full Code Here

        String pathToPipelineFile = "classpath:///webhelp.xpl"; //use "classpath:///path" for this to work

  String sourceFileNameNormalized = sourceFile.toURI().toString();
  //from super
  final InputSource inputSource = new InputSource(sourceFileNameNormalized);
  Source source = new SAXSource(filter, inputSource);
  //Source source = super.createSource(inputFilename, sourceFile, filter);

        Map<String, Object> map = new HashMap<String, Object>();
       
       
View Full Code Here

            throws MojoExecutionException {

        String pathToPipelineFile = "classpath:///wadl2html.xpl"; //use "classpath:///path" for this to work

        final InputSource inputSource = new InputSource(sourceFile.toURI().toString());
        Source source = new SAXSource(filter, inputSource);

        Map<String, Object> map = new HashMap<String, Object>();
       
        map.put("security", security);
        map.put("pdfFilename", pdfFilename);
View Full Code Here

        String pathToPipelineFile = "classpath:///pdf.xpl"; //use "classpath:///path" for this to work

  String sourceFileNameNormalized = sourceFile.toURI().toString();
  //from super
  final InputSource inputSource = new InputSource(sourceFileNameNormalized);
  Source source = new SAXSource(filter, inputSource);
        //Source source = super.createSource(inputFilename, sourceFile, filter);

        Map<String, Object> map=new HashMap<String, Object>();
      String sysSecurity=System.getProperty("security");
      getLog().info("adjustTransformer():sysSecurity="+sysSecurity);
View Full Code Here

TOP

Related Classes of javax.xml.transform.sax.SAXSource

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.