Java XML Transform Usage getSaxSource(File newFile, SAXParserFactory spf)

Here you can find the source of getSaxSource(File newFile, SAXParserFactory spf)

Description

get Sax Source

License

Apache License

Declaration

private static SAXSource getSaxSource(File newFile, SAXParserFactory spf)
            throws SAXException, ParserConfigurationException, FileNotFoundException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParserFactory;
import javax.xml.transform.sax.SAXSource;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;

public class Main {
    private static SAXSource getSaxSource(File newFile, SAXParserFactory spf)
            throws SAXException, ParserConfigurationException, FileNotFoundException {
        XMLReader xmlReader = spf.newSAXParser().getXMLReader();
        return new SAXSource(xmlReader, new InputSource(new FileInputStream(newFile)));
    }/*w w w  .j  av  a2s. c o  m*/
}

Related

  1. getContentText(Element element)
  2. getDate(final XMLGregorianCalendar xmlGregorianCalendar)
  3. getEmptyXmlFile(File xmlFile)
  4. getImplementationObject()
  5. getNormalizedReader(Reader reader)
  6. getSchema(InputStream... inputs)
  7. getSourceFromEndpointReference(EndpointReference epr)
  8. getStreamSources(File[] stylesheets)
  9. getTemplatesByName(File xslF)