Package javax.xml.transform.sax

Examples of javax.xml.transform.sax.SAXSource


        unmarshaller.setEventHandler(new TestValidationEventHandler());

        InputStream in = this.getClass().getClassLoader().getResourceAsStream(fileName);
        String expected = readContent(in);

        SAXSource source = new SAXSource(xmlFilter, new InputSource(new ByteArrayInputStream(expected.getBytes())));
        Object object = unmarshaller.unmarshal(source);

        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here


        unmarshaller.setEventHandler(new TestValidationEventHandler());

        InputStream in = this.getClass().getClassLoader().getResourceAsStream(xmlFileName);
        String expected = readContent(in);

        SAXSource source = new SAXSource(xmlFilter, new InputSource(new ByteArrayInputStream(expected.getBytes())));

        Object object = unmarshaller.unmarshal(source);

        Marshaller marshaller = ctx.createMarshaller();
        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
View Full Code Here


        JaxbJavaee.NamespaceFilter xmlFilter = new JaxbJavaee.NamespaceFilter(parser.getXMLReader());
        xmlFilter.setContentHandler(unmarshaller.getUnmarshallerHandler());

        SAXSource source = new SAXSource(xmlFilter, inputSource);

        currentPublicId.set(new TreeSet<String>());
        try {
            return unmarshaller.unmarshal(source);
        } finally {
View Full Code Here


        JaxbWls.NamespaceFilter xmlFilter = new JaxbWls.NamespaceFilter(parser.getXMLReader());
        xmlFilter.setContentHandler(unmarshaller.getUnmarshallerHandler());

        SAXSource source = new SAXSource(xmlFilter, inputSource);

        JaxbWls.currentPublicId.set(new TreeSet<String>());
        try {
            return unmarshaller.unmarshal(source, type);
        } finally {
View Full Code Here

        // add our XMLFilter which disables dtd downloading
        NamespaceFilter xmlFilter = new NamespaceFilter(parser.getXMLReader());
        xmlFilter.setContentHandler(unmarshaller.getUnmarshallerHandler());

        // Wrap the input stream with our filter
        SAXSource source = new SAXSource(xmlFilter, new InputSource(in));

        // unmarshal the document
        return unmarshaller.unmarshal(source);
    }
View Full Code Here

                reader.parse(input);
            } finally {
                _readerManager.releaseXMLReader(reader);
            }
        } else if (source instanceof SAXSource) {
            final SAXSource sax = (SAXSource) source;
            XMLReader reader = sax.getXMLReader();
            final InputSource input = sax.getInputSource();
            boolean userReader = true;

            try {
                // Create a reader if not set by user
                if (reader == null) {
View Full Code Here

  public void loadDocument(String uri) {

      try {
    final long stamp = System.currentTimeMillis();
                _dom = (DOMEnhancedForDTM)_dtmManager.getDTM(
                                 new SAXSource(_reader, new InputSource(uri)),
                                 false, null, true, false);
    _dom.setDocumentURI(uri);

    // The build time can be used for statistics for a better
    // priority algorithm (currently round robin).
View Full Code Here

        } else {
            inputSource = new InputSource(source.getInputStream());
        }
        inputSource.setSystemId(source.getSystemId());
        inputSource.setPublicId(source.getPublicId());
        return new SAXSource(inputSource);
    }
View Full Code Here

    @Converter
    public SAXSource toSAXSourceFromStAX(StAXSource source, Exchange exchange) throws TransformerException {
        String str = toString(source, exchange);
        StringReader reader = new StringReader(str);
        return new SAXSource(new InputSource(reader));
    }
View Full Code Here

    //    if (!href.equals(result)) {
      catalogManager.debug.message(2, "Resolved URI", href, result);
      //    }

    SAXSource source = new SAXSource();
    source.setInputSource(new InputSource(result));
    return source;
  }
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.