tags:

views:

18

answers:

1

I need to parse for the an xml style sheet

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/templates/xslt/inspections/disclaimer_en.xsl"?>

Using nokogiri I have tried using

doc.search("?xml-stylesheet").first['href']

but I get the error

`on_error': unexpected '?' after '' (Nokogiri::CSS::SyntaxError)

Is there another way I should be searching for it ? Any help would be apprecioated

A: 

Nokogiri cannot search for tags that are XML processing instructions. You may access them like this:

doc.children[0]
floatless