1*1212f9a0SAndroid Build Coastguard Worker<?xml version="1.0"?> 2*1212f9a0SAndroid Build Coastguard Worker<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" 3*1212f9a0SAndroid Build Coastguard Worker xmlns:ex="http://xml.apache.org/xalan" 4*1212f9a0SAndroid Build Coastguard Worker extension-element-prefixes="ex"> 5*1212f9a0SAndroid Build Coastguard Worker 6*1212f9a0SAndroid Build Coastguard Worker <!-- FileName: libraryNodeset08 --> 7*1212f9a0SAndroid Build Coastguard Worker <!-- Document: http://www.w3.org/TR/xslt --> 8*1212f9a0SAndroid Build Coastguard Worker <!-- DocVersion: 19991116 --> 9*1212f9a0SAndroid Build Coastguard Worker <!-- Section: 11.4 --> 10*1212f9a0SAndroid Build Coastguard Worker <!-- Creator: Joe Kesselman --> 11*1212f9a0SAndroid Build Coastguard Worker <!-- Purpose: Try paths from nodeset of local RTF; ensure we get the right one. --> 12*1212f9a0SAndroid Build Coastguard Worker 13*1212f9a0SAndroid Build Coastguard Worker<xsl:output method="xml" indent="no" encoding="UTF-8"/> 14*1212f9a0SAndroid Build Coastguard Worker 15*1212f9a0SAndroid Build Coastguard Worker<xsl:template match="/"> 16*1212f9a0SAndroid Build Coastguard Worker <xsl:variable name="var1"> 17*1212f9a0SAndroid Build Coastguard Worker <t1-far-north> 18*1212f9a0SAndroid Build Coastguard Worker <t1-north> 19*1212f9a0SAndroid Build Coastguard Worker <t1-near-north> 20*1212f9a0SAndroid Build Coastguard Worker <t1-far-west/> 21*1212f9a0SAndroid Build Coastguard Worker <t1-west/> 22*1212f9a0SAndroid Build Coastguard Worker <t1-near-west/> 23*1212f9a0SAndroid Build Coastguard Worker <center center-attr-1="c1" xmlns:n="http://example.com">Wrong variable, can you dig it? 24*1212f9a0SAndroid Build Coastguard Worker <t1-near-south> 25*1212f9a0SAndroid Build Coastguard Worker <t1-south> 26*1212f9a0SAndroid Build Coastguard Worker <t1-far-south/> 27*1212f9a0SAndroid Build Coastguard Worker </t1-south> 28*1212f9a0SAndroid Build Coastguard Worker </t1-near-south> 29*1212f9a0SAndroid Build Coastguard Worker </center> 30*1212f9a0SAndroid Build Coastguard Worker <t1-near-east/> 31*1212f9a0SAndroid Build Coastguard Worker <t1-east/> 32*1212f9a0SAndroid Build Coastguard Worker <t1-far-east/> 33*1212f9a0SAndroid Build Coastguard Worker </t1-near-north> 34*1212f9a0SAndroid Build Coastguard Worker </t1-north> 35*1212f9a0SAndroid Build Coastguard Worker </t1-far-north> 36*1212f9a0SAndroid Build Coastguard Worker </xsl:variable> 37*1212f9a0SAndroid Build Coastguard Worker 38*1212f9a0SAndroid Build Coastguard Worker <xsl:variable name="var2"> 39*1212f9a0SAndroid Build Coastguard Worker <t2-far-north> 40*1212f9a0SAndroid Build Coastguard Worker <t2-north> 41*1212f9a0SAndroid Build Coastguard Worker <t2-near-north> 42*1212f9a0SAndroid Build Coastguard Worker <t2-far-west/> 43*1212f9a0SAndroid Build Coastguard Worker <t2-west/> 44*1212f9a0SAndroid Build Coastguard Worker <t2-near-west/> 45*1212f9a0SAndroid Build Coastguard Worker <center center-attr-1="c2" xmlns:n="http://example.com">Dig we must! 46*1212f9a0SAndroid Build Coastguard Worker <t2-near-south> 47*1212f9a0SAndroid Build Coastguard Worker <t2-south> 48*1212f9a0SAndroid Build Coastguard Worker <t2-far-south/> 49*1212f9a0SAndroid Build Coastguard Worker </t2-south> 50*1212f9a0SAndroid Build Coastguard Worker </t2-near-south> 51*1212f9a0SAndroid Build Coastguard Worker </center> 52*1212f9a0SAndroid Build Coastguard Worker <t2-near-east/> 53*1212f9a0SAndroid Build Coastguard Worker <t2-east/> 54*1212f9a0SAndroid Build Coastguard Worker <t2-far-east/> 55*1212f9a0SAndroid Build Coastguard Worker </t2-near-north> 56*1212f9a0SAndroid Build Coastguard Worker </t2-north> 57*1212f9a0SAndroid Build Coastguard Worker </t2-far-north> 58*1212f9a0SAndroid Build Coastguard Worker </xsl:variable> 59*1212f9a0SAndroid Build Coastguard Worker 60*1212f9a0SAndroid Build Coastguard Worker <out> 61*1212f9a0SAndroid Build Coastguard Worker <!-- Now, force evaluation of each of the above variables --> 62*1212f9a0SAndroid Build Coastguard Worker <junk> 63*1212f9a0SAndroid Build Coastguard Worker <xsl:text>$var1 summary: </xsl:text> 64*1212f9a0SAndroid Build Coastguard Worker <xsl:value-of select="$var1"/> 65*1212f9a0SAndroid Build Coastguard Worker <xsl:text> 66*1212f9a0SAndroid Build Coastguard Worker</xsl:text> 67*1212f9a0SAndroid Build Coastguard Worker <xsl:text>$var2 summary: </xsl:text> 68*1212f9a0SAndroid Build Coastguard Worker <xsl:value-of select="$var2"/> 69*1212f9a0SAndroid Build Coastguard Worker </junk> 70*1212f9a0SAndroid Build Coastguard Worker 71*1212f9a0SAndroid Build Coastguard Worker <!-- Now, traverse some axes --> 72*1212f9a0SAndroid Build Coastguard Worker <xsl:apply-templates select="ex:nodeset($var2)//t2-north"/> 73*1212f9a0SAndroid Build Coastguard Worker </out> 74*1212f9a0SAndroid Build Coastguard Worker</xsl:template> 75*1212f9a0SAndroid Build Coastguard Worker 76*1212f9a0SAndroid Build Coastguard Worker<xsl:template match="t2-north"> 77*1212f9a0SAndroid Build Coastguard Worker <!-- DS means the location path is optimizable as a single descendant iterator. --> 78*1212f9a0SAndroid Build Coastguard WorkerDS 1. AC: <xsl:value-of select="name(/descendant-or-self::t2-north)"/> 79*1212f9a0SAndroid Build Coastguard WorkerDS 2. AD: <xsl:value-of select="name(/descendant::t2-near-north)"/> 80*1212f9a0SAndroid Build Coastguard WorkerDS 3. BC: <xsl:value-of select="name(self::node()/descendant-or-self::t2-north)"/> 81*1212f9a0SAndroid Build Coastguard WorkerDS 4. BD: <xsl:value-of select="name(self::node()/descendant::t2-near-north)"/> 82*1212f9a0SAndroid Build Coastguard WorkerNDS 5. CC: <xsl:value-of select="name(descendant-or-self::t2-north/descendant-or-self::t2-north)"/> 83*1212f9a0SAndroid Build Coastguard WorkerNDS 6. CD: <xsl:value-of select="name(descendant-or-self::t2-north/descendant::t2-near-north)"/> 84*1212f9a0SAndroid Build Coastguard WorkerNDS 7. CE: <xsl:value-of select="name(descendant-or-self::t2-north/child::t2-near-north)"/> 85*1212f9a0SAndroid Build Coastguard WorkerNDS 8. DC: <xsl:value-of select="name(descendant::t2-near-north/descendant-or-self::t2-near-north)"/> 86*1212f9a0SAndroid Build Coastguard WorkerNDS 9. DD: <xsl:value-of select="name(descendant::t2-near-north/descendant::t2-far-west)"/> 87*1212f9a0SAndroid Build Coastguard Worker 88*1212f9a0SAndroid Build Coastguard WorkerNDS 10. ACC: <xsl:value-of select="name(/descendant-or-self::t2-north/descendant-or-self::t2-north)"/> 89*1212f9a0SAndroid Build Coastguard WorkerNDS 11. ACE: <xsl:value-of select="name(/descendant-or-self::t2-north/child::t2-near-north)"/> 90*1212f9a0SAndroid Build Coastguard WorkerNDS 12. ADC: <xsl:value-of select="name(/descendant::t2-near-north/descendant-or-self::t2-near-north)"/> 91*1212f9a0SAndroid Build Coastguard WorkerNDS 13. BCC: <xsl:value-of select="name(self::node()/descendant-or-self::t2-north/descendant-or-self::t2-north)"/> 92*1212f9a0SAndroid Build Coastguard WorkerNDS 14. BCE: <xsl:value-of select="name(self::node()/descendant-or-self::t2-north/child::t2-near-north)"/> 93*1212f9a0SAndroid Build Coastguard WorkerNDS 15. BDC: <xsl:value-of select="name(self::node()/descendant::t2-near-north/descendant-or-self::t2-far-west)"/> 94*1212f9a0SAndroid Build Coastguard WorkerNDS 16. BDE: <xsl:value-of select="name(self::node()/descendant::t2-near-north/child::t2-far-west)"/> 95*1212f9a0SAndroid Build Coastguard WorkerNDS 17. CCC: <xsl:value-of select="name(descendant-or-self::t2-north/descendant-or-self::t2-north/descendant-or-self::t2-north)"/> 96*1212f9a0SAndroid Build Coastguard WorkerNDS 18. CCE: <xsl:value-of select="name(descendant-or-self::t2-north/descendant-or-self::t2-north/child::t2-near-north)"/> 97*1212f9a0SAndroid Build Coastguard WorkerNDS 19. CDC: <xsl:value-of select="name(descendant-or-self::t2-north/descendant::t2-near-north/descendant-or-self::t2-near-north)"/> 98*1212f9a0SAndroid Build Coastguard WorkerNDS 20. CDE: <xsl:value-of select="name(descendant-or-self::t2-north/descendant::t2-near-north/child::t2-far-west)"/> 99*1212f9a0SAndroid Build Coastguard WorkerNDS 21. CEC: <xsl:value-of select="name(descendant-or-self::t2-north/child::t2-near-north/descendant-or-self::t2-near-north)"/> 100*1212f9a0SAndroid Build Coastguard WorkerNDS 22. CEE: <xsl:value-of select="name(descendant-or-self::t2-north/child::t2-near-north/child::t2-far-west)"/> 101*1212f9a0SAndroid Build Coastguard WorkerNDS 23. DCC: <xsl:value-of select="name(descendant::t2-near-north/descendant-or-self::t2-near-north/descendant-or-self::t2-near-north)"/> 102*1212f9a0SAndroid Build Coastguard WorkerNDS 24. DCE: <xsl:value-of select="name(descendant::t2-near-north/descendant-or-self::t2-near-north/child::t2-far-west)"/> 103*1212f9a0SAndroid Build Coastguard WorkerNDS 25. DDC: <xsl:value-of select="name(descendant::t2-near-north/descendant::t2-far-west/descendant-or-self::t2-far-west)"/> 104*1212f9a0SAndroid Build Coastguard Worker 105*1212f9a0SAndroid Build Coastguard WorkerDS 26. CC: <xsl:value-of select="name(descendant-or-self::node()/descendant-or-self::t2-north)"/> 106*1212f9a0SAndroid Build Coastguard WorkerDS 27. CD: <xsl:value-of select="name(descendant-or-self::node()/descendant::t2-near-north)"/> 107*1212f9a0SAndroid Build Coastguard WorkerDS 28. CE: <xsl:value-of select="name(descendant-or-self::node()/child::t2-near-north)"/> 108*1212f9a0SAndroid Build Coastguard WorkerDS 29. DC: <xsl:value-of select="name(descendant::node()/descendant-or-self::t2-near-north)"/> 109*1212f9a0SAndroid Build Coastguard WorkerDS 30. DD: <xsl:value-of select="name(descendant::node()/descendant::t2-far-west)"/> 110*1212f9a0SAndroid Build Coastguard Worker 111*1212f9a0SAndroid Build Coastguard WorkerDS 31. ACC: <xsl:value-of select="name(/descendant-or-self::node()/descendant-or-self::t2-north)"/> 112*1212f9a0SAndroid Build Coastguard WorkerDS 32. ACE: <xsl:value-of select="name(/descendant-or-self::node()/child::t2-near-north)"/> 113*1212f9a0SAndroid Build Coastguard WorkerDS 33. ADC: <xsl:value-of select="name(/descendant::node()/descendant-or-self::t2-near-north)"/> 114*1212f9a0SAndroid Build Coastguard WorkerDS 34. BCC: <xsl:value-of select="name(self::node()/descendant-or-self::node()/descendant-or-self::t2-north)"/> 115*1212f9a0SAndroid Build Coastguard WorkerDS 35. BCE: <xsl:value-of select="name(self::node()/descendant-or-self::node()/child::t2-near-north)"/> 116*1212f9a0SAndroid Build Coastguard WorkerDS 36. BDC: <xsl:value-of select="name(self::node()/descendant::node()/descendant-or-self::t2-far-west)"/> 117*1212f9a0SAndroid Build Coastguard WorkerDS 37. BDE: <xsl:value-of select="name(self::node()/descendant::node()/child::t2-far-west)"/> 118*1212f9a0SAndroid Build Coastguard WorkerDS 38. CCC: <xsl:value-of select="name(descendant-or-self::node()/descendant-or-self::node()/descendant-or-self::t2-north)"/> 119*1212f9a0SAndroid Build Coastguard WorkerDS 39. CCE: <xsl:value-of select="name(descendant-or-self::node()/descendant-or-self::node()/child::t2-near-north)"/> 120*1212f9a0SAndroid Build Coastguard WorkerDS 40. CDC: <xsl:value-of select="name(descendant-or-self::node()/descendant::node()/descendant-or-self::t2-near-north)"/> 121*1212f9a0SAndroid Build Coastguard WorkerDS 41. CDE: <xsl:value-of select="name(descendant-or-self::node()/descendant::node()/child::t2-far-west)"/> 122*1212f9a0SAndroid Build Coastguard WorkerDS 42. CEC: <xsl:value-of select="name(descendant-or-self::node()/child::node()/descendant-or-self::t2-near-north)"/> 123*1212f9a0SAndroid Build Coastguard WorkerDS 43. CEE: <xsl:value-of select="name(descendant-or-self::node()/child::node()/child::t2-far-west)"/> 124*1212f9a0SAndroid Build Coastguard WorkerDS 44. DCC: <xsl:value-of select="name(descendant::node()/descendant-or-self::node()/descendant-or-self::t2-near-north)"/> 125*1212f9a0SAndroid Build Coastguard WorkerDS 45. DCE: <xsl:value-of select="name(descendant::node()/descendant-or-self::node()/child::t2-far-west)"/> 126*1212f9a0SAndroid Build Coastguard WorkerDS 46. DDC: <xsl:value-of select="name(descendant::node()/descendant::node()/descendant-or-self::t2-far-west)"/> 127*1212f9a0SAndroid Build Coastguard Worker</xsl:template> 128*1212f9a0SAndroid Build Coastguard Worker 129*1212f9a0SAndroid Build Coastguard Worker 130*1212f9a0SAndroid Build Coastguard Worker <!-- 131*1212f9a0SAndroid Build Coastguard Worker * Licensed to the Apache Software Foundation (ASF) under one 132*1212f9a0SAndroid Build Coastguard Worker * or more contributor license agreements. See the NOTICE file 133*1212f9a0SAndroid Build Coastguard Worker * distributed with this work for additional information 134*1212f9a0SAndroid Build Coastguard Worker * regarding copyright ownership. The ASF licenses this file 135*1212f9a0SAndroid Build Coastguard Worker * to you under the Apache License, Version 2.0 (the "License"); 136*1212f9a0SAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 137*1212f9a0SAndroid Build Coastguard Worker * You may obtain a copy of the License at 138*1212f9a0SAndroid Build Coastguard Worker * 139*1212f9a0SAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 140*1212f9a0SAndroid Build Coastguard Worker * 141*1212f9a0SAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 142*1212f9a0SAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 143*1212f9a0SAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 144*1212f9a0SAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 145*1212f9a0SAndroid Build Coastguard Worker * limitations under the License. 146*1212f9a0SAndroid Build Coastguard Worker --> 147*1212f9a0SAndroid Build Coastguard Worker 148*1212f9a0SAndroid Build Coastguard Worker</xsl:stylesheet> 149