public class XSLTProcessorApplet extends Applet
setDocumentURL(java.lang.String)
and
setStyleURL(java.lang.String)
methods to specify the XML source document and XSL stylesheet.getHtmlText()
method (or one of the transformToHtml() methods)
to perform the transformation and return the result as a String.Applet.AccessibleApplet
Panel.AccessibleAWTPanel
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
XSLTProcessorApplet()
The XSLTProcessorApplet constructor takes no arguments.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Cleanup; called when applet is terminated and unloaded.
|
String |
escapeString(String s)
Given a String containing markup, escape the markup so it
can be displayed in the browser.
|
void |
freeCache()
The processor keeps a cache of the source and
style trees, so call this method if they have changed
or you want to do garbage collection.
|
String |
getAppletInfo()
Get basic information about the applet
|
String |
getHtmlText()
Assuming the stylesheet URL and the input XML URL have been set,
perform the transformation and return the result as a String.
|
String[][] |
getParameterInfo()
Get descriptions of the applet parameters.
|
String |
getResultTreeAsText()
Get the HTML result Tree as a text string suitable
for display in a browser.
|
String |
getSourceTreeAsText()
Get the XML source Tree as a text string suitable
for display in a browser.
|
String |
getStyleTreeAsText()
Get the XSL style Tree as a text string suitable
for display in a browser.
|
String |
getTreeAsText(String treeURL)
Get an XML document (or stylesheet)
|
void |
init()
Standard applet initialization.
|
void |
paint(Graphics g)
Do not call; this applet contains no UI or visual components.
|
void |
setDocumentURL(String urlString)
Set the URL to the XML document that will be transformed
with the XSL stylesheet.
|
void |
setStyleSheetAttribute(String nameOfIDAttrOfElemToModify,
String elemId,
String attrName,
String value)
Set an attribute in the stylesheet, which gives the ability
to have some dynamic selection control.
|
void |
setStylesheetParam(String key,
String expr)
Submit a stylesheet parameter.
|
void |
setStyleURL(String urlString)
Set the URL to the XSL stylesheet that will be used
to transform the input XML.
|
void |
start()
Automatically called when the HTML client containing the applet loads.
|
void |
stop()
Automatically called when the HTML page containing the applet is no longer
on the screen.
|
String |
transformToHtml(String doc)
Process a document and a stylesheet and return
the transformation result.
|
String |
transformToHtml(String doc,
String style)
Process a document and a stylesheet and return
the transformation result.
|
getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatus
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public XSLTProcessorApplet()
public String getAppletInfo()
getAppletInfo
in class Applet
public String[][] getParameterInfo()
getParameterInfo
in class Applet
public void start()
public void paint(Graphics g)
public void stop()
public void destroy()
public void setStyleURL(String urlString)
urlString
- valid URL string for XSL stylesheet.public void setDocumentURL(String urlString)
urlString
- valid URL string for XML document.public void freeCache()
public void setStyleSheetAttribute(String nameOfIDAttrOfElemToModify, String elemId, String attrName, String value)
nameOfIDAttrOfElemToModify
- The name of an attribute to search for a unique id.elemId
- The unique ID to look for.attrName
- Once the element is found, the name of the attribute to set.value
- The value to set the attribute to.public void setStylesheetParam(String key, String expr)
key
- stylesheet parameter keyexpr
- the parameter expression to be submitted.Transformer.setParameter(String,Object)
public String escapeString(String s)
s
- String to escape
The escaped string.public String getHtmlText()
public String getTreeAsText(String treeURL) throws IOException
treeURL
- valid URL string for the document.IOException
public String getSourceTreeAsText() throws Exception
Exception
- thrown if tree can not be converted.public String getStyleTreeAsText() throws Exception
Exception
- thrown if tree can not be converted.public String getResultTreeAsText() throws Exception
Exception
- thrown if tree can not be converted.public String transformToHtml(String doc, String style)
doc
- URL string to XML documentstyle
- URL string to XSL stylesheetpublic String transformToHtml(String doc)
doc
- URL string to XML document containing an xsl:stylesheet PI.Copyright © 2016 JBoss by Red Hat. All rights reserved.