in reply to Re^4: language selection via libxml
in thread language selection via libxml

You need to escape the quotes as well or use single quotes around your string:

$result=$tree->findnodes('/language/$language/widget[@ID="$id"]');

Replies are listed 'Best First'.
Re^6: language selection via libxml
by tangent (Parson) on Jan 20, 2014 at 13:20 UTC
    Using your example I get:
    XPath error : Invalid expression /language/$language/widget[@ID="$id"] ^

      I had not seen the variable in between, sorry. You could do

      $result=$tree->findnodes('/language/'.$language.'/widget[@ID="$id"]');
        I added that to the test script I have below but it returned no results.