Xml::XmlCanonical

In Files

Methods

Generated with Razzle Dazzle Redfish.
[Validate]

This is used it identify strings that conform to canonical XML element text.

Public Instance Methods

===( str ) click to toggle source

(Not documented)

# File lib/r4x/e4x.rb, line 32
    def ===( str )
      str = str.to_s.strip
      #str[0,1] == '<' && str[-1,1] == '>'  # should make more robust (TODO)
      md = (%r{\A \< (\w+) (.*?) \>}mix).match( str )
      return false unless md #[2] =~ %r{xml:cdata=['"]\d+['"]}
      ed = (%r{\< \/ #{md[1]} [ ]* \> \Z}mix).match(str)
      return false unless ed
      true
    end

Disabled; run with --debug to generate this.