X7ROOT File Manager
Current Path:
/opt/alt/ruby18/lib64/ruby/1.8/rexml
opt
/
alt
/
ruby18
/
lib64
/
ruby
/
1.8
/
rexml
/
??
..
??
attlistdecl.rb
(1.79 KB)
??
attribute.rb
(5.02 KB)
??
cdata.rb
(1.44 KB)
??
child.rb
(2.46 KB)
??
comment.rb
(2 KB)
??
doctype.rb
(6.64 KB)
??
document.rb
(7.93 KB)
??
dtd
??
element.rb
(43.24 KB)
??
encoding.rb
(2.08 KB)
??
encodings
??
entity.rb
(4.85 KB)
??
formatters
??
functions.rb
(10.8 KB)
??
instruction.rb
(1.9 KB)
??
light
??
namespace.rb
(1018 B)
??
node.rb
(1.93 KB)
??
output.rb
(385 B)
??
parent.rb
(4.4 KB)
??
parseexception.rb
(1.2 KB)
??
parsers
??
quickpath.rb
(7.65 KB)
??
rexml.rb
(1.71 KB)
??
sax2listener.rb
(3.45 KB)
??
source.rb
(7.06 KB)
??
streamlistener.rb
(3.71 KB)
??
syncenumerator.rb
(721 B)
??
text.rb
(11.15 KB)
??
undefinednamespaceexception.rb
(210 B)
??
validation
??
xmldecl.rb
(2.65 KB)
??
xmltokens.rb
(506 B)
??
xpath.rb
(2.39 KB)
??
xpath_parser.rb
(25.15 KB)
Editing: attlistdecl.rb
#vim:ts=2 sw=2 noexpandtab: require 'rexml/child' require 'rexml/source' module REXML # This class needs: # * Documentation # * Work! Not all types of attlists are intelligently parsed, so we just # spew back out what we get in. This works, but it would be better if # we formatted the output ourselves. # # AttlistDecls provide *just* enough support to allow namespace # declarations. If you need some sort of generalized support, or have an # interesting idea about how to map the hideous, terrible design of DTD # AttlistDecls onto an intuitive Ruby interface, let me know. I'm desperate # for anything to make DTDs more palateable. class AttlistDecl < Child include Enumerable # What is this? Got me. attr_reader :element_name # Create an AttlistDecl, pulling the information from a Source. Notice # that this isn't very convenient; to create an AttlistDecl, you basically # have to format it yourself, and then have the initializer parse it. # Sorry, but for the forseeable future, DTD support in REXML is pretty # weak on convenience. Have I mentioned how much I hate DTDs? def initialize(source) super() if (source.kind_of? Array) @element_name, @pairs, @contents = *source end end # Access the attlist attribute/value pairs. # value = attlist_decl[ attribute_name ] def [](key) @pairs[key] end # Whether an attlist declaration includes the given attribute definition # if attlist_decl.include? "xmlns:foobar" def include?(key) @pairs.keys.include? key end # Iterate over the key/value pairs: # attlist_decl.each { |attribute_name, attribute_value| ... } def each(&block) @pairs.each(&block) end # Write out exactly what we got in. def write out, indent=-1 out << @contents end def node_type :attlistdecl end end end
Upload File
Create Folder