[XPATH] [XSL] Result tree fragment
bonjour,
je souhaiterais avoir un peu plus d informations concernant
les Result Tree Fragments
voici ce que l on peut lire sur le w3c:
Citation:
Variables introduce an additional data-type into the expression language. This additional data type is called result tree fragment. A variable may be bound to a result tree fragment instead of one of the four basic XPath data-types (string, number, boolean, node-set). A result tree fragment represents a fragment of the result tree. A result tree fragment is treated equivalently to a node-set that contains just a single root node. However, the operations permitted on a result tree fragment are a subset of those permitted on a node-set. An operation is permitted on a result tree fragment only if that operation would be permitted on a string (the operation on the string may involve first converting the string to a number or boolean). In particular, it is not permitted to use the /, //, and [] operators on result tree fragments. When a permitted operation is performed on a result tree fragment, it is performed exactly as it would be on the equivalent node-set.
When a result tree fragment is copied into the result tree (see [11.3 Using Values of Variables and Parameters with xsl:copy-of]), then all the nodes that are children of the root node in the equivalent node-set are added in sequence to the result tree.
ce que je comprends c est que le result tree fragment agit comme une string...
1/ une variable est elle forcément un result tree fragment?
2/ comment eviter de se retrouver avec un rtf?
l interet est tout de meme de continuer à parser les objets avec XPATH donc je ne comprend pas l interet de ce type... est ce un manque de conception?
Dans mon projet de XMLdifference dans lequel je compare deux fichiers XML:
le 1er passé au parseur
le 2eme dont le chemin est passé en parametre puis récupérer ds le xsl avec un document(param)...dans une variable justement.
Rencontrerai je des problemes de ce style?
tout autre info concernant les rtf est bienvenu car c est assez obscure. Merci