Xpath添加条件以排除具有特定后代元素而没有值的元素

时间:2012-12-27 15:02:50

标签: xml xpath filter selector

拥有以下xml:(Full xml)

 <Matrix>
  <AffectsFormMode>1</AffectsFormMode>
  <BackColor>-1</BackColor>
  <Description></Description>
  <DisplayDesc>0</DisplayDesc>
  <Enabled>0</Enabled>
  <FontSize>-1</FontSize>
  <ForeColor>-1</ForeColor>
  <FromPane>1</FromPane>
  <Height>263</Height>
  <Layout>0</Layout>
  <Left>6</Left>
  <LinkTo></LinkTo>
  <RightJustified>0</RightJustified>
  <TextStyle>0</TextStyle>
  <Top>5</Top>
  <ToPane>1</ToPane>
  <Type>127</Type>
  <UniqueID>1</UniqueID>
  <Visible>1</Visible>
  <Width>544</Width>
  <ColumnsInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind>
        <Alias>SYS_72</Alias>
        <DataBound>1</DataBound>
        <TableName></TableName>
      </DataBind>
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>0</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>0</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>#</Title>
      <Type>16</Type>
      <UniqueID>0</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>1</Visible>
      <Width>20</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind />
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>0</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>0</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>Indicador de retenci&#243;n</Title>
      <Type>16</Type>
      <UniqueID>1</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>1</Visible>
      <Width>80</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind />
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>0</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>0</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>Nombre impuesto retenci&#243;n</Title>
      <Type>16</Type>
      <UniqueID>15</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>1</Visible>
      <Width>80</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind>
        <Alias>SYS_67</Alias>
        <DataBound>1</DataBound>
        <TableName></TableName>
      </DataBind>
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>0</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>0</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>Ret.%</Title>
      <Type>16</Type>
      <UniqueID>17</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>1</Visible>
      <Width>80</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind />
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>1</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>0</RightJustified>
      <TextStyle>0</TextStyle>
      <Title></Title>
      <Type>16</Type>
      <UniqueID>36</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>1</Visible>
      <Width>10</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind>
        <Alias>SYS_70</Alias>
        <DataBound>1</DataBound>
        <TableName></TableName>
      </DataBind>
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>1</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>0</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>N&#186; folio</Title>
      <Type>16</Type>
      <UniqueID>73</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>0</Visible>
      <Width>0</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind>
        <Alias>SYS_60</Alias>
        <DataBound>1</DataBound>
        <TableName></TableName>
      </DataBind>
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>0</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>0</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>N&#250;mero de documento</Title>
      <Type>116</Type>
      <UniqueID>18</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>1</Visible>
      <Width>90</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind />
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>0</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>0</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>Fecha de documento</Title>
      <Type>16</Type>
      <UniqueID>22</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>1</Visible>
      <Width>90</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind />
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>0</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>0</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>Fecha de pago</Title>
      <Type>16</Type>
      <UniqueID>38</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>1</Visible>
      <Width>90</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind>
        <Alias>SYS_78</Alias>
        <DataBound>1</DataBound>
        <TableName></TableName>
      </DataBind>
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>0</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>1</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>Importe documento</Title>
      <Type>16</Type>
      <UniqueID>39</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>1</Visible>
      <Width>100</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind>
        <Alias>SYS_79</Alias>
        <DataBound>1</DataBound>
        <TableName></TableName>
      </DataBind>
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>1</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>0</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>Importe neto factura</Title>
      <Type>16</Type>
      <UniqueID>72</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>0</Visible>
      <Width>0</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind>
        <Alias>SYS_61</Alias>
        <DataBound>1</DataBound>
        <TableName></TableName>
      </DataBind>
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>0</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>1</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>Importe base</Title>
      <Type>16</Type>
      <UniqueID>23</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>0</Visible>
      <Width>0</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind>
        <Alias>SYS_62</Alias>
        <DataBound>1</DataBound>
        <TableName></TableName>
      </DataBind>
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>0</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>1</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>Importe sujeto a impuestos</Title>
      <Type>16</Type>
      <UniqueID>24</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>1</Visible>
      <Width>100</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind>
        <Alias>SYS_63</Alias>
        <DataBound>1</DataBound>
        <TableName></TableName>
      </DataBind>
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>0</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>1</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>Importe de retenci&#243;n</Title>
      <Type>16</Type>
      <UniqueID>25</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>1</Visible>
      <Width>90</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind>
        <Alias>SYS_64</Alias>
        <DataBound>1</DataBound>
        <TableName></TableName>
      </DataBind>
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>0</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>1</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>Importe del pago</Title>
      <Type>16</Type>
      <UniqueID>26</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>1</Visible>
      <Width>90</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind>
        <Alias>SYS_65</Alias>
        <DataBound>1</DataBound>
        <TableName></TableName>
      </DataBind>
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>0</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>1</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>Importe exento</Title>
      <Type>16</Type>
      <UniqueID>28</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>0</Visible>
      <Width>0</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind>
        <Alias>SYS_66</Alias>
        <DataBound>1</DataBound>
        <TableName></TableName>
      </DataBind>
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>0</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>1</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>Importe no sujeto</Title>
      <Type>16</Type>
      <UniqueID>29</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>1</Visible>
      <Width>105</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind />
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>1</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>0</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>abs entry</Title>
      <Type>116</Type>
      <UniqueID>32</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>0</Visible>
      <Width>0</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind />
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>1</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>0</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>TYPE</Title>
      <Type>16</Type>
      <UniqueID>33</UniqueID>
      <ValidValues>
        <ValidValue>
          <Description>A/P Invoice</Description>
          <Value>18</Value>
        </ValidValue>
      </ValidValues>
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>0</Visible>
      <Width>0</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind>
        <Alias>SYS_75</Alias>
        <DataBound>1</DataBound>
        <TableName></TableName>
      </DataBind>
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>1</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>0</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>IsHeaderLine</Title>
      <Type>16</Type>
      <UniqueID>34</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>0</Visible>
      <Width>0</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind />
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>1</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>0</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>N&#250;mero referencia</Title>
      <Type>16</Type>
      <UniqueID>37</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>0</Visible>
      <Width>0</Width>
    </ColumnInfo>
    <ColumnInfo>
      <AffectsFormMode>1</AffectsFormMode>
      <BackColor>-1</BackColor>
      <ChooseFromListAlias></ChooseFromListAlias>
      <ChooseFromListUID></ChooseFromListUID>
      <DataBind>
        <Alias>SYS_81</Alias>
        <DataBound>1</DataBound>
        <TableName></TableName>
      </DataBind>
      <Description></Description>
      <DisplayDesc>0</DisplayDesc>
      <Editable>0</Editable>
      <FontSize>-1</FontSize>
      <ForeColor>-1</ForeColor>
      <RightJustified>1</RightJustified>
      <TextStyle>0</TextStyle>
      <Title>Total no sujeto a impuestos</Title>
      <Type>16</Type>
      <UniqueID>540000075</UniqueID>
      <ValidValues />
      <ValOFF></ValOFF>
      <ValON></ValON>
      <Visible>1</Visible>
      <Width>105</Width>
    </ColumnInfo>
  </ColumnsInfo>
  <Rows>
    <Row>
      <Visible>1</Visible>
      <Columns>
        <Column>
          <ID>0</ID>
          <Value>1</Value>
        </Column>
        <Column>
          <ID>1</ID>
          <Value>A01</Value>
        </Column>
        <Column>
          <ID>15</ID>
          <Value>Actividad modulos</Value>
        </Column>
        <Column>
          <ID>17</ID>
          <Value>1.0000</Value>
        </Column>
        <Column>
          <ID>36</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>73</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>18</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>22</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>38</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>39</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>72</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>23</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>24</ID>
          <Value>2,914.83 EUR</Value>
        </Column>
        <Column>
          <ID>25</ID>
          <Value>29.14 EUR</Value>
        </Column>
        <Column>
          <ID>26</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>28</ID>
          <Value>0.00 EUR</Value>
        </Column>
        <Column>
          <ID>29</ID>
          <Value>0.00 EUR</Value>
        </Column>
        <Column>
          <ID>32</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>33</ID>
          <Value>18</Value>
        </Column>
        <Column>
          <ID>34</ID>
          <Value>1</Value>
        </Column>
        <Column>
          <ID>37</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>540000075</ID>
          <Value>0.00 EUR</Value>
        </Column>
      </Columns>
    </Row>
    <Row>
      <Visible>0</Visible>
      <Columns>
        <Column>
          <ID>0</ID>
          <Value>0</Value>
        </Column>
        <Column>
          <ID>1</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>15</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>17</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>36</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>73</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>18</ID>
          <Value>TT 5887</Value>
        </Column>
        <Column>
          <ID>22</ID>
          <Value>01/04/2011</Value>
        </Column>
        <Column>
          <ID>38</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>39</ID>
          <Value>52.65 EUR</Value>
        </Column>
        <Column>
          <ID>72</ID>
          <Value>44.55 EUR</Value>
        </Column>
        <Column>
          <ID>23</ID>
          <Value>45.00 EUR</Value>
        </Column>
        <Column>
          <ID>24</ID>
          <Value>45.00 EUR</Value>
        </Column>
        <Column>
          <ID>25</ID>
          <Value>0.45 EUR</Value>
        </Column>
        <Column>
          <ID>26</ID>
          <Value>52.65 EUR</Value>
        </Column>
        <Column>
          <ID>28</ID>
          <Value>0.00 EUR</Value>
        </Column>
        <Column>
          <ID>29</ID>
          <Value>0.00 EUR</Value>
        </Column>
        <Column>
          <ID>32</ID>
          <Value>34271</Value>
        </Column>
        <Column>
          <ID>33</ID>
          <Value>18</Value>
        </Column>
        <Column>
          <ID>34</ID>
          <Value>2</Value>
        </Column>
        <Column>
          <ID>37</ID>
          <Value>28 15793/0128/1</Value>
        </Column>
        <Column>
          <ID>540000075</ID>
          <Value>0.00 EUR</Value>
        </Column>
      </Columns>
    </Row>
    <Row>
      <Visible>1</Visible>
      <Columns>
        <Column>
          <ID>0</ID>
          <Value>2</Value>
        </Column>
        <Column>
          <ID>1</ID>
          <Value>BI</Value>
        </Column>
        <Column>
          <ID>15</ID>
          <Value>Arrendamiento Bienes Inmuebles</Value>
        </Column>
        <Column>
          <ID>17</ID>
          <Value>21.0000</Value>
        </Column>
        <Column>
          <ID>36</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>73</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>18</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>22</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>38</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>39</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>72</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>23</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>24</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>25</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>26</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>28</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>29</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>32</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>33</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>34</ID>
          <Value>1</Value>
        </Column>
        <Column>
          <ID>37</ID>
          <Value></Value>
        </Column>
        <Column>
          <ID>540000075</ID>
          <Value></Value>
        </Column>
      </Columns>
    </Row>
  </Rows>
</Matrix>

这个xpath选择器:

/Matrix/Rows/Row[descendant::Visible='1']/Columns/Column[descendant::ID='1']/Value/text()

我如何以及以下条件:从选择中排除具有Column / ID ='24'的Row节点以及它的Column / Value / text()=''

尝试过这样的事情(没有用):

/Matrix/Rows/Row[descendant::Visible='1' and (descendant::ID='24' and descendant::Value!='')]/Columns/Column[descendant::ID='1']/Value/text()

1 个答案:

答案 0 :(得分:1)

您应该使用not()并指定您要为此过滤器寻找的节点:

/Matrix/Rows/Row[descendant::Visible='1' and not(./Columns/Column[ID='24' and Value=''])]/Columns/Column[descendant::ID='1']/Value/text()