Sha256: 62bde629dcbdadda053feb546fb450f6af6b679b5f41c9ab1d651238ce3ee71d
Contents?: true
Size: 679 Bytes
Versions: 14
Compression:
Stored size: 679 Bytes
Contents
require "json" require "nokogiri" module Sei module Printer def self.jp(json_text) puts JSON.pretty_generate json_text end def self.xp(xml_text) xsl = <<~HEREDOC <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" encoding="UTF-8" indent="yes"/> <xsl:strip-space elements="*" <xsl:template match="/"> <xsl:copy-of select="."/> </xsl:template> </xsl:stylesheet> HEREDOC doc = Nokogiri::XML(xml_text) xslt = Nokogiri::XSLT(xsl) out = xslt.transform(doc) puts out.to_xml end end end
Version data entries
14 entries across 14 versions & 3 rubygems