Transform XML basing on XSLT in Ruby/Nokogiri

Since1453

New Member
guys. I am trying to transform XML basing on XSLT in Ruby/Nokogiri.\[code\]doc = Nokogiri::XML(File.read('some_file.xml'))xslt = Nokogiri::XSLT(File.read('some_transformer.xslt'))puts xslt.transform(doc)\[/code\]but it fails:\[quote\] I/O warning : failed to load external entity "dateDifference.xsl" RuntimeError: compilation error: element stylesheet xsl:exclude-result-prefixes : undefined namespace exsl compilation error: element import xsl:import : unable to load dateDifference.xsl\[/quote\]probably, it is caused by using of external entities on my some_transform.xslt file:\[code\]<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:res="rate.fidelio.6.0" xmlns:inv="rtav.fidelio.4.0" xmlns:aravr="ravr.fidelio.2.0" xmlns:aravl="ravl.fidelio.2.0" xmlns:ota="http://www.opentravel.org/OTA/2003/05" xmlns:pk="http://www.passkey.com/apiSchema" xmlns="http://www.passkey.com/apiSchema" xmlns:exslt="http://exslt.org/common" xmlns:date="http://exslt.org/dates-and-times" exclude-result-prefixes="pk res inv aravr aravl date exsl"> <xsl:import href="http://stackoverflow.com/questions/12299381/dateDifference.xsl" /> ... </xsl:stylesheet>\[/code\]Is there any way to fix it?
 
Back
Top