|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.ucsb.nceas.morpho.util.XMLTransformer
XMLTransformer to style XML documents using XSLT
Field Summary | |
static java.lang.String |
ATTRIB_NAME_FOR_SCHEMA_LOCATION
used by the transform() method to get the schemaLocation (if one has been defined) from the Document root node |
static java.lang.String |
CSS_PATH_XSLPROP
xsl property used to hold path to css stylesheets |
static java.lang.String |
DEFAULT_CSS_XSLPROP
xsl property used to hold default css stylesheet name |
static java.lang.String |
ENTITY_CSS_XSLPROP
xsl property used to hold entity/attribute css stylesheet name |
static java.lang.String |
HREF_PATH_EXTENSION_XSLPROP
used to hold path extension for href links in triples. |
static java.lang.String |
ID_TO_GET_GENERIC_STYLESHEET
used by the transform() method to get the schemaLocation (if one has been defined) from the Document root node |
static java.lang.String |
NAMESPACE_FOR_SCHEMA_LOCATION
used by the transform() method to get the schemaLocation (if one has been defined) from the Document root node |
static java.lang.String |
PACKAGE_ID_XSLPROP
xsl property used to hold package id |
static java.lang.String |
PACKAGE_INDEX_NAME_XSLPROP
xsl property used to hold package index name |
static java.lang.String |
SELECTED_ATTRIBS_XSLPROP
SELECTED_ATTRIBS_XSLPROP used to identify selected attribute(s) when clicking on col headers (NOTE - identified by column index (0..n) - not by attribute ID: |
static java.lang.String |
SELECTED_DISPLAY_XSLPROP
SELECTED_DISPLAY_XSLPROP used to identify the display type |
static java.lang.String |
SELECTED_ENTITY_XSLPROP
SELECTED_ATTRIBS_XSLPROP used to identify selected entity when clicking on col headers |
static java.lang.String |
SUPPRESS_TRIPLES_DELIMETER
used to delimit the list of all module ID(s) to be suppressed in DataPackage metaview. |
static java.lang.String |
SUPPRESS_TRIPLES_OBJECTS_XSLPROP
used to hold a list of all module ID(s) to be suppressed as triples OBJECTS in DataPackage metaview. |
static java.lang.String |
SUPPRESS_TRIPLES_SUBJECTS_XSLPROP
used to hold a list of all module ID(s) to be suppressed as triples SUBJECTS in DataPackage metaview. |
static java.lang.String |
XSLVALU_DISPLAY_ATTRB
XSLVALU_DISPLAY_ATTRB is the value to display attributes |
static java.lang.String |
XSLVALU_DISPLAY_DATASET
XSLVALU_DISPLAY_DATASET is the value to display dataset |
static java.lang.String |
XSLVALU_DISPLAY_ENTITY
XSLVALU_DISPLAY_ENTITY is the value to display entity |
static java.lang.String |
XSLVALU_DISPLAY_PRNT
XSLVALU_DISPLAY_PRNT is the value to display print output |
Method Summary | |
void |
addTransformerProperty(java.lang.String key,
java.lang.String value)
adds a name/value pair to the Properties object containing
the properties to be set for the transformer |
java.util.Properties |
getCurrentTransformerProperties()
Returns all name/value pairs describing the properties to be set for the transformer, in the form of a Properties object
*NOTE* this method returns a clone of the Properties, not a reference to
the Properties object itself! |
static XMLTransformer |
getInstance()
Used to get a shared instance of the XMLTransformer |
java.lang.String |
getTransformerProperty(java.lang.String key)
Gets the String value of the Property corresponding to the
key passed in |
java.util.Enumeration |
getTransformerPropertyNames()
Gets an Enumeration containing the names (keys of all the
properties to be set for the transformer |
void |
removeAllTransformerProperties()
removes all name/value pairs from the Properties
object containing the properties to be set for the transformer |
void |
removeTransformerProperty(java.lang.String key)
removes a name/value pair from the Properties object
containing the properties to be set for the transformer |
void |
setTransformerProperties(java.util.Properties newProps)
The Properties object passed to this method will be used to
set all the name/value pairs describing the properties to be
set for the transformer. |
java.io.Reader |
transform(org.w3c.dom.Document domDoc)
transforms the passed XML document, using a "generic" stylesheet, whose name is obtained from the config.xml file |
java.io.Reader |
transform(org.w3c.dom.Document domDoc,
java.io.Reader xslStyleSheet)
Uses the stylesheet provided, to apply XSLT to the XML DOM Document provided |
java.io.Reader |
transform(java.io.Reader xmlDocReader)
transforms the passed XML document, using a "generic" stylesheet, whose name is obtained from the config.xml file |
java.io.Reader |
transform(java.io.Reader xmlDocReader,
java.io.Reader xslStyleSheet)
Uses the stylesheet provided, to apply XSLT to the XML document provided |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String SELECTED_DISPLAY_XSLPROP
public static final java.lang.String XSLVALU_DISPLAY_DATASET
public static final java.lang.String XSLVALU_DISPLAY_ENTITY
public static final java.lang.String XSLVALU_DISPLAY_ATTRB
public static final java.lang.String XSLVALU_DISPLAY_PRNT
public static final java.lang.String SELECTED_ENTITY_XSLPROP
public static final java.lang.String SELECTED_ATTRIBS_XSLPROP
public static final java.lang.String SUPPRESS_TRIPLES_SUBJECTS_XSLPROP
public static final java.lang.String SUPPRESS_TRIPLES_OBJECTS_XSLPROP
public static final java.lang.String SUPPRESS_TRIPLES_DELIMETER
public static final java.lang.String PACKAGE_INDEX_NAME_XSLPROP
public static final java.lang.String PACKAGE_ID_XSLPROP
public static final java.lang.String DEFAULT_CSS_XSLPROP
public static final java.lang.String ENTITY_CSS_XSLPROP
public static final java.lang.String CSS_PATH_XSLPROP
public static final java.lang.String HREF_PATH_EXTENSION_XSLPROP
public static final java.lang.String NAMESPACE_FOR_SCHEMA_LOCATION
public static final java.lang.String ATTRIB_NAME_FOR_SCHEMA_LOCATION
public static final java.lang.String ID_TO_GET_GENERIC_STYLESHEET
Method Detail |
public static XMLTransformer getInstance()
XMLTransformer
XMLTransformer
public java.io.Reader transform(java.io.Reader xmlDocReader) throws java.io.IOException
xmlDocReader
- A java.io.Reader
to allow reading of
the XML document to be styled.
java.io.Reader
to allow reading of
the (character-based) results of styling the XML
document
java.io.IOException
- if there are problems reading the Readerpublic java.io.Reader transform(java.io.Reader xmlDocReader, java.io.Reader xslStyleSheet) throws java.io.IOException
xmlDocReader
- A java.io.Reader
to allow reading of
the XML document to be styled.xslStyleSheet
- A java.io.Reader
to allow reading of
the XSL stylesheet to be used
java.io.Reader
to allow reading of
the results of styling the XML document
java.io.IOException
- if there are problems reading either of the Readerspublic java.io.Reader transform(org.w3c.dom.Document domDoc) throws java.io.IOException
domDoc
- A javax.xml.parsers.Document
containing the XML document to be styled.
java.io.Reader
to allow reading of
the (character-based) results of styling the XML
document
java.io.IOException
- if there are problems transforming the Documentpublic java.io.Reader transform(org.w3c.dom.Document domDoc, java.io.Reader xslStyleSheet) throws java.io.IOException
domDoc
- A javax.xml.parsers.Document
containing the XML document to be styled.xslStyleSheet
- A java.io.Reader
to allow reading of
the XSL stylesheet to be used
java.io.Reader
to allow reading of
the results of styling the XML document
java.io.IOException
- if there are problems reading either of the Readerspublic void addTransformerProperty(java.lang.String key, java.lang.String value)
Properties
object containing
the properties to be set for the transformer
key
- the key to be usedvalue
- the corresponding value to be setpublic void removeTransformerProperty(java.lang.String key)
Properties
object
containing the properties to be set for the transformer
key
- the key of the entry to be removedpublic void removeAllTransformerProperties()
Properties
object containing the properties to be set for the transformer
public void setTransformerProperties(java.util.Properties newProps)
Properties
object passed to this method will be used to
set all the name/value pairs describing the properties to be
set for the transformer. The new settings will supersede any previous
settings
newProps
- the Properties
containing all the
object name/value pairs describing the properties to
be set for the transformerpublic java.util.Properties getCurrentTransformerProperties()
Properties
object
*NOTE* this method returns a clone of the Properties, not a reference to
the Properties object itself!
Properties
containing
object name/value pairs describing the properties to
be set for the transformerpublic java.util.Enumeration getTransformerPropertyNames()
Enumeration
containing the names (keys of all the
properties to be set for the transformer
Enumeration
containing the namespublic java.lang.String getTransformerProperty(java.lang.String key)
String
value of the Property corresponding to the
key passed in
String
value of the Property
corresponding to the key passed in
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |