Class: REXML::Element

Inherits:
Object
  • Object
show all
Defined in:
lib/wss4r/security/util/xmlcanonicalizer.rb,
lib/wss4r/security/util/xmlutils.rb

Instance Method Summary collapse

Instance Method Details

#index_of(e) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/wss4r/security/util/xmlutils.rb', line 6

def index_of(e)
	return -1 if (e == nil)
	children = self.children()
	children.each_with_index {|child, i|
		return i if (child.local_name() == e.local_name())
	}
	return -1
end

#node_namespacesObject



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/wss4r/security/util/xmlcanonicalizer.rb', line 59

def node_namespaces()
  ns = Array.new()
  ns.push(self.prefix())
  self.attributes().each_attribute{|a|
    if (a.prefix() != nil)
      ns.push(a.prefix())
    end
    if (a.prefix() == "" && a.local_name() == "xmlns")
      ns.push("xmlns")
    end
  }
  ns
end

#rendered=(rendered) ⇒ Object



53
54
55
# File 'lib/wss4r/security/util/xmlcanonicalizer.rb', line 53

def rendered=(rendered)
	@rendered = rendered
end

#rendered?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/wss4r/security/util/xmlcanonicalizer.rb', line 56

def rendered?()
	return @rendered
end

#search_namespace(prefix) ⇒ Object



46
47
48
49
50
51
52
# File 'lib/wss4r/security/util/xmlcanonicalizer.rb', line 46

def search_namespace(prefix)
  if (self.namespace(prefix) == nil)
    return (self.parent().search_namespace(prefix)) if (self.parent() != nil)
  else
    return self.namespace(prefix)
  end
end