Is it possible to associate a stylesheet with with Nokogiri, to create this structure?
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="http://www.my-site.com/sitemap.xsl"?>
<root>
...
</root>
Is it possible to associate a stylesheet with with Nokogiri, to create this structure?
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="http://www.my-site.com/sitemap.xsl"?>
<root>
...
</root>
There is not.
The way I did it:
xml.gsub!("<?xml version=\"1.0\"?>") do |head|
result = head
result << "\n"
result << "<?xml-stylesheet type=\"text/xsl\" href=\"#{stylesheet}\"?>"
end
Cheers.