: Selection(Ctrl-A)
: Selection(DragAndDrop)
: UI movingHandlers
Maybe today's (2013) status of intensive using JSON and javascript libraries like a
D3 http://d3js.org/ Data Driven Documents
and ANGULARJS Superheroic JavaScript Framework
can give the impression, that there is no need to solve my needs with XSLT,
non programmer user definable and editable in-browser applications need another way.
Way, where all on page, not only base code, but user's inputs, definitions, addendas ....
is in form, which can be checked, corrected, maintained by MACHINE, without need to
write practically the same or very, very similar code for new XHTML pages, user requested.
I decided for XML technology, because I think, that it is more, more eXtendable and fleXible,
that any modern (typing saving) tries like a JSON
A propos ... WHY I MUST IN 21.CENTURY program = code typing AND NOT CONSTRUCT AND CONNECT NEEDED
REUSABLE, COMBINABLE MODULES like a LEGO blocks ?
VariableResolver.prototype.getVariableWithName = function(ns, ln, c) {
return null; //VERY BAD SOLUTION FOR VARIABLE ($something) RESOLUTION !!!!
};
|
RawView | TreeView | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|||||||||||||||
|
|
|
|||||||||||||||
|
|
|
|||||||||||||||
XPath
extending standart XPath functions with own function(s)
exxpfn = jsX.xpath.FunctionCallExpr.prototype.xpathfunctions exxpfn.myOwn = function(ctx){return new NumberValue(1234) } exxpfn.myOwn()
XSLT
extending standart XSLT with own script function(s)
<xsl:script type="text/javascript" name="counting" function="init read incr"></xsl:script> .... <xsl:script-value-of name="counting" function="read"> <xsl:with-param name="name" select="'index'"/> </xsl:script-value-of> .... <xsl:call-script name="counting" function="incr"> <xsl:with-param name="name" select="'index'"/> </xsl:call-script>
Template rules identify the nodes to which they apply by using a pattern. As well as being used in template rules, patterns are used for numbering (see [7.7 Numbering]) and for declaring keys (see [12.2 Keys]). A pattern specifies a set of conditions on a node. A node that satisfies the conditions matches the pattern; a node that does not satisfy the conditions does not match the pattern. The syntax for patterns is a subset of the syntax for expressions. In particular, location paths that meet certain restrictions can be used as patterns. An expression that is also a pattern always evaluates to an object of type node-set. A node matches a pattern if the node is a member of the result of evaluating the pattern as an expression with respect to some possible context; the possible contexts are those whose context node is the node being matched or one of its ancestors.
Here are some examples of patterns:
para
matches any para
element
*
matches any element
chapter|appendix
matches any chapter
element and any appendix
element
olist/item
matches any item
element with
an olist
parent
appendix//para
matches any para
element
with an appendix
ancestor element
/
matches the root node
text()
matches any text node
processing-instruction()
matches any processing
instruction
node()
matches any node other than an attribute node
and the root node
id("W11")
matches the element with unique ID
W11
para[1]
matches any para
element that is
the first para
child element of its parent
*[position()=1 and self::para]
matches any
para
element that is the first child element of its
parent
para[last()=1]
matches any para
element
that is the only para
child element of its parent
items/item[position()>1]
matches any
item
element that has a items
parent and that
is not the first item
child of its parent
item[position() mod 2 = 1]
would be true for any
item
element that is an odd-numbered item
child
of its parent.
div[@class="appendix"]//p
matches any p
element with a div
ancestor element that has a
class
attribute with value appendix
@class
matches any class
attribute
(not any element that has a class
attribute)
@*
matches any attribute
It is possible for a source node to match more than one template rule. The template rule to be used is determined as follows:
First, all matching template rules that have lower import precedence than the matching template rule or rules with the highest import precedence are eliminated from consideration.
Next, all matching template rules that have lower priority than the
matching template rule or rules with the highest priority are eliminated
from consideration. The priority of a template rule is specified by the
priority
attribute on the template rule. The value of this
must be a real number (positive or negative), matching the production Number with an optional
leading minus sign (-
). The default priority is computed as
follows:
If the pattern contains multiple alternatives separated by
|
, then it is treated equivalently to a set of template
rules, one for each alternative.
If the pattern has the form of a QName preceded
by a ChildOrAttributeAxisSpecifier
or has the form processing-instruction(
Literal)
preceded by a ChildOrAttributeAxisSpecifier,
then the priority is 0.
If the pattern has the form NCName:*
preceded by a ChildOrAttributeAxisSpecifier,
then the priority is -0.25.
Otherwise, if the pattern consists of just a NodeTest preceded by a ChildOrAttributeAxisSpecifier, then the priority is -0.5.
Otherwise, the priority is 0.5.
Thus, the most common kind of pattern (a pattern that tests for a node with a particular type and a particular expanded-name) has priority 0. The next less specific kind of pattern (a pattern that tests for a node with a particular type and an expanded-name with a particular namespace URI) has priority -0.25. Patterns less specific than this (patterns that just tests for nodes with particular types) have priority -0.5. Patterns more specific than the most common kind of pattern have priority 0.5.
It is an error if this leaves more than one matching template rule. An XSLT processor may signal the error; if it does not signal the error, it must recover by choosing, from amongst the matching template rules that are left, the one that occurs last in the stylesheet.
name | type | size | value |
---|
name | type | size | value |
---|