Processing directive

From Friend2Friend Wiki
Jump to: navigation, search
(Created page with ''''Processing directives''' (p.d.'s) are XML attributes to modify the effect of requests. Processing directives fall into 3 categories, according to when they take affect: {| | …')
 
 
Line 1: Line 1:
 
'''Processing directives''' (p.d.'s) are XML attributes to modify the effect of requests.
 
'''Processing directives''' (p.d.'s) are XML attributes to modify the effect of requests.
Processing directives fall into 3 categories, according to when they take affect:
+
They fall into 3 categories, according to when they take affect:
  
 
{|
 
{|
| pre-*  || Applied to the <servicereq> before it is processed
+
| pre-*  || || Applied to the <servicereq> before it is processed
 
|-
 
|-
| this-* || Applied to the output of the <servicereq> immediately it is processed. (The most useful of the 3).
+
| this-* || || Applied to the output of the <servicereq> immediately it is processed. (The most useful of the 3).
 
|-
 
|-
| post-* || Applied to the output of the <servicereq> once it and any descendent requests have been carried out.
+
| post-* || || Applied to the output of the <servicereq> once it and any descendent requests have been carried out.
 
|}
 
|}
  
Line 13: Line 13:
 
with existing services. For example, a ''reverse'' service is unneeded, since the same effect could be achieved using
 
with existing services. For example, a ''reverse'' service is unneeded, since the same effect could be achieved using
  
<servicereq function="http://friend2friend.net/services/identity" this-sort="['''xpath to specify nodes whose kids need reversing''']" this-sort-keys="position()" this-sort-order="0">
+
'''<servicereq function="http://friend2friend.net/services/identity" this-sort="[''xpath to specify nodes whose kids need reversing'']" this-sort-keys="position()" this-sort-order="0">'''
  
The value of most p.d.'s is '''f2f:xpath''' since this is an effective way of combining flexibility with brevity.  
+
Most p.d.'s are Xpaths since this is an effective way of combining flexibility with brevity, and one familiar to XSLT authors.
 
If a single XPath is insufficient to express the desired transformation, the preferred design option  
 
If a single XPath is insufficient to express the desired transformation, the preferred design option  
 
(since these may have to be created and/or processed by XSLT) is to use a set of p.d.s in combination, such as  
 
(since these may have to be created and/or processed by XSLT) is to use a set of p.d.s in combination, such as  
Line 22: Line 22:
  
 
Two presentations are available on this subject:
 
Two presentations are available on this subject:
* [[http://www.altruists.org/ff6 FF6 - Common Processing Directives]]
+
* [http://www.altruists.org/ff6 FF6 - Common Processing Directives]
* [[http://www.altruists.org/ff106 FF106 - Other Processing Directives]]
+
* [http://www.altruists.org/ff106 FF106 - Other Processing Directives]

Latest revision as of 21:26, 3 October 2009

Personal tools