You are on page 1of 4

Task name

Attribute selection
Conditional element selection
Merging character strings
Filtering by attribute value
Filtering by numeric values
Limiting number
Filtering by character conditions
Filtering by text length
Rounding up and down and adding
Selecting the following siblings
Selecting following siblings with filtering
Attribute selection with namespaces
Selecting all links of a document
Selecting all links to Google within a document
Selecting elements by name
Selecting elements by name with namespaces
Counting elements selected by certain criteria
Content of a parent element
Finding surrounding element
First and last element
Changing character string
Counting nodes with condition
Comparisons in conditions
Selecting all links which open a new window
Calculating position
Changing small to capital letters
Selecting querystring
Elements with mixed text
Filtering by key and numerical value
Totalling by key and numerical value
Selecting subelements by number
Selecting elements by namespace
Change XML document into CSV output

Solution
document/attribute::name
//linkList[@name='A']/document
concat(concat(/person/lastName/text(),', '),/person/firstName/text())
//job[@priority='critical' or @priority='high']
concat('"',/person/firstName/text(),'")
/persons/person[position()<4]
/persons//*[starts-with(@firstName,'H')]
/persons//*[string-length(@firstName)<6]
sum(//number[round(text())=34])
/products/product[@id=3]/following-sibling::*[self::product]
/products/product[@id=3]/following-sibling::*[self::product and @category=1]
//@* [namespace-uri()='http://www.w3.org/1999/xlink']
document/content//*[local-name()='a' and namespace-uri()='http://www.w3.org/1999/xhtml']
//*[local-name()='a' and namespace-uri()='http://www.w3.org/1999/xhtml' and contains(@href,'goo
//*[starts-with(local-name() ,'item')]
//*[starts-with(local-name() ,'item') and namespace-uri()='http://example.org']
concat('In der Sammlung gibt es ',count(//*[local-name()='cds' and parent::artist]/cd),' Alben von S
//cd[text()='Rudebox']/../../name/text()
ancestor::*//x:div/x:div/@id
//artist[last()]/descendant::cd[1]
concat(substring(/hooey/text(),1,2),'ML',substring(/hooey/text(),5))
count(/jobs/job[@priority='low'])
//job[sum(child::work/@usedBudget)>@availableBudget]
//*[@target='_new' and namespace-uri()='http://www.w3.org/1999/xhtml']
count(//title[text()="Swing when you're winning"]/preceding-sibling::title)+1
translate(/text/text(),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')
substring-after(/link/text(),'?')
//item[contains(@width,'px') and substring-before(@width,'px')<70]
/items/item[@width<70 and @unit='px']
sum(/items/item[@width<70 and @unit='px']/attribute::width)
//*[(self::band or self::artist) and count(descendant::cd)=1]
//* [starts-with(namespace-uri(),'http://www.getit.de/')]
concat(//cell[position()=1]/text(),';"',//cell[position()=2],'";"',//cell[position()=3]/text(),'";',//cell[posit

//content/descendant::x:a

ef,'google')]

n von Soloknstlern und ',count(//*[local-name()='cds' and parent::band]/cd),' Alben von Bands.')

ll[position()=4]/text(),'')

and parent::band]/cd),' Alben von Bands.')

You might also like