Sha256: 1fa612b87e364867875b140d50311fc778c0f1d6dd12d7ffff2ce690a421f6db
Contents?: true
Size: 747 Bytes
Versions: 19
Compression:
Stored size: 747 Bytes
Contents
require 'logger' module NetSuite class XmlLogger < ::Logger def format_message(severity, timestamp, progname, msg) if msg.match('<?xml') && !(msg.match('SOAPAction')) xp(msg) else "#{msg}\n" end end def xp(xml_text) xsl = <<-XSL <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> XSL doc = Nokogiri::XML(xml_text) xslt = Nokogiri::XSLT(xsl) out = xslt.transform(doc) out.to_xml end end end
Version data entries
19 entries across 19 versions & 1 rubygems