Mark Wilson I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :
03/24/2008
Times viewed :
226
The javax.xml.transform.dom.DOMSource Class
All Known Implementing Interfaces: javax.xml.transform.Source
Members
Signature
Public methods
Node
getNode()
String
getSystemId()
void
setNode(Node node)
void
setSystemId(String baseID)
Overview
This class acts as a holder for a transformation Source tree in the form
of a Document Object Model (DOM) tree. This class implements the Source
interface.
Method Overviews
Important methods of this class are getNode(),setNode(Node node)
Example of getNode()
This method returns the node that represents a
Source DOM tree.
Document sourceNode =
DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(sourcesystemURI);
//This is your source DOM object which will be used in transformation.
DOMSource source = new DOMSource(sourceNode);
transformer.transform(source,result);
Document sourceroot = (Document) source.getNode();
//sourceroot contains the source node.
Example of setNode(Node node)
Set the node that will represents a Source DOM tree.
DOMSource source = new DOMSource();
source.setNode(sourceNode); //sourceNode is the
Node, that you want to use in transformation.