|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jaxup.xupdate.XUpdate
XUpdate engine. This class can, using the instructions in an XUpdate instruction document, change another XML document in-place. For small changes to large XML files, this may be preferable over a full XSLT translation. It is especially efficient if the XML document is either kept in memory for a long time, or is stored in a persistent database.
Field Summary | |
static String |
NS_XUPDATE
|
Constructor Summary | |
XUpdate(Updater docUpdater)
Creates an xupdate engine. |
|
XUpdate(Updater docUpdater,
org.jaxen.Navigator xuNavigator)
Creates an xupdate engine. |
Method Summary | |
protected void |
conditional(Object doc,
Object instrNode)
Handles an xupdate 'if' instruction. |
protected Object |
copyLiteral(Object doc,
Object literal)
|
protected void |
creation(Object doc,
Object instrNode,
int type)
Handles an xupdate 'append', 'update', 'insert-before' and 'insert-after' instruction. |
protected Object |
evaluateAttribute(Object doc,
Object instrNode)
|
protected Object |
evaluateComment(Object doc,
Object instrNode)
|
protected Object |
evaluateElement(Object doc,
Object instrNode)
|
protected Object |
evaluateProcessingInstruction(Object doc,
Object instrNode)
|
protected Object |
evaluateText(Object doc,
Object instrNode)
|
protected List |
evaluateValueOf(Object doc,
Object instrNode)
|
protected void |
executeUpdateInstructions(Object doc,
Object instructionsContainer)
Handles an xupdate 'modifications' or 'if' instruction container. |
protected static Object |
getAttributeNode(org.jaxen.Navigator nav,
Object element,
String name)
Returns attribute without namespace with the specified NCName in specified element, or null if there is no such attribute. |
protected List |
instantiateTemplate(Object doc,
Object templateHolder)
|
protected org.jaxen.BaseXPath |
parseXPath(String xpath,
Object xuElement)
|
protected void |
remove(Object doc,
Object removeNode)
Handles an xupdate 'remove' instruction. |
protected void |
removeChildren(Object element)
|
void |
runUpdate(Object sourceDoc,
Object xupdateContainer)
Runs a series of xupdate instructions to manipulate a given source document. |
protected static String[] |
splitQName(String qname)
|
protected void |
variable(Object doc,
Object instrNode)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String NS_XUPDATE
Constructor Detail |
public XUpdate(Updater docUpdater)
updater
- an implementation of the Updater interface to
update source and rad xupdate instruction documents.public XUpdate(Updater docUpdater, org.jaxen.Navigator xuNavigator)
docUpdater
- an implementation of the Updater interface to
update source documents.xuNavigator
- an implementation of the Navigator interface to
read xupdate instruction documents.Method Detail |
public void runUpdate(Object sourceDoc, Object xupdateContainer) throws org.jaxen.JaxenException, org.saxpath.SAXPathException
sourceDoc
- the source document that is going to be changed.xupdateContainer
- an element node that contains xupdate
instructions as its children.
Ordinarily, this would be the document
element of an xupdate XML document.protected void executeUpdateInstructions(Object doc, Object instructionsContainer) throws org.jaxen.JaxenException, org.saxpath.SAXPathException
protected static Object getAttributeNode(org.jaxen.Navigator nav, Object element, String name) throws org.jaxen.JaxenException
protected org.jaxen.BaseXPath parseXPath(String xpath, Object xuElement) throws org.jaxen.JaxenException, org.saxpath.SAXPathException
protected static String[] splitQName(String qname) throws org.jaxen.JaxenException
protected void variable(Object doc, Object instrNode) throws org.jaxen.JaxenException, org.saxpath.SAXPathException
protected void conditional(Object doc, Object instrNode) throws org.jaxen.JaxenException, org.saxpath.SAXPathException
protected void remove(Object doc, Object removeNode) throws org.jaxen.JaxenException, org.saxpath.SAXPathException
protected Object evaluateElement(Object doc, Object instrNode) throws org.jaxen.JaxenException, org.saxpath.SAXPathException
protected Object evaluateAttribute(Object doc, Object instrNode) throws org.jaxen.JaxenException, org.saxpath.SAXPathException
protected Object evaluateProcessingInstruction(Object doc, Object instrNode) throws org.jaxen.JaxenException, org.saxpath.SAXPathException
protected Object evaluateComment(Object doc, Object instrNode) throws org.jaxen.JaxenException, org.saxpath.SAXPathException
protected Object evaluateText(Object doc, Object instrNode) throws org.jaxen.JaxenException, org.saxpath.SAXPathException
protected List evaluateValueOf(Object doc, Object instrNode) throws org.jaxen.JaxenException, org.saxpath.SAXPathException
protected void creation(Object doc, Object instrNode, int type) throws org.jaxen.JaxenException, org.saxpath.SAXPathException
type
- 0 = append, 1 = update, 2 = insert-before, 3 = insert-afterprotected void removeChildren(Object element) throws org.jaxen.JaxenException
protected List instantiateTemplate(Object doc, Object templateHolder) throws org.jaxen.JaxenException, org.saxpath.SAXPathException
protected Object copyLiteral(Object doc, Object literal) throws org.jaxen.JaxenException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |