当XSLT变量为true时,它不会获得值

时间:2014-07-25 11:18:31

标签: xslt

在这里,我无法得到“这样的好消息”。对于变量' PageHeadStatus',甚至,输入xml中可用的那些元素,我在这里还缺少什么。任何帮助

XML

<?xml version="1.0" encoding="UTF-8"?>
<legislation xmlns:y="http://tso.sentinal">
   <metadata>
      <legislationtype name="act"/>
      <title><!--Is this it?-->ROAD TRAFFIC ACT 1994</title>
      <number>7</number>
      <year>1994</year>
      <dateofenactment>19940420</dateofenactment>
      <meta name="volume">1994</meta>
      <lang code="en"/>
   </metadata>
   <frontmatter>
     <toc>
         <table before="0" after="0" left="0" right="0" class="t1">
            <col width="20%"/>
            <col width="80%"/>
            <tr>
               <td class="x" colspan="1" rowspan="1" valign="top">
                  <p before="0" after="0" left="0" right="0" firstline="flush" align="right" fli="0">Section</p>
               </td>
               <td class="x" colspan="1" rowspan="1" valign="top"/>
            </tr>
            <tr>
               <td class="x" colspan="1" rowspan="1" valign="top">
                  <p before="0" after="1" left="0" right="2" firstline="flush" align="right" fli="0">
                     <lexref targetname="#SEC1">1.</lexref>
                  </p>
               </td>
               <td class="x" colspan="1" rowspan="1" valign="top">
                  <p before="0" after="1" left="5" right="0" firstline="outdent" align="justify"
                     fli="-5">
                     <lexref targetname="#SEC1">Short title, commencement, construction and collective citation.</lexref>
                  </p>
               </td>
            </tr>
            <tr>
               <td class="x" colspan="1" rowspan="1" valign="top">
                  <p before="0" after="1" left="0" right="2" firstline="flush" align="right" fli="0">
                     <lexref targetname="#SEC2">2.</lexref>
                  </p>
               </td>
               <td class="x" colspan="1" rowspan="1" valign="top">
                  <p before="0" after="1" left="5" right="0" firstline="outdent" align="justify"
                     fli="-5">
                     <lexref targetname="#SEC2">Interpretation.</lexref>
                  </p>
               </td>
            </tr>
            <tr>
               <td class="x" colspan="1" rowspan="1" valign="top">
                  <p before="0" after="1" left="0" right="2" firstline="flush" align="right" fli="0">
                     <lexref targetname="#SEC3">3.</lexref>
                  </p>
               </td>
               <td class="x" colspan="1" rowspan="1" valign="top">
                  <p before="0" after="1" left="5" right="0" firstline="outdent" align="justify"
                     fli="-5">
                     <lexref targetname="#SEC3">Regulations.</lexref>
                  </p>
               </td>
            </tr>
            <tr>
               <td class="x" colspan="1" rowspan="1" valign="top">
                  <p before="0" after="1" left="0" right="2" firstline="flush" align="right" fli="0">
                     <lexref targetname="#SEC4">4.</lexref>
                  </p>
               </td>
               <td class="x" colspan="1" rowspan="1" valign="top">
                  <p before="0" after="1" left="5" right="0" firstline="outdent" align="justify"
                     fli="-5">
                     <lexref targetname="#SEC4">Repeals.</lexref>
                  </p>
               </td>
            </tr>
         </table>
         </toc>
         <div class="annotations">
         <p before="0" after="2" left="0" right="0" firstline="flush" align="justify"
            fli="0">
            <b>Annotations</b>
         </p>
         <div class="c-notes">
            <p before="0" after="1" left="0" right="0" firstline="flush" align="left" fli="0">
               <b>Modifications (not altering text):</b>
            </p>
            <div class="c-note">
               <shouldernote1>
                  <p before="0" after="0" left="0" right="0" firstline="flush" align="left" fli="0">C1</p>
               </shouldernote1>
               <p before="0" after="1" left="0" right="0" firstline="flush" align="left"> Application of collectively cited <i>Road Traffic Acts 1961 to 2010</i> restricted (28.10.2011) by <i>Road Traffic Act 2010</i> (25/2010), s. 87(1), S.I. No.  543 of 2011, as substituted (20.03.2014) by <i>Road Traffic Act 2014</i> (3/2014), s. 23, S.I. No. 147 of 2014.</p>
               <p before="0" after="1" left="0" right="0" firstline="flush" align="left">
                  <b>Exemptions for emergency vehicles.</b>
               </p>
               <p before="0" after="1" left="0" right="0" firstline="indent" align="left" fli="2">
                  <b>87.</b>—<tabs/>
                  <b>[</b>(1) Requirements under the Road Traffic Acts 1961 to 2010 relating to vehicles and requirements, restrictions and prohibitions relating to the driving and use of vehicles, other than those provided under sections 49, 50, 51A, 52 and 53 of the Principal Act, sections 12, 13 and 15 of the Act of 1994 and sections 4, 5, 11, 12 and 14 of this Act, do not apply to—</p>
               <p before="0" after="1" left="9" right="0" firstline="outdent" align="justify"
                  fli="-5">(a) the driving or use by a member of the Garda Síochána, an ambulance service (provided by a pre-hospital emergency care service provider recognised by the Pre-Hospital Emergency Care Council established by the Pre-Hospital Emergency Care Council (Establishment) Order 2000 (<lexref targetname="EN.SI.2000.0109">S.I. No. 109 of 2000</lexref>)) or a fire brigade of a fire authority (within the meaning of the <lexref targetname="EN.ACT.1981.0030">Fire Services Act 1981</lexref>) of a vehicle in the performance of the duties of that member, or</p>
               <p before="0" after="1" left="9" right="0" firstline="outdent" align="justify"
                  fli="-5">(b) a person driving or using a vehicle under the direction of a member of the Garda Síochána,</p>
               <p before="0" after="1" left="0" right="0" firstline="flush" align="justify"
                  fli="0">where such use does not endanger the safety of road users.<b>]</b>
               </p>
            </div>
            </div>

我已将此声明为全球变量

 <xsl:variable name="PageHeadStatus">
         <xsl:choose>
            <xsl:when test="/legislation/frontmatter/toc and /legislation/frontmatter/div[@class='annotations']">
            <xsl:value-of select="'YESANO'"/>
            </xsl:when>
            <xsl:otherwise><xsl:value-of select="'NOANO'"/></xsl:otherwise>
        </xsl:choose>
        </xsl:variable> 

0 个答案:

没有答案