Oracle9i XML API Reference - XDK and Oracle XML DB Release 2 (9.2) Part Number A96616-01 |
|
Oracle XML JavaBeans are synonymous with the following packages:
This is a non-visual bean. It enables asynchronous DOM parsing in separate threads in the background. It utilizes the EventHandler interface to notify the calling class when the job is complete. The classes of the oOracle.xml.async
are summarized in Table 10-1.
This class encapsulates an eXtensible Markup Language (XML) 1.0 parser to parse an XML document and build a DOM tree. The parsing is done in a separate thread and DOMBuilderListener interface must be used for notification when the tree is built.
public class DOMBuilder extends java.lang.Object implements java.io.Serializable, oracle.xml.async.DOMBuilderConstants, java.lang.Runnable java.lang.Object | +--oracle.xml.async.DOMBuilder
Creates a new parser object. The options are described in the following table.
Syntax | Description |
---|---|
public DOMBuilder(); |
Creates a new parser object. |
int id); |
Creates a new parser object with a given id. |
Parameter | Description |
---|---|
id |
The DOMBuilder id. |
Adds DOMBuilderErrorListener.
public void addDOMBuilderErrorListener( DOMBuilderErrorListener p0);
Parameter | Description |
---|---|
p0 |
The DOMBuilderErrorListener to add. |
Adds DOMBuilderListener
public void addDOMBuilderListener(DOMBuilderListener p0);
Parameter | Description |
---|---|
p0 |
The DOMBuilderListener to add. |
Gets the DTD.
public synchronized oracle.xml.async.DTD getDoctype();
Gets the document for parsing.
public synchronized oracle.xml.async.XMLDocument getDocument();
Returns the parser object id (DOMBuilder).
public int getId();
Returns the release version of the Oracle XML Parser, as a String.
public synchronized java.lang.String getReleaseVersion();
Gets the document being parsed.
public synchronized org.w3c.dom.Document getResult();
Returns the validation mode; TRUE
if XML parser is validating, FALSE
otherwise.
public synchronized boolean getValidationMode()
Parses the XML from given input. Throws the following exceptions:
XMLParseException |
If syntax or other error encountered. |
SAXException |
Any SAX exception, possibly wrapping another exception. |
IOExceptiopn |
I/O Error. |
The options are described in the following table.
Parses the XML External DTD. Throws the following exceptions:
XMLParseException |
If syntax or other error encountered. |
SAXException |
Any SAX exception, possibly wrapping another exception. |
IOExceptiopn |
I/O Error. |
The options are described in the following table.
Removes DOMBuilderErrorListener.
public synchronized void removeDOMBuilderErrorListener( DOMBuilderErrorListener p0);
Parameter | Description |
---|---|
po |
The DOMBuilderErrorListener to remove. |
Removes DOMBuilderListener.
public synchronized void removeDOMBuilderListener( DOMBuilderListener p0);
Parameter | Description |
---|---|
p1 |
The DOMBuilderListener to remove. |
This method runs in a thread. It is specified in java.lang.Runnable.run() in interface java.lang.Runnable.
public void run();
Sets the base URL for loading external entities and DTDs. This method should to be called if the parse(InputStream) option is used to parse the XML Document.
public synchronized void setBaseURL( java.net.URL url);
Parameter | Description |
---|---|
url |
The base URL. |
Sets a flag to turn on debug information in the document.
public void setDebugMode(boolean flag);
Parameter | Description |
---|---|
flag |
Determines whether debug information is stored; |
Sets the DTD.
public synchronized void setDoctype(oracle.xml.async.DTD dtd)
Parameter | Description |
---|---|
dtd |
The DTD to set and use while parsing. |
Creates an output stream for errors and warnings. If an output stream for errors is not specified, the parser will use the standard error output stream System.err for outputting errors and warnings. The options are described in the following table.
Parameter | Description |
---|---|
out |
The the output for errors and warnings. |
enc |
The encoding to use. |
Sets the node factory. Applications can extend the NodeFactory and register it through this method. The parser will then use the user supplied NodeFactory to create nodes of the DOM tree. Throws the following exception:
XMLParseException |
If an invalid factory is set. |
public synchronized void setNodeFactory( oracle.xml.async.NodeFactory factory);
Parameter | Description |
---|---|
factory |
The NodeFactory to set. |
Sets the white space preservation mode.
public synchronized void setPreserveWhitespace( boolean flag);
Parameter | Description |
---|---|
flag |
The preserving mode; |
Sets the validation mode.
public synchronized void setValidationMode(boolean yes);
Parameter | Description |
---|---|
yes |
Determines whether the XML parser should be validating; |
Determines whether to print warnings.
public synchronized void showWarnings(boolean yes);
Parameter | Description |
---|---|
yes |
Switch; |
This class provides information about the DOMBuilder Bean.
public class DOMBuilderBeanInfo extends java.beans.SimpleBeanInfo java.lang.Object | +--java.beans.SimpleBeanInfo | +--oracle.xml.async.DOMBuilderBeanInfo
The default constructor.
public DOMBuilderBeanInfo();
Gets an image object that can be used to represent the DOMBuilder bean in toolbars, toolboxes, and so on. Returns an image object representing the requested icon type. Overrides getIcon()
method in java.beans.SimpleBeanInfo
Class.
public java.awt.Image getIcon( int iconKind);
Parameter | Description |
---|---|
iconKind |
The kind of icon requested. |
Retrieves the array of DOMBuilder bean's editable PropertyDescriptiors. Overrides getPropertyDescriptors()
in java.beans.SimpleBeanInfo
Class.
public java.beans.PropertyDescriptor[] getPropertyDescriptors();
This class defines the error event which is sent when parse exception occurs.
public class DOMBuilderErrorEvent extends java.util.EventObject java.lang.Object | +--java.util.EventObject | +--oracle.xml.async.DOMBuilderErrorEvent
Field | Syntax | Description |
---|---|---|
|
protected java.lang.Exception |
The exception being raised. |
Method | Description |
---|---|
Constructor for DOMBuilderErrorEvent. |
|
Retrieves the exception being raised. |
|
Returns the error message generated by the parser. |
Constructor for DOMBuilderErrorEvent.
public DOMBuilderErrorEvent( Object p0, Exception e);
Parameter | Description |
---|---|
p0 |
The Object that created this error event. |
e |
The Exception being raised. |
Retrieves the exception being raised.
public java.lang.Exception getException();
Returns the error message generated by the parser, as a String.
public java.lang.String getMessage();
This interface must be implemented in order to receive notifications when error is found during parsing. The class implementing this interface must be added to the DOMBuilder using addDOMBuilderErrorListener method.
public interface DOMBuilderErrorListener extends java.util.EventListener
This method is called when a parse error occurs.
public void domBuilderErrorCalled( DOMBuilderErrorEvent p0);
Parameter | Description |
---|---|
p0 |
The DOMBuilderErrorEvent object produced by the DOMBuilder as result of parsing error. |
The event object that DOMBuilder uses to notify all registered listeners about parse events.
public class DOMBuilderEvent extends java.util.EventObject java.lang.Object | +--java.util.EventObject | +--oracle.xml.async.DOMBuilderEvent
Field | Syntax | Description |
---|---|---|
id |
protected int id |
ID of the source DOMBuilder object |
Method | Description |
---|---|
Creates a new DOMBuilderEvent. |
|
Returns unique id of the source DOMBuilder for the event. |
Creates a new DOMBuilderEvent.
public DOMBuilderEvent( Object p0, int p1);
Parameter | Description |
---|---|
p0 |
The Object creating this event. |
p1 |
Id of the DOMBuilder creating this event. |
Returns unique id of the source DOMBuilder for this event, which can be used to identify which instance of the DOMBuilder generated this event in cases where multiple instances of DOMBuilder may be working in background.
public int getID();
This interface must be implemented in order to receive notifications about events during the asyncronous parsing. The class implementing this interface must be added to the DOMBuilder using addDOMBuilderListener method.
public interface DOMBuilderListener extends java.util.EventListener
Method | Description |
---|---|
This method is called when parse error occur. |
|
This method is called when the parse is complete. |
|
This method is called when parse starts |
This method is called when parse error occur.
public void domBuilderError( DOMBuilderEvent p0);
Parameter | Description |
---|---|
p0 |
The DOMBuilderEvent object produced by the DOMBuilder. |
This method is called when the parse is complete.
public void domBuilderOver( DOMBuilderEvent p0);
Parameter | Description |
---|---|
p0 |
The DOMBuilderEvent object produced by the DOMBuilder. |
This method is called when parse starts.
public void domBuilderStarted( DOMBuilderEvent p0);
Parameter | Description |
---|---|
p0 |
The DOMBuilderEvent object produced by the DOMBuilder. |
Implements a semaphore and maintains access to a fixed number of logical resources.
public class ResourceManager extends java.lang.Object java.lang.Object | +--oracle.xml.async.ResourceManager
The ResourceManager constructor.
public ResourceManager(int i);
Parameter | Description |
---|---|
i |
The number of resources to manage. |
Checks if any of the logical resources being managed are in active use. Returns TRUE
if one or more resources in use, FALSE
if no resources in use.
public boolean activeFound();
If the number of resources available for use is nonzero, the method decreases the number of resources by one. Otherwise, it waits until a resource is released and it becomes available for use.
public synchronized void getResource();
Releases a resource. When this method is called, the number of resources available is increased by one.
public void releaseResource();
Allows use of Thread.sleep() without try/catch.
public void sleep(int i);
Parameter | Description |
---|---|
i |
The number of resources to manage. |
Applies XSL transformation in a background thread.
public class XSLTransformer extends java.lang.Object implements java.io.Serializable, oracle.xml.async.XSLTransformerConstants, java.lang.Runnable java.lang.Object | +--oracle.xml.async.XSLTransformer
XSLTransformer constructor. The options are described in the following table.
Syntax | Description |
---|---|
public XSLTransformer(); |
XSLTransformer constructor. |
int id); |
XSLTransformer constructor accepting an identifier. |
Parameter | Description |
---|---|
id |
A unique integer that can be used to identify the XSLTransformer instance during event processing |
Adds an XSLTransformerErrortListener.
public void addXSLTransformerErrorListener( XSLTransformerErrorListerner p0);
Parameter | Description |
---|---|
p0 |
XSLTransformerErrorListener to be added. |
Adds a XSLTransformerListener.
public void addXSLTransformerListener( XSLTransformerListerner p0);
Parameter | Description |
---|---|
p0 |
XSLTransformerListener to be added. |
Returns the unique XSLTransformer id.
public int getId();
Returns the document fragment of the XSL transformation for the resulting document. Called only after receiving notification that the transformation is complete. Since the transformation occurs in background and asyncronously, calling this method immediately after processXSL()
will result in holding the control until the result is available.
public synchronized oracle.xml.async.DocumentFragment getResult();
Initiates XSL Transformation in the background. The control is returned immediately. An XSLException
is thrown if an error occurs during XSL transformation. The options are described in the following table.
Removes an XSLTransformerErrorListener.
public synchronized void removeDOMTransformerErrorListener( XSLTransformerErrorListener p0);
Parameter | Description |
---|---|
p0 |
The XSLTransformerErrorListener to be removed. |
Removes a XSLTransformerListener.
public synchronized void removeXSLTransformerListener( XSLTransformerListener p0);
Parameter | Description |
---|---|
p0 |
The XSLTransformerListener to be removed. |
Starts a separate thread to perform the XSLTransformation. Specified by java.lang.Runnable.run() in java.lang.Runnable Interface.
public void run();
Sets the error stream used by the XSL processor.
public final void setErrorStream( java.io.OutputStream out);
Parameter | Description |
---|---|
out |
The error output stream for the XSL processor. |
Sets the showWarnings flag used by the XSL processor.
public final void showWarnings( boolean yes);
Parameter | Description |
---|---|
yes |
Indicates whether XSL processor warnings should be shown; |
This class provides information about the XSLTransformer Bean.
public class XSLTransformerBeanInfo extends java.beans.SimpleBeanInfo java.lang.Object | +--java.beans.SimpleBeanInfo | +--oracle.xml.async.XSLTransformerBeanInfo
java.beans.BeanInfo
The default Constructor.
public XSLTransformerBeanInfo();
Retrieves an image object representing the requested icon type for XSLTransformer bean in toolbars, toolboxes, and so on. Overrides getIcon()
in java.beans.SimpleBeanInfo
class.
public java.awt.Image getIcon( int iconKind);
Parameter | Description |
---|---|
iconKind |
The kind of icon requested. |
Retrieves the array of XSLTransformer bean's editable PropertyDescriptiors. Overrides getPropertyDescriptors()
in java.beans.SimpleBeanInfo
class.
public java.beans.PropertyDescriptor[] getPropertyDescriptors();
The error event object that XSLTransformer uses to notify all registered listeners about transformation error events.
public class XSLTransformerErrorEvent extends java.util.EventObject java.lang.Object | +--java.util.EventObject | +--oracle.xml.async.XSLTransformerErrorEvent
java.io.Serializable
Field | Syntax | Description |
---|---|---|
e |
protected java.lang.Exception e |
The exception being raised. |
Constructor for XSLTransformerErrorEvent.
public XSLTransformerErrorEvent( Object p0, Exception e);
Parameter | Description |
---|---|
p0 |
The Object that created this event. |
e |
The exception raised. |
Returns the transformation exception that XSLTransformer encountered an object unique id.
public Exception getException();
Returns the error message that describes the error encountered by XSLTransformer.
public String getMessage();
This interface must be implemented in order to receive notifications about error events during the asynchronous transformation. The class implementing this interface must be added to the XSLTransformer using addXSLTransformerListener method.
public interface XSLTransformerErrorListener extends java.util.EventListener
his method is called when parse or transformation error occurs.
public void xslTransformerErrorCalled( XSLTransformerErrorEvent p0);
Parameter | Description |
---|---|
p0 |
The XSLTransformerErrorEvent object produced by the XSLTransformer. |
This class represents the event object used by XSLTransformer to notify XSL transformation events to all its registered listeners.
public class XSLTransformerEvent extends java.util.EventObject java.lang.Object | +--java.util.EventObject | +--oracle.xml.async.XSLTransformerEvent
java.io.Serializable
Field | Syntax | Description |
---|---|---|
id |
protected int id |
ID of the source XSLTransformer object |
Method | Description |
---|---|
Constructs the XSLTransformerEvent object using the XSLTransformer source object and its unique id. |
|
Returns unique id of the XSLTransformer object |
Constructs the XSLTransformerEvent object using the XSLTransformer source object and its unique id.
public XSLTransformerEvent(java.lang.Object p0, int p1);
Parameter | Description |
---|---|
p0 |
The source XSLTransformer object that will fire the events |
p1 |
Unique id identifying the source object |
Returns unique id of the XSLTransformer object which can be used to identify which instance of the XSLTransformer generated this event in cases where multiple instances of XSLTransformer may be working in background.
public int getID();
public interface XSLTransformerListener extends java.util.EventListener
This interface must be implemented in order to receive notifications about events during the asynchronous transformation. The class implementing this interface must be added to the XSLTransformer using addXSLTransformerListener method.
Method | Description |
---|---|
This method is called when parse or transformation error occur. |
|
This method is called when the transformation is complete. |
|
This method is called when the transformation starts. |
This method is called when parse or transformation error occur.
public void xslTransformerError( XSLTransformerEvent p0);
Parameter | Description |
---|---|
p0 |
The XSLTransformerEvent object produced by the XSLTransformer. |
This method is called when the transformation is complete.
public void xslTransformerOver( XSLTransformerEvent p0);
Parameter | Description |
---|---|
p0 |
The XSLTransformerEvent object produced by the XSLTransformer. |
This method is called when the transformation starts.
public void xslTransformerStarted( XSLTransformerEvent p0);
Parameter | Description |
---|---|
p0 |
The XSLTransformerEvent object produced by the XSLTransformer. |
This is a visual bean used to display and edit HTML, XML or XSL file. XML files can be transferred between the file system, the database and the bean buffers. It can be used to transform database queries to XML. XML files can be parsed and transformed using XSL. The classes of the oOracle.xml.dbviewer
as summarized in Table 10-19.
Java bean that can be used to display database queries or any XML by applying XSL stylesheets and visualizing the resulting HTML in a scrollable swing panel. This bean has tree buffers: XML, XSL and result buffer. The bean API enables the calling program to load/save the buffers from various sources and to apply stylesheet transformations to the XML buffer using the stylesheet in the XSL buffer. The result can be stored in the result buffer.
The XML and XSL buffer content can be shown as source or as a tree structures. The result buffer content can be rendered as HTML, and also shown as source or tree structures. The XML buffer can be loaded from database query.
All buffers can load and save files both from CLOB tables in Oracle database and from the file system. Therefore, the control can be used to move files between the file system and the user schema in the database.
public class DBViewer extends javax.swing.JPanel implements java.io.Serializable java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--oracle.xml.dbviewer.DBViewer
javax.accessibility.Accessible
java.awt.image.ImageObserver
java.awt.MenuContainer
java.io.Serializable
Constructs a new instance of DBViewer.
public DBViewer();
Retrieves the database host name.
public java.lang.String getHostname();
Retrieves the database instance name.
public java.lang.String getInstancename();
Retrieves the user password.
public java.lang.String getPassword();
Retrieves the database port number as a String.
public java.lang.String getPort();
Retrieves the content of the result buffer.
public java.lang.String getResBuffer();
Retrieves the result CLOB file name.
public java.lang.String getResCLOBFileName();
Retrieves the result CLOB table name.
public java.lang.String getResCLOBTableName();
Retrieves the result file name.
public java.lang.String getResFileName();
Retrieves the user name.
public java.lang.String getUsername();
Retrieves the content of the XML buffer.
public java.lang.String getXmlBuffer();
Retrieves the XML CLOB file name.
public java.lang.String getXmlCLOBFileName();
Retrieves the XML CLOB table name.
public java.lang.String getXmlCLOBTableName();
Retrieves the XML file name.
public java.lang.String getXmlFileName();
Retrieves the XML presentation of a result set from SQL query as an XMLString.
public java.lang.String getXMLStringFromSQL( java.lang.String sqlText);
Parameter | Description |
---|---|
sqlText |
The SQL text. |
Retrieves the content of the XSL buffer.
public java.lang.String getXslBuffer();
Retrieves the XSL CLOB file name.
public java.lang.String getXslCLOBFileName();
Retrieves XSL CLOB table name.
public java.lang.String getXslCLOBTableName();
Retrieves XSL file name.
public java.lang.String getXslFileName();
Loads the result buffer. The options are described in the following table.
Parameter | Description |
---|---|
filename |
The file name. |
clobTablename |
The CLOB table name. |
clobFilename |
The CLOB file name. |
resDoc |
The XMLDocument. |
Loads the result buffer from CLOB file.
public void loadResBufferFromClob();
Loads the result buffer from file.
public void loadResBufferFromFile();
Loads the XML buffer. The options are described in the following table.
Parameter | Description |
---|---|
filename |
The file name. |
clobTablename |
The CLOB table name. |
clobFilename |
The CLOB file name. |
resDoc |
The XMLDocument. |
Loads the XML buffer from CLOB file.
public void loadXmlBufferFromClob();
Loads the XML buffer from file.
public void loadXmlBufferFromFile();
Loads the XML buffer from SQL result set.
public void loadXMLBufferFromSQL( String sqlText);
Parameter | Description |
---|---|
sqlText |
SQL text |
Loads the XSL buffer from file. The options are described in the following table.
Parameter | Description |
---|---|
filename |
The file name. |
clobTablename |
The CLOB table name. |
clobFilename |
The CLOB file name. |
xslDoc |
The XMLDocument. |
Loads the XSL buffer from CLOB file.
public void loadXslBufferFromClob();
Loads the XSL buffer from file.
public void loadXslBufferFromFile();
Parses the result buffer, refreshes the tree and source views, and returns the XMLDocument.
public oracle.xml.parser.v2.XMLDocument parseResBuffer();
Parse the XML buffer, refreshes the tree and source views, and returns the XMLDocument.
public oracle.xml.parser.v2.XMLDocument parseXmlBuffer();
Parses the XSL buffer, refreshes the tree and source views, and returns the XMLDocument.
public oracle.xml.parser.v2.XMLDocument parseXslBuffer();
Saves the result buffer to file. The options are described in the following table.
Syntax | Description |
---|---|
String filename); |
Save the result buffer to file. |
String filename); |
Save the result buffer to CLOB file. |
Parameter | Description |
---|---|
tablename |
The CLOB table name. |
filename |
The CLOB file name. |
Saves the result buffer to CLOB file.
public void saveResBufferToClob();
Saves the result buffer to file.
public void saveResBufferToFile();
Saves the XML buffer to file. The options are described in the following table.
Syntax | Description |
---|---|
String filename); |
Saves the XML buffer to file. |
String filename); |
Saves the XML buffer to CLOB file. |
Parameter | Description |
---|---|
tablename |
The CLOB table name. |
filename |
The CLOB file name. |
Saves the XML buffer to CLOB file.
public void saveXmlBufferToClob();
Saves the XML buffer to file.
public void saveXmlBufferToFile();
Saves the XSL buffer to file. The options are described in the following table.
Syntax | Description |
---|---|
String fileName); |
Saves the XSL buffer to file in the file system. |
String fileName); |
Saves the XSL buffer to a CLOB file. |
Parameter | Description |
---|---|
tableName |
The table name. |
fileName |
The file name. |
Saves the XSL buffer to CLOB file.
public void saveXslBufferToClob();
Saves the XSL buffer to file.
public void saveXslBufferToFile();
Sets database host name.
public void setHostname( java.lang.String hostname);
Parameter | Description |
---|---|
hostname |
The host name. |
Sets database instance name.
public void setInstancename( String instancename);
Parameter | Description |
---|---|
instancename |
The database instance name. |
Sets user password.
public void setPassword( String password);
Parameter | Description |
---|---|
password |
The user password. |
Sets database port number.
public void setPort( String port);
Parameter | Description |
---|---|
port |
String containing the port number. |
Sets new text in the result buffer.
public void setResBuffer( String text);
Parameter | Description |
---|---|
text |
The new text. |
Sets result CLOB file name.
public void setResCLOBFileName( String name);
Parameter | Description |
---|---|
name |
Result CLOB file name. |
Sets result CLOB table name.
public void setResCLOBTableName( String name);
Parameter | Description |
---|---|
name |
Result CLOB table name. |
Sets result file name.
public void setResFileName( String name);
Parameter | Description |
---|---|
name |
Result file name. |
Show the result buffer as rendered HTML.
public void setResHtmlView( boolean on);
Parameter | Description |
---|---|
on |
Switch for showing result buffer as HTML; |
Shows the result buffer as XML source and enter edit mode.
public void setResSourceEditView( boolean on);
Parameter | Description |
---|---|
on |
Switch for showing result buffer as HTML with edit mode; |
Shows the result buffer as XML source.
public void setResSourceView( boolean on);
Parameter | Description |
---|---|
on |
Switch for showing result buffer as XML source; |
Shows the result buffer as an XML tree view.
public void setResTreeView( boolean on);
Parameter | Description |
---|---|
on |
Switch for showing result buffer as an XML tree view; |
Sets the user name.
public void setUsername( String username);
Parameter | Description |
---|---|
username |
The user name. |
Sets new text in the XML buffer.
public void setXmlBuffer( String text)
Parameter | Description |
---|---|
text |
The XML text |
Sets XML CLOB file name.
public void setXmlCLOBFileName( String name);
Parameter | Description |
---|---|
name |
The XML CLOB file name. |
Sets the XML CLOB table name.
public void setXmlCLOBTableName( String name);
Parameter | Description |
---|---|
name |
The XML CLOB table name. |
Sets the XML file name.
public void setXmlFileName( String name);
Parameter | Description |
---|---|
name |
The XML file name. |
Shows the XML buffer as XML source and enter edit mode.
public void setXmlSourceEditView( boolean on);
Parameter | Description |
---|---|
on |
Switch for showing the XML buffer as XML source with edit mode; |
Shows the XML buffer as an XML source.
public void setXmlSourceView( boolean on);
Parameter | Description |
---|---|
on |
Switch for showing the XML buffer as XML source; |
Shows the XML buffer as tree.
public void setXmlTreeView( boolean on);
Parameter | Description |
---|---|
on |
Switch for showing the XML buffer as XML tree; |
Sets new text in the XSL buffer.
public void setXslBuffer( String text);
Parameter | Description |
---|---|
text |
The XSL text. |
Sets the XSL CLOB file name.
public void setXslCLOBFileName( String name);
Parameter | Description |
---|---|
name |
The XSL CLOB file name. |
Sets the XSL CLOB table name.
public void setXslCLOBTableName( String name);
Parameter | Description |
---|---|
name |
The XSL CLOB table name. |
Sets the XSL file name.
public void setXslFileName( String name);
Parameter | Description |
---|---|
name |
The XSL file name. |
Shows the XSL buffer as XML source and enter edit mode.
public void setXslSourceEditView( boolean on);
Parameter | Description |
---|---|
on |
Switch for showing the XSL buffer as XML source with edit mode; |
Shows the XSL buffer as an XML source.
public void setXslSourceView( boolean on);
Parameter | Description |
---|---|
on |
Switch for showing the XSL buffer as XML source; |
Shows the XSL buffer as tree.
public void setXslTreeView( boolean on);
Parameter | Description |
---|---|
on |
Switch for showing the XSL buffer as XML tree; |
Transforms the content of the XML buffer by applying the stylesheet from the XSL buffer.
public oracle.xml.parser.v2.XMLDocument transformToDoc();
Applies the stylesheet transformation from the XSL buffer to the XML in the XML buffer, and stores the result in the result buffer.
public void transformToRes();
Transfroms the content of the XML buffer by applying the stylesheet from the XSL buffer.
public java.lang.String transformToString();
This class provides information about the DBViewer Bean.
public class DBViewerBeanInfo extends java.beans.SimpleBeanInfo java.lang.Object | +--java.beans.SimpleBeanInfo | +--oracle.xml.dbviewer.DBViewerBeanInfo
Class constructor.
public DBViewerBeanInfo();
Retrieves an image object representing the requested icon type for DBViewer bean in toolbars, toolboxes, and so on. Overrides getIcon()
in java.beans.SimpleBeanInfo
class.
public java.awt.Image getIcon( int iconKind);
Parameter | Description |
---|---|
iconKind |
The kind of icon requested. |
Retrieves an array of DBViwer bean's editable PropertyDescriptors. Overrides getPropertyDescriptors()
in java.beans.SimpleBeanInfo
Class.
public java.beans.PropertyDescriptor[] getPropertyDescriptors();
This is a visual bean used to display an XML source document with syntax highlighting. The color, fonts and sizes of different XML language element are customizable.
The classes of the oOracle.xml.srcviewer
as summarized in Table 10-22.
Class | Description |
---|---|
Shows an XML document. |
|
This class provides information about the XMLSourceView Bean. |
Shows an XML document. Recognizes the following XML token types: Tag, Attribute Name, Attribute Value, Comment, CDATA, PCDATA, PI Data, PI Name and NOTATION Symbol. Each token type has a foreground color and font. The default color/font settings can be changed by the user. Takes as input an org.w3c.dom.Document object.
public class XMLSourceView extends javax.swing.JPanel implements java.io.Serializable java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--oracle.xml.srcviewer.XMLSourceView
javax.accessibility.Accessible
java.awt.image.ImageObserver
java.awt.MenuContainer
java.io.Serializable
The class constructor. Creates an object of type XMLSourceView.
public XMLSourceView();
Extracts and returns the font from a given attribute set.
public static java.awt.Font fontGet( javax.swing.text.AttributeSet attributeSet);
Parameter | Description |
---|---|
attributeSet |
The source AttributeSet. |
Sets the mutable attribute set font.
public static void fontSet( javax.swing.text.MutableAttributeSet mutAttributeSet, java.awt.Font font);
Parameter | Description |
---|---|
mutAttributeSet |
The mutableattributeset to update. |
font |
The new Font for the mutableattributeset. |
Returns the Attribute Value font.
public java.awt.Font getAttributeNameFont();
Returns the Attribute Name foreground color.
public java.awt.Color getAttributeNameForeground();
Returns the Attribute Value font.
public java.awt.Font getAttributeValueFont();
Returns the Attribute Value foreground color.
public java.awt.Color getAttributeValueForeground();
Returns the background color. Overrides getBackground() in java.awt.Component class.
public java.awt.Color getBackground();
Returns the CDATA font.
public java.awt.Font getCDATAFont();
Returns the CDATA foreground color.
public java.awt.Color getCDATAForeground();
Returns the Comment Data font.
public java.awt.Font getCommentDataFont();
Returns the Comment Data foreground color.
public java.awt.Color getCommentDataForeground();
Returns the edited text.
public java.lang.String getEditedText();
Returns the viewer JTextPane
component used by XMLSourceViewer.
public javax.swing.JTextPane getJTextPane();
Returns the XMLSourceView minimal size. Overrides getMinimumSize() in javax.swing.JComponent class.
public java.awt.Dimension getMinimumSize();
Returns the XML node at a given offset.
public org.w3c.dom.Node getNodeAtOffset( int i);
Parameter | Description |
---|---|
i |
The node offset. |
Returns the PCDATA font.
public java.awt.Font getPCDATAFont();
Returns the PCDATA foreground color.
public java.awt.Color getPCDATAForeground();
Returns the PI Data font.
public java.awt.Font getPIDataFont();
Returns the PI Data foreground color.
public java.awt.Color getPIDataForeground();
Returns the PI Name font.
public java.awt.Font getPINameFont();
Returns the PI Data foreground color.
public java.awt.Color getPINameForeground();
Returns the NOTATION Symbol font.
public java.awt.Font getSymbolFont();
Returns the NOTATION Symbol foreground color.
public java.awt.Color getSymbolForeground();
Returns the Tag font.
public java.awt.Font getTagFont();
Returns the Tag foreground color.
public java.awt.Color getTagForeground();
Returns the XML document as a String.
public java.lang.String getText();
Returns boolean to indicate whether this object is editable.
public boolean isEditable();
Moves the cursor to XML Node at the specified offset.
public void selectNodeAt( int i);
Parameter | Description |
---|---|
i |
The node offset. |
Sets the Attribute Name font.
public void setAttributeNameFont( java.awt.Font font);
Parameter | Description |
---|---|
font |
The new Font Attribute Name. |
Sets the Attribute Name foreground color.
public void setAttributeNameForeground( java.awt.Color color);
Parameter | Description |
---|---|
color |
The new Color for Attribute Name. |
Sets the Attribute Value font.
public void setAttributeValueFont( java.awt.Font font);
Parameter | Description |
---|---|
font |
The new Font Attribute Value |
Sets the Attribute Value foreground color.
public void setAttributeValueForeground( java.awt.Color color);
Parameter | Description |
---|---|
color |
The new Color for Attribute Value. |
Sets the background color. Overrides setBackground()
in javax.swing.JComponent
class.
public void setBackground( java.awt.Color color);
Parameter | Description |
---|---|
font |
The new background Color. |
Sets the CDATA font.
public void setCDATAFont( java.awt.Font font);
Parameter | Description |
---|---|
font |
The new Font for CDATA. |
Sets the CDATA foreground color.
public void setCDATAForeground( java.awt.Color color);
Parameter | Description |
---|---|
color |
The new Color for CDATA. |
Sets the Comment font.
public void setCommentDataFont( java.awt.Font font);
Parameter | Description |
---|---|
font |
The new Font for the XML Comments. |
Sets the Comment foreground color.
public void setCommentDataForeground( java.awt.Color color);
Parameter | Description |
---|---|
color |
The new Color for Comment. |
Sets the specified boolean to indicate whether this object should be editable.
public void setEditable( boolean edit);
Parameter | Description |
---|---|
edit |
Flag indicating if the object should be editable; |
Sets the PCDATA font.
public void setPCDATAFont( java.awt.Font font);
Parameter | Description |
---|---|
font |
The new Font for PCDATA. |
Sets the PCDATA foreground color.
public void setPCDATAForeground( java.awt.Color color);
Parameter | Description |
---|---|
color |
The new Color for PCDATA. |
Sets the PI Data font.
public void setPIDataFont( java.awt.Font font);
Parameter | Description |
---|---|
font |
The new Font for PI Data. |
Sets the PI Data foreground color.
public void setPIDataForeground( java.awt.Color color);
Parameter | Description |
---|---|
color |
The new Color for PI Data. |
Sets the PI Name font.
public void setPINameFont(java.awt.Font font);
Parameter | Description |
---|---|
font |
The new Font for the PI Names. |
Sets the PI Name foreground color.
public void setPINameForeground( java.awt.Color color);
Parameter | Description |
---|---|
color |
The new Color for PI Name. |
Sets the cursor position at the selected XML node.
public void setSelectedNode( org.w3c.dom.Node node);
Parameter | Description |
---|---|
node |
The selected node. |
Sets the NOTATION Symbol font.
public void setSymbolFont( java.awt.Font font);
Parameter | Description |
---|---|
font |
The new Font for NOTATION Symbol. |
Sets the NOTATION Symbol foreground color.
public void setSymbolForeground( java.awt.Color color);
Parameter | Description |
---|---|
color |
The new Color for NOTATION Symbol. |
Sets the Tag font.
public void setTagFont( java.awt.Font font);
Parameter | Description |
---|---|
font |
The new Font for the XML Tags. |
Sets the Tag foreground color.
public void setTagForeground( java.awt.Color color);
Parameter | Description |
---|---|
color |
The new Color for the XML Tags. |
Associates the XMLviewer with a XML document.
public void setXMLDocument( org.w3c.dom.Document document);
Parameter | Description |
---|---|
document |
The Document to display. |
This class provides information about the XMLSourceView Bean.
public class XMLSourceViewBeanInfo extends java.beans.SimpleBeanInfo java.lang.Object | +--java.beans.SimpleBeanInfo | +--oracle.xml.srcviewer.XMLSourceViewBeanInfo
java.beans.BeanInfo
Class constructor.
public XMLSourceViewBeanInfo();
Retrieves an image object representing the requested icon type for XMLSourceView bean in toolbars, toolboxes, and so on. Overrides getIcon()
in java.beans.SimpleBeanInfo
class.
public java.awt.Image getIcon( int iconKind);
Parameter | Description |
---|---|
iconKind |
The kind of icon requested. |
Retrieves an array of XMLSourveView bean's editable PropertyDescriptors. Overrides getPropertyDescriptors()
in java.beans.SimpleBeanInfo
Class.
public java.beans.PropertyDescriptor[] getPropertyDescriptors();
This is a visual bean. It allows users to load XML and XSL buffers from the file system or from the database's CLOB tables. The XML buffer can be transformed using the XSL buffer. XML, XSL or HTML buffers can be saved in the file system or in the database as CLOB tables. Each CLOB table has two columns, string type to hold the filename and CLOB type to hold the file data. CLOB tables can be created or deleted. The XML and XSL buffers can be edited and parsed.
The classes of the oOracle.xml.srcviewer
as summarized in Table 10-26.
Maintains CLOB tables that can hold multiple XML and text documents. Each table is created using the statement:
CREATE TABLE tablename FILENAME CHAR( 16) UNIQUE, FILEDATA CLOB) LOB(FILEDATA) STORE AS (DISABLE STORAGE IN ROW).
FILENAME
field holds a unique string that is used as a key to retrieve, update or delete the row.FILEDATA
field that is a CLOB object.public class DBAccess extends java.lang.Object java.lang.Object | +--oracle.xml.transviewer.DBAccess
Class constructor.
public DBAccess();
Create BLOB table, returning TRUE
if successful.
public boolean createBLOBTable( Connection con, String tableName);
Parameter | Description |
---|---|
con |
The Connection object. |
tableName |
The table name. |
Creates XML table, returning TRUE
if successful.
public boolean createXMLTable( Connection con, String tableName);
Parameter | Description |
---|---|
con |
The Connection object. |
tableName |
The table name. |
Deletes binary file from BLOB table, returning TRUE
if successful.
public boolean deleteBLOBName( java.sql.Connection con, String tableName, String blobName);
Parameter | Description |
---|---|
con |
The Connection object. |
tableName |
The table name. |
blobName |
The file name. |
Delete file from XML table, returning TRUE
if successful.
public boolean deleteXMLName( java.sql.Connection con, String tableName, String xmlName);
Parameter | Description |
---|---|
con |
The Connection object. |
tableName |
The table name. |
xmlName |
The file name. |
Deletes BLOB table. TRUE
if successful.
public boolean dropBLOBTable( java.sql.Connection con, String tableName);
Parameter | Description |
---|---|
con |
The Connection object. |
tableName |
The table name. |
Deletes XML table. Returns TRUE
if successful.
public boolean dropXMLTable( java.sql.Connection con,
java.lang.String tableName);
Parameter | Description |
---|---|
con |
The Connection object. |
tableName |
The table name. |
Retrieves binary file from BLOB table as a byte array. Returns TRUE
if successful.
public byte[] getBLOBData( java.sql.Connection con, String tableName, String xmlName);
Parameter | Description |
---|---|
con |
The Connection object. |
tableName |
The table name. |
xmlName |
The file name. |
Returns the size of the field where the filename is kept.
public int getNameSize();
Retrieves text file from XML table as a String.
public java.lang.String getXMLData( java.sql.Connection con, String tableName, String xmlName);
Parameter | Description |
---|---|
con |
The Connection object. |
tableName |
The table name. |
xmlName |
The file name. |
Returns all file names in XML table as a String array.
public java.lang.String[] getXMLNames( java.sql.Connection con, String tableName);
Parameter | Description |
---|---|
con |
The Connection object. |
tableName |
The table name. |
Retrieves an array of all XML table names, starting with a user-specified string.
public java.lang.String[] getXMLTableNames( java.sql.Connection con, String tablePrefix);
Parameter | Description |
---|---|
con |
The Connection object. |
tablePrefix |
The table prefix string that starts the retrieved array of XML table names. |
Inserts binary file as a row in BLOB table. Returns TRUE
if successful.
public boolean insertBLOBData( java.sql.Connection con, String tableName, String xmlName, byte[] xmlData);
Parameter | Description |
---|---|
con |
The Connection object. |
tableName |
The table name. |
xmlName |
The file name. |
xmlData |
The byte array with file data. |
Inserts text file as a row in XML table. Returns TRUE
if successful.
public boolean insertXMLData( java.sql.Connection con, String tableName, String xmlName, String xmlData);
Parameter | Description |
---|---|
con |
The Connection object. |
tableName |
The table name. |
xmlName |
The file name. |
xmlData |
The String with file data. |
Checks if the table is an XML table, in which case returns TRUE
.
public boolean isXMLTable( java.sql.Connection con, String tableName);
Parameter | Description |
---|---|
con |
The Connection object. |
tableName |
The table name. |
Replaces text file as a row in XML table, returning TRUE
if successful.
public boolean replaceXMLData( java.sql.Connection con, String tableName, String xmlName, String xmlData);
Parameter | Description |
---|---|
con |
The Connection object. |
tableName |
The table name. |
xmlName |
The file name. |
xmlData |
The String with file data. |
Checks if the XML table exists, returning TRUE
if successful.
public boolean xmlTableExists( java.sql.Connection con, String tableName);
Parameter | Description |
---|---|
con |
The Connection object. |
tableName |
The table name. |
This class provides information about the DBAccess Bean.
public class DBAccessBeanInfo extends java.beans.SimpleBeanInfo java.lang.Object | +--java.beans.SimpleBeanInfo | +--oracle.xml.transviewer.DBAccessBeanInfo
Class constructor.
public DBAccessBeanInfo();
Retrieves an image object representing the requested icon type for DBAcceess bean in toolbars, toolboxes, and so on. Overrides getIcon()
in java.beans.SimpleBeanInfo
class.
public java.awt.Image getIcon(int iconKind);
Parameter | Description |
---|---|
iconKind |
The kind of icon requested. |
Retrieves an array of DBAccess bean's editable PropertyDescriptors. Overrides getPropertyDescriptors()
in java.beans.SimpleBeanInfo
Class.
public java.beans.PropertyDescriptor[] getPropertyDescriptors();
XMLTransformPanel visual bean. Applies XSL transformations to XML documents and visualizes the result. Allows editing of input XML and XSL documents and files.
public class XMLTransformPanel extends javax.swing.JPanel java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--oracle.xml.transviewer.XMLTransformPanel
javax.accessibility.Accessible
java.awt.image.ImageObserver
java.awt.MenuContainer
java.io.Serializable
The class constructor. Creates an object of type XMLTransformPanel
.
public XMLTransformPanel();
This class provides information about the XMLTransformPanel Bean.
public class XMLTransformPanelBeanInfo extends java.beans.SimpleBeanInfo java.lang.Object | +--java.beans.SimpleBeanInfo | +--oracle.xml.transviewer.XMLTransformPanelBeanInfo
Class constructor.
public XMLTransformPanelBeanInfo();
Retrieves an image object representing the requested icon type for XMLTransformPanel bean in toolbars, toolboxes, and so on. Overrides getIcon()
in java.beans.SimpleBeanInfo
class.
public java.awt.Image getIcon( int iconKind);
Parameter | Description |
---|---|
iconKind |
The kind of icon requested. |
Retrieves an array of XMLTransformPanel bean's editable PropertyDescriptors. Overrides getPropertyDescriptors()
in java.beans.SimpleBeanInfo
Class.
public java.beans.PropertyDescriptor[] getPropertyDescriptors();
Simple application that uses XMLTransformPanel. Can be used from the command line to edit and parse XML files, edit and apply XSL transformations and retrieve and save XML, XSL and result files in the file system or in the database.
public class XMLTransViewer extends java.lang.Object java.lang.Object | +--oracle.xml.transviewer.XMLTransViewer
Method | Description |
---|---|
Class constructor |
|
Returns the release version of the Oracle XML Transviewer, as a String. |
|
Starts a new XMLTransViewer. |
Class constructor
public XMLTransViewer();
Returns the release version of the Oracle XML Transviewer, as a String.
public static java.lang.String getReleaseVersion();
The main function which starts a new XMLTransViewer.
public static void main( String[] args);
Parameter | Description |
---|---|
args |
Arguments of an XMLTransViewer instance. |
This is a visual bean. It displays XML documents as a tree, illustrating the DOM tree structure of a XML document. The user can collapse or expand the nodes.
The classes of the oOracle.xml.treeviewer
as summarized in Table 10-31.
Class | Description |
---|---|
Shows an XML document as a tree. |
|
This class provides information about the XMLTreeView Bean. |
Shows an XML document as a tree. Recognizes the following XML DOM nodes: Tag, Attribute Name, Attribute Value, Comment, CDATA, PCDATA, PI Data, PI Name
and NOTATION
Symbol. Takes as input an org.w3c.dom.Document
object.
public class XMLTreeView extends javax.swing.JPanel java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--oracle.xml.treeviewer.XMLTreeView
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
The class constructor. Creates an object of type XMLTreeView.
public XMLTreeView();
Returns the Dimension object containing the XMLTreeView preferred size. Overrides getPreferredSize()
in javax.swing.JComponent
class.
public java.awt.Dimension getPreferredSize();
Returns the visual tree as a JTree.
protected javax.swing.JTree getTree();
Returns the datamodel for JTree as XMLTreeModel.
protected oracle.xml.treeviewer.XMLTreeModel getXMLTreeModel();
Associates the XMLTreeViewer with a XML document.
public void setXMLDocument( org.w3c.dom.Document document);
Parameter | Description |
---|---|
doc |
The Document to display. |
Forces the XMLTreeView to update/refresh UI.
public void updateUI();
This class provides information about the XMLTreeView Bean.
public class XMLTreeViewBeanInfo extends java.beans.SimpleBeanInfo java.lang.Object | +--java.beans.SimpleBeanInfo | +--oracle.xml.treeviewer.XMLTreeViewBeanInfo
java.beans.BeanInfo
Class constructor.
public XMLTreeViewBeanInfo();
Retrieves an image object representing the requested icon type for XMLTreeView bean in toolbars, toolboxes, and so on.
public java.awt.Image getIcon( int iconKind);
Parameter | Description |
---|---|
iconKind |
The kind of icon requested. |
Retrieves an array of XMLTreeViewl bean's editable PropertyDescriptors.
public java.beans.PropertyDescriptor[] getPropertyDescriptors();
The oracle.xml.differ
is a non-visual bean with a visual demo. It enables comparisons of two XML documents and generation of the differences as XSLT code. The XSLT can be applied to the first file to transform it into the second file. The visual demo enables the user to view the differences between the two XML documents graphically.
The classes of the oOracle.xml.differ
as summarized in Table 10-35.
Class | Description |
---|---|
Defines an interface for comparing two XML files. |
|
This class provides information about the XMLDiff Bean. |
Defines an interface for comparing two XML files. It enables two XML files to be compared to check for their equivalence. It provides the objects to display the differences, if any, in a graphical format. The differences can also be represented as XSL. The corresponding XSL stylesheet with the differences can be generated as a file or an XMLDocument object. The first XML file can be transformed into the second XML file by using the XSL stylesheet generated.
oracle.xml.differ java.lang.Object | +--oracle.xml.differ.XMLDiff
DOMBuilderListener Interface
DOMBuilderErrorListener Interface
java.io.Serializablen Interface
Class constructor.
public XMLDiff();
Sets the XML files which need to be compared. Both files are parsed into DOM trees for comparison. This is faster than calling setInput1() and setInput2(). Throws the following exceptions:
java.io.IOException
when an I/O error occurs.XMLParseException
when parsing XML document.SAXException
when parsing XML document.java.lang.InterruptedException
if a sleeping thread is interrupted.
public void setFiles( java.io.File file1, java.io.File file2);
Parameter | Description |
---|---|
file1 |
First XML file. |
file2 |
Second XML file. |
Sets the XML documents which need to be compared.
public void setDocuments( XMLDocument doc1, XMLDocument doc2);
Parameter | Description |
---|---|
doc1 |
First XML document. |
Sets the first XML file or document which need to be compared. The input file is parsed into a DOM tree for comparison. Throws the following exceptions:
java.io.IOException
when an I/O error occurs.XMLParseException
when parsing XML document.SAXException
when parsing XML document.java.lang.InterruptedException
if a sleeping thread is interrupted.The options are described in the following table.
Syntax | Description |
---|---|
File file1); |
Sets the first XML file which needs to be compared. |
XMLDocument doc1); |
Sets the first XML document which needs to be compared. |
Parameter | Description |
---|---|
file1 |
The first XML file. |
doc1 |
The first XML document. |
Sets the second XML file or document which need to be compared. The input file is parsed into a DOM tree for comparison. Throws the following exceptions:
java.io.IOException
when an I/O error occurs.XMLParseException
when parsing XML document.SAXException
when parsing XML document.java.lang.InterruptedException
if a sleeping thread is interrupted.
The options are described in the following table.
Syntax | Description |
---|---|
File file2); |
Sets the second XML file which needs to be compared. |
XMLDocument doc2); |
Sets the second XML document which needs to be compared. |
Parameter | Description |
---|---|
file2 |
The second XML file. |
doc2 |
The second XML document. |
Gets the document root as an XMLDocument object of the first XML tree.
public XMLDocument getDocument1();
Gets the document root as an XMLDocument object of the second XML tree.
public XMLDocument getDocument2();
Finds the differences between the two XML files or the two XMLDocument objects. Returns FALSE
if the XML files or docs are same, TRUE
if they are different. Throws java.lang.NullPointerException
when XML files are not parsed successfully, or if xml documents have not been set.
public boolean diff();
Retrieves the visual text panel as JTextPane object which visually shows the differences in the first XML file or document.
public javax.swing.JTextPane getDiffPane1();
Retrieves the visual text panel as JTextPane object which visually shows the differences in the second XML file or document.
public javax.swing.JTextPane getDiffPane2();
Sets the indentation for the XSL generation. This should be called before the generateXSLFile()
or generateXSLDoc()
. The indentation will be applied to all attributes only. For indenting newly inserted nodes, see setNewNodeIndentIncr()
.
public void setIndentIncr( int spaces);
Parameter | Description |
---|---|
spaces |
Indentation increment in number of spaces for attributes. |
Sets the indentation for the XSL generation. This should be called before the generateXSLFile() or generateXSLDoc(). The indentation will be applied to all newly inserted nodes only. For attributes indentation support, see setIndentIncr()
.
public void setNewNodeIndentIncr( int spaces);
Parameter | Description |
---|---|
spaces |
Indentation increment in number of spaces for new nodes. |
Generates an XSL file, with user-defined filename, which represents the differences between the two initially set XML files. If the input filename is NULL,
a default XSL file named XMLDiff.xsl
will be generated. The first XML file can be transformed into the second XML file using the XSL stylesheet generated. If the XML are the same, the XSL generated will transform the first XML file into the second XML file, making the two files equivalent. Throws java.io.IOException
if the XSL file is not created successfully.
public void generateXSLFile( String fileName);
Parameter | Description |
---|---|
fileName |
Output XSL file name. |
Generates an XSL stylesheet as an XMLDocument which represents the differences between the two initially set XML documents. If the input filename is NULL,
a default XSL file named XMLDiff.xsl
will be generated. The first XML file can be transformed into the second XML file using the XSL stylesheet generated. If the XML are the same, the XSL generated will transform the first XML file into the second XML file, making the two files equivalent. Throws the following exceptions:
java.io.IOException
when an I/O error occurs.java.io.FileNotFoundException
when the XSL file generated not found.SAXException
when parsing XML document.java.lang.InterruptedException
if a sleeping thread is interrupted.public void generateXSLDoc();
Compares two nodes. It is called by the differ algorithm. If needed, this function can be overwritten for customized comparisons.
protected boolean equals( Node node1, Node node2);
Parameter | Description |
---|---|
node1 |
The first node to compare. |
node2 |
The second node to compare. |
Method implementing the DOMBuilderErrorListener interface called only by the DOM parser when there is an error while parsing. Specified by domBuilderErrorCalled in DOMBuilderErrorListener Interface.
public void domBuilderErrorCalled( DOMBuilderErrorEvent p0);
Parameter | Description |
---|---|
p0 |
Error object thrown by the parser. |
Method implementing the DOMBuilderErrorListener interface called only by the DOM parser. Specified by domBuilderError in DOMBuilderListener interface.
public void domBuilderError( DOMBuilderEvent p0);
Parameter | Description |
---|---|
p0 |
Parser event errors handled by domBuilderErrorCalled(). |
Method implementing DOMBuilderListener interface called only by a DOM parser thread when parsing completes. Specified by domBuilderOver in DOMBuilderListener interface
public void domBuilderOver ( DOMBuilderEvent p0);
Parameter | Description |
---|---|
p0 |
Parser event. |
Method implementing DOMBuilderListener interface called only by the DOM parser when the parsing starts. Specified by domBuilderStarted in DOMBuilderListener interface.
public void domBuilderStarted( DOMBuilderEvent p0);
Parameter | Description |
---|---|
p0 |
Parser event. |
Prints the diff tree which contains the node names and values which have been identified as different by the algorithm. Useful for debugging. Throws java.io.IOException
if the XSL file is not created successfully.
public void printDiffTree( int tree, BufferedWriter out);
Parameter | Description |
---|---|
tree |
The tree to print, 1 or 2. |
out |
The BufferredWriter containing the printed diff tree. |
Assume that there are no moves to be detected by the diff algorithm. This function should be called before the diff() function. It will result in a performance gain.
public void setNoMoves();
This class provides information about the XMLDiff Bean.
public class XMLDiffBeanInfo extends java.beans.SimpleBeanInfo XMLSjava.lang.Object | +--java.beans.SimpleBeanInfo | +--oracle.xml.differ.XMLDiffBeanInfo
Class constructor.
public XMLDiffBeanInfo();
Retrieves an array of XMLDiff bean's editable PropertyDescriptors. Overrides getPropertyDescriptors()
in java.beans.SimpleBeanInfo
Class.
public java.beans.PropertyDescriptor[] getPropertyDescriptors();
Retrieves an image object representing the requested icon type for XMLDiff bean in toolbars, toolboxes, and so on. Overrides getIcon()
in java.beans.SimpleBeanInfo
class.
public java.awt.Image getIcon( int iconKind);
Parameter | Description |
---|---|
iconKind |
The kind of icon requested. |
|
Copyright © 2001, 2002 Oracle Corporation. All Rights Reserved. |
|