This page has no content. Enrich MindTouch Community Portal by contributing.

      some list itemv1

    Print the value of the table item:  some list itemv1

    by using :{{ xml.text(page.xml, "//td[@id='somefield']") }}

     Now we have a p paragraph in the table

    some list itemv2

    Print the value of the table item: some list itemv2

    by using :{{ xml.text(page.xml, "//td[@id='somefield2']") }}

    This doesn't work because the xpath contains multiple elements...  

    Print the value of the table item:[ " " ]

    by using :{{ xml.list(page.xml, "//td[@id='somefield2']") }}

     We have to print them all:  

    Print the value of the table item:[ "some list itemv2" ]

    by using :{{ xml.list(page.xml, "//td[@id='somefield2']//*") }}

    But if we use this query on the original data element it doesn't work

    Print the value of the table item:[]

    by using :{{ xml.list(page.xml, "//td[@id='somefield1']//*") }}

    So we use the descendant-or-self axis to include the parentnode

    Print the value of the table item:

     

    met td voorop:[ "\u00a0 some list itemv1", " ", "some list itemv2" ]

    met td 2 :[ "\u00a0 some list itemv1", " ", "some list itemv2", " " ]

    by using 

    met td voorop:{{ xml.list(page.xml, "//td/descendant-or-self::*") }}

    met td 2 :{{ xml.list(page.xml, "//td/descendant-or-self::text()") }}

     

    But this doesn't work?! because nil values or empty strings are returned 

     Filtering nil or empty strings

    met td voorop:[ "\u00a0 some list itemv1", " ", "some list itemv2" ]

    met td 2 :[ "\u00a0 some list itemv1", "some list itemv2" ]

    met td voorop:{{ xml.list(page.xml, "//td/descendant-or-self::*[normalize-space(.)]")  }}
    
    met td 2 :{{ xml.list(page.xml, "//td[(contains(@id, 'some'))]/descendant-or-self::text()[normalize-space(.)]") }}


    Viewed : 74

    Now return attrib values: (work in progress)

    [ "somefield", "somefield2" ]

     

    Now we want to select: 

    -all attribute values from the a's in a td

    -all text values from all none a text

    Data:

    Jan

    de tekst www.yahoo.com
    Piet

    Sinterklaas

    De querys:

    [ "de tekst www.yahoo.com" ]

    [ "/http://www.yahoo.com/Een_blanco_spatie" ]

    De weergave van de queries

    {{ xml.list(page.xml, "//div[@id='test']/a") }}
    {{ xml.list(page.xml, "//div[@id='test']/a/@href") }}
    

     De ontkennende queries

    [ "\n", "Jan", "Sinterklaas" ]

    [ "Jan", "\nPiet\n", "Sinterklaas" ]

    {{ xml.text(page.xml, "//div[@id='test']/[not(a)]", _, true) }}
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by