java.lang.Object
javax.xml.transform.stream.StreamResult
- All Implemented Interfaces:
- Result
- See Also:
- Top Examples, Source Code
public static final String FEATURE
- See Also:
TransformerFactory.getFeature(java.lang.String)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public OutputStream getOutputStream()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public String getSystemId()
- See Also:
- Result
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Writer getWriter()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setOutputStream(OutputStream outputStream)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setSystemId(File f)
- See Also:
NoSuchMethodException
, File.toURL()
, File.toURI()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setSystemId(String systemId)
- See Also:
- Result
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setWriter(Writer writer)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public StreamResult()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public StreamResult(File f)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public StreamResult(OutputStream outputStream)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[1587]Create a XML doc from a DTD
By Anonymous on 2005/11/04 20:23:08 Rate
getting Document srcDoc from somewhere
make some changes to the srcDoc
//Create the new XML doc
Transformer transformer = TransformerFactory.newInstance ( ) .newTransformer ( ) ;
transformer.setOutputProperty ( OutputKeys.DOCTYPE_SYSTEM, "newDoc.dtd" ) ;
transformer.transform ( new DOMSource ( srcDoc ) , new StreamResult ( new FileOutputStream ( "newDoc.xml" ) ) ) ;
public StreamResult(Writer writer)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public StreamResult(String systemId)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[1605]A simple console application to perform XSLT transformations
By Anonymous on 2005/11/04 20:23:08 Rate
import javax.xml.transform.*;
import javax.xml.transform.stream.*;
public class XMLTransformer
{
public static void main ( String [ ] args )
{
if ( args.length < 3 )
{
System.out.println ( "Usage: java XMLTransformer " +
" < source XML > < stylesheet > < destination XML > " ) ;
System.exit ( -1 ) ;
}
try
{
TransformerFactory factory = TransformerFactory.newInstance ( ) ;
Transformer transformer = factory.newTransformer
( new StreamSource ( args [ 1 ] ) ) ;
transformer.transform ( new StreamSource ( args [ 0 ] ) ,
new StreamResult ( args [ 2 ] ) ) ;
}
catch ( Exception ex )
{
ex.printStackTrace ( ) ;
}
}
}