Ruby on Rails: Adding XSL Processing Instruction with to_xml

Ruby on Rails: Adding XSL Processing Instruction with to_xml

Style Sheets can be associated with an XML document by using a processing instruction whose target is xml-stylesheet. It looks something like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="something.xsl"?>

How do we get to_xml to render the XSL processing instruction? Put this in your controller:

Comments

AWS migration and transformation programs reduce cost, risk, and complexity for rapid business innovation and agility at scale. I offer a number of AWS consulting services, including an AWS migration service to quickly get you up and running. Please contact me for details on how I can help your organization.