|
sarissa | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--Sarissa
Defined in sarissa.js
Field Summary | |
<static> Object |
IS_ENABLED_SELECT_NODES
|
<static> Object |
IS_ENABLED_TRANSFORM_NODE
|
<static> Object |
PARSED_EMPTY
|
<static> Object |
PARSED_OK
|
<static> Object |
PARSED_UNKNOWN_ERROR
|
Constructor Summary | |
Sarissa
()
Sarissa is a utility class. |
Method Summary | |
<static> void
|
clearChildNodes(oNode)
Deletes all child nodes of the given node |
<static> void
|
copyChildNodes(nodeFrom, nodeTo, bPreserveExisting)
Copies the childNodes of nodeFrom to nodeTo Note: The second object's original content is deleted before the copy operation, unless you supply a true third parameter |
<static> Object
|
escape(sXml)
Escape the given string chacters that correspond to the five predefined XML entities |
<static> Object
|
getDomDocument(sUri, sName)
Factory method to obtain a new DOM Document object |
<static> Object
|
getParseErrorText(oDoc)
Returns a human readable description of the parsing error. |
<static> Object
|
getText(oNode, deep)
|
<static> void
|
moveChildNodes(nodeFrom, nodeTo, bPreserveExisting)
Moves the childNodes of nodeFrom to nodeTo Note: The second object's original content is deleted before the move operation, unless you supply a true third parameter |
<static> void
|
setXpathNamespaces(oDoc, sNsSet)
Programmatically control namespace URI/prefix mappings for XPath queries. This method comes especially handy when used to apply XPath queries on XML documents with a default namespace, as there is no other way of mapping that to a prefix. Using no namespace prefix in DOM Level 3 XPath queries, implies you are looking for elements in the null namespace. |
<static> Object
|
setXslParameter(oXslDoc, sParamQName, sParamValue)
Deprecated (use XSLTProcessor instead): Set xslt parameters. Note that this method can only work for the main stylesheet and not any included/imported files. |
<static> Object
|
stripTags(s)
strips tags from a markup string |
<static> Object
|
unescape(sXml)
Unescape the given string. |
<static> void
|
updateContentFromNode(oNode, oTargetElement, xsltproc, callback)
Update an element's content with the given DOM node. |
<static> void
|
updateContentFromURI(sFromUrl, oTargetElement, xsltproc, callback, skipCache)
Update an element with response of a GET request on the given URL. |
<static> Object
|
xmlize(anyObject, objectName, indentSpace)
Serialize any object to an XML string. |
Field Detail |
<static> Object IS_ENABLED_SELECT_NODES
<static> Object IS_ENABLED_TRANSFORM_NODE
<static> Object PARSED_EMPTY
<static> Object PARSED_OK
<static> Object PARSED_UNKNOWN_ERROR
Constructor Detail |
Sarissa()
Sarissa is a utility class. Provides "static" methods for DOMDocument and XMLHTTP objects, DOM Node serializatrion to XML strings and other goodies.
Method Detail |
<static> void clearChildNodes(oNode)
Deletes all child nodes of the given node
oNode
- the Node to empty
<static> void copyChildNodes(nodeFrom, nodeTo, bPreserveExisting)
Copies the childNodes of nodeFrom to nodeTo
Note: The second object's original content is deleted before the copy operation, unless you supply a true third parameter
nodeFrom
- the Node to copy the childNodes from
nodeTo
- the Node to copy the childNodes to
bPreserveExisting
- whether to preserve the original content of nodeTo, default is false
<static> Object escape(sXml)
sXml
- the string to escape
<static> Object getDomDocument(sUri, sName)
Factory method to obtain a new DOM Document object
sUri
- the namespace of the root node (if any)
sUri
- the local name of the root node (if any)
<static> Object getParseErrorText(oDoc)
Returns a human readable description of the parsing error. Usefull for debugging. Tip: append the returned error string in a <pre> element if you want to render it.
Many thanks to Christian Stocker for the initial patch.
oDoc
- The target DOM document
<static> Object getText(oNode, deep)
<static> void moveChildNodes(nodeFrom, nodeTo, bPreserveExisting)
Moves the childNodes of nodeFrom to nodeTo
Note: The second object's original content is deleted before the move operation, unless you supply a true third parameter
nodeFrom
- the Node to copy the childNodes from
nodeTo
- the Node to copy the childNodes to
bPreserveExisting
- whether to preserve the original content of nodeTo, default is
<static> void setXpathNamespaces(oDoc, sNsSet)
Programmatically control namespace URI/prefix mappings for XPath queries.
This method comes especially handy when used to apply XPath queries on XML documents with a default namespace, as there is no other way of mapping that to a prefix.
Using no namespace prefix in DOM Level 3 XPath queries, implies you are looking for elements in the null namespace. If you need to look for nodes in the default namespace, you need to map a prefix to it first like:
Sarissa.setXpathNamespaces(oDoc, "xmlns:myprefix=&aposhttp://mynsURI&apos");
Note 1 : Use this method only if the source document features a default namespace (without a prefix), otherwise just use IE's setProperty (moz will rezolve non-default namespaces by itself). You will need to map that namespace to a prefix for queries to work.
Note 2 : This method calls IE's setProperty method to set the appropriate namespace-prefix mappings, so you dont have to do that.
oDoc
- The target XMLDocument to set the namespace mappings for.
sNsSet
- A whilespace-seperated list of namespace declarations as those would appear in an XML document. E.g.: "xmlns:xhtml='http://www.w3.org/1999/xhtml' xmlns:'http://www.w3.org/1999/XSL/Transform'"
<static> Object setXslParameter(oXslDoc, sParamQName, sParamValue)
Deprecated (use XSLTProcessor instead): Set xslt parameters.
Note that this method can only work for the main stylesheet and not any included/imported files.
oXslDoc
- the target XSLT DOM Document
sParamValue
- the value of the XSLT parameter
sParamName
- the name of the XSLT parameter
<static> Object stripTags(s)
<static> Object unescape(sXml)
sXml
- the string to unescape
<static> void updateContentFromNode(oNode, oTargetElement, xsltproc, callback)
functionName(oNode, oTargetElement);
oNode
- the URL to make the request to
oTargetElement
- the element to update
xsltproc
- (optional) the transformer to use on the given DOM node before updating the target element with it
callback
- (optional) a Function object to execute once the update is finished successfuly, called as callback(oNode, oTargetElement)
<static> void updateContentFromURI(sFromUrl, oTargetElement, xsltproc, callback, skipCache)
functionName(oNode, oTargetElement);
sFromUrl
- the URL to make the request to
oTargetElement
- the element to update
xsltproc
- (optional) the transformer to use on the returned content before updating the target element with it
callback
- (optional) a Function object to execute once the update is finished successfuly, called as callback(oNode, oTargetElement)
skipCache
- (optional) whether to skip any cache
<static> Object xmlize(anyObject, objectName, indentSpace)
Serialize any object to an XML string. All properties are serialized using the property name
as the XML element name. Array elements are rendered as array-item
elements,
using their index/key as the value of the key
attribute.
anyObject
- the object to serialize
objectName
- a name for that object
|
sarissa | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |