PageRenderTime 54ms CodeModel.GetById 51ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/Ruby/lib/ruby/1.8/rexml/xmltokens.rb

http://github.com/agross/netopenspace
Ruby | 18 lines | 11 code | 2 blank | 5 comment | 0 complexity | e969c97fad4230c5309eae4fcc5bce65 MD5 | raw file
 1module REXML
 2	# Defines a number of tokens used for parsing XML.  Not for general
 3	# consumption.
 4	module XMLTokens
 5		NCNAME_STR= '[\w:][\-\w\d.]*'
 6		NAME_STR= "(?:#{NCNAME_STR}:)?#{NCNAME_STR}"
 7
 8		NAMECHAR = '[\-\w\d\.:]'
 9		NAME = "([\\w:]#{NAMECHAR}*)"
10		NMTOKEN = "(?:#{NAMECHAR})+"
11		NMTOKENS = "#{NMTOKEN}(\\s+#{NMTOKEN})*"
12		REFERENCE = "(?:&#{NAME};|&#\\d+;|&#x[0-9a-fA-F]+;)"
13
14		#REFERENCE = "(?:#{ENTITYREF}|#{CHARREF})"
15		#ENTITYREF = "&#{NAME};"
16		#CHARREF = "&#\\d+;|&#x[0-9a-fA-F]+;"
17	end
18end