From e9adbbd34519559714d7bea6fa0fa5726a85c827 Mon Sep 17 00:00:00 2001 From: Alinson Santos Date: Sun, 2 Mar 2008 20:11:56 -0300 Subject: [PATCH] Gem: hpricot --- vendor/gems/hpricot-0.6/CHANGELOG | 62 + vendor/gems/hpricot-0.6/COPYING | 18 + vendor/gems/hpricot-0.6/README | 284 + vendor/gems/hpricot-0.6/Rakefile | 211 + .../ext/hpricot_scan/HpricotScanService.java | 1340 ++++ .../hpricot-0.6/ext/hpricot_scan/extconf.rb | 6 + .../ext/hpricot_scan/hpricot_common.rl | 76 + .../ext/hpricot_scan/hpricot_scan.c | 5976 +++++++++++++++++ .../ext/hpricot_scan/hpricot_scan.h | 79 + .../ext/hpricot_scan/hpricot_scan.java.rl | 363 + .../ext/hpricot_scan/hpricot_scan.rl | 273 + .../gems/hpricot-0.6/extras/mingw-rbconfig.rb | 176 + vendor/gems/hpricot-0.6/init.rb | 3 + vendor/gems/hpricot-0.6/lib/hpricot.rb | 26 + .../hpricot-0.6/lib/hpricot/blankslate.rb | 63 + .../gems/hpricot-0.6/lib/hpricot/builder.rb | 200 + .../gems/hpricot-0.6/lib/hpricot/elements.rb | 510 ++ .../gems/hpricot-0.6/lib/hpricot/htmlinfo.rb | 672 ++ .../gems/hpricot-0.6/lib/hpricot/inspect.rb | 107 + .../gems/hpricot-0.6/lib/hpricot/modules.rb | 37 + vendor/gems/hpricot-0.6/lib/hpricot/parse.rb | 297 + vendor/gems/hpricot-0.6/lib/hpricot/tag.rb | 228 + vendor/gems/hpricot-0.6/lib/hpricot/tags.rb | 164 + .../gems/hpricot-0.6/lib/hpricot/traverse.rb | 821 +++ vendor/gems/hpricot-0.6/lib/hpricot/xchar.rb | 94 + .../gems/hpricot-0.6/test/files/basic.xhtml | 17 + .../hpricot-0.6/test/files/boingboing.html | 2266 +++++++ vendor/gems/hpricot-0.6/test/files/cy0.html | 3653 ++++++++++ vendor/gems/hpricot-0.6/test/files/immob.html | 400 ++ .../test/files/pace_application.html | 1320 ++++ .../hpricot-0.6/test/files/tenderlove.html | 16 + .../gems/hpricot-0.6/test/files/uswebgen.html | 220 + vendor/gems/hpricot-0.6/test/files/utf8.html | 1054 +++ vendor/gems/hpricot-0.6/test/files/week9.html | 1723 +++++ vendor/gems/hpricot-0.6/test/files/why.xml | 19 + vendor/gems/hpricot-0.6/test/load_files.rb | 7 + vendor/gems/hpricot-0.6/test/test_alter.rb | 65 + vendor/gems/hpricot-0.6/test/test_builder.rb | 24 + vendor/gems/hpricot-0.6/test/test_parser.rb | 379 ++ vendor/gems/hpricot-0.6/test/test_paths.rb | 16 + .../gems/hpricot-0.6/test/test_preserved.rb | 66 + vendor/gems/hpricot-0.6/test/test_xml.rb | 28 + 42 files changed, 23359 insertions(+) create mode 100644 vendor/gems/hpricot-0.6/CHANGELOG create mode 100644 vendor/gems/hpricot-0.6/COPYING create mode 100644 vendor/gems/hpricot-0.6/README create mode 100644 vendor/gems/hpricot-0.6/Rakefile create mode 100644 vendor/gems/hpricot-0.6/ext/hpricot_scan/HpricotScanService.java create mode 100644 vendor/gems/hpricot-0.6/ext/hpricot_scan/extconf.rb create mode 100644 vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_common.rl create mode 100644 vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.c create mode 100644 vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.h create mode 100644 vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.java.rl create mode 100644 vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.rl create mode 100644 vendor/gems/hpricot-0.6/extras/mingw-rbconfig.rb create mode 100644 vendor/gems/hpricot-0.6/init.rb create mode 100644 vendor/gems/hpricot-0.6/lib/hpricot.rb create mode 100644 vendor/gems/hpricot-0.6/lib/hpricot/blankslate.rb create mode 100644 vendor/gems/hpricot-0.6/lib/hpricot/builder.rb create mode 100644 vendor/gems/hpricot-0.6/lib/hpricot/elements.rb create mode 100644 vendor/gems/hpricot-0.6/lib/hpricot/htmlinfo.rb create mode 100644 vendor/gems/hpricot-0.6/lib/hpricot/inspect.rb create mode 100644 vendor/gems/hpricot-0.6/lib/hpricot/modules.rb create mode 100644 vendor/gems/hpricot-0.6/lib/hpricot/parse.rb create mode 100644 vendor/gems/hpricot-0.6/lib/hpricot/tag.rb create mode 100644 vendor/gems/hpricot-0.6/lib/hpricot/tags.rb create mode 100644 vendor/gems/hpricot-0.6/lib/hpricot/traverse.rb create mode 100644 vendor/gems/hpricot-0.6/lib/hpricot/xchar.rb create mode 100644 vendor/gems/hpricot-0.6/test/files/basic.xhtml create mode 100644 vendor/gems/hpricot-0.6/test/files/boingboing.html create mode 100644 vendor/gems/hpricot-0.6/test/files/cy0.html create mode 100644 vendor/gems/hpricot-0.6/test/files/immob.html create mode 100644 vendor/gems/hpricot-0.6/test/files/pace_application.html create mode 100644 vendor/gems/hpricot-0.6/test/files/tenderlove.html create mode 100644 vendor/gems/hpricot-0.6/test/files/uswebgen.html create mode 100644 vendor/gems/hpricot-0.6/test/files/utf8.html create mode 100644 vendor/gems/hpricot-0.6/test/files/week9.html create mode 100644 vendor/gems/hpricot-0.6/test/files/why.xml create mode 100644 vendor/gems/hpricot-0.6/test/load_files.rb create mode 100644 vendor/gems/hpricot-0.6/test/test_alter.rb create mode 100644 vendor/gems/hpricot-0.6/test/test_builder.rb create mode 100644 vendor/gems/hpricot-0.6/test/test_parser.rb create mode 100644 vendor/gems/hpricot-0.6/test/test_paths.rb create mode 100644 vendor/gems/hpricot-0.6/test/test_preserved.rb create mode 100644 vendor/gems/hpricot-0.6/test/test_xml.rb diff --git a/vendor/gems/hpricot-0.6/CHANGELOG b/vendor/gems/hpricot-0.6/CHANGELOG new file mode 100644 index 0000000..2c7051b --- /dev/null +++ b/vendor/gems/hpricot-0.6/CHANGELOG @@ -0,0 +1,62 @@ += 0.6 +=== 15th June, 2007 +* Hpricot for JRuby -- nice work Ola Bini! +* Inline Markaby for Hpricot documents. +* XML tags and attributes are no longer downcased like HTML is. +* new syntax for grabbing everything between two elements using a Range in the search method: (doc/("font".."font/br")) or in nodes_at like so: (doc/"font").nodes_at("*".."br"). Only works with either a pair of siblings or a set of a parent and a sibling. +* Ignore self-closing endings on tags (such as form) which are containers. Treat them like open parent tags. Reported by Jonathan Nichols on the hpricot list. +* Escaping of attributes, yanked from Jim Weirich and Sam Ruby's work in Builder. +* Element#raw_attributes gives unescaped data. Element#attributes gives escaped. +* Added: Elements#attr, Elements#remove_attr, Elements#remove_class. +* Added: Traverse#preceding, Traverse#following, Traverse#previous, Traverse#next. + += 0.5 +=== 31rd January, 2007 + +* support for a[text()="Click Me!"] and h3[text()*="space"] and the like. +* Hpricot.buffer_size accessor for increasing Hpricot's buffer if you're encountering huge ASP.NET viewstate attribs. +* some support for colons in tag names (not full namespace support yet.) +* Element.to_original_html will attempt to preserve the original HTML while merging your changes. +* Element.to_plain_text converts an element's contents to a simple text format. +* Element.inner_text removes all tags and returns text nodes concatenated into a single string. +* no @raw_string variable kept for comments, text, and cdata -- as it's redundant. +* xpath-style indices (//p/a[1]) but keep in mind that they aren't zero-based. +* node_position is the index among all sibling nodes, while position is the position among children of identical type. +* comment() and text() search criteria, like: //p/text(), which selects all text inside paragraph tags. +* every element has css_path and xpath methods which return respective absolute paths. +* more flexibility all around: in parsing attributes, tags, comments and cdata. + += 0.4 +=== 11th August, 2006 + +* The :fixup_tags option will try to sort out the hierarchy so elements end up with the right parents. +* Elements such as *script* and *style* (identified as having CDATA contents) receive a single text node as their children now. Previously, Hpricot was parsing out tags found in scripts. +* Better scanning of partially quoted attributes (found by Brent Beardsly on http://uswebgen.com/) +* Better scanning of unquoted attributes -- thanks to Aaron Patterson for the test cases! +* Some tags were being output in the empty tag style, although browsers hated that. FIXED! +* Added Elements#at for finding single elements. +* Added Elem::Trav#[] and Elem::Trav#[]= for reading and writing attributes. + += 0.3 +=== 7th July, 2006 + +* Fixed negative string size error on empty tokens. (news.bbc.co.uk) +* Allow the parser to accept just text nodes. (such as: Hpricot.parse('TEXT')) +* from JQuery to Hpricot::Elements: remove, empty, append, prepend, before, after, wrap, set, + html(...), to_html, to_s. +* on containers: to_html, replace_child, insert_before, insert_after, innerHTML=. +* Hpricot(...) is an alias for parse. +* open up all properties to setters, let people do as they may. +* use to_html for the full html of a node or set of elements. +* doctypes were messed. + += 0.2 +=== 4th July, 2006 + +* Rewrote the HTree parser to be simpler, more adequate for the common man. Will add encoding back in later. + += 0.1 +=== 3rd July, 2006 + +* For whatever reason, wrote this HTML parser in C. + I guess Ragel is addictive and I want to improve HTree. diff --git a/vendor/gems/hpricot-0.6/COPYING b/vendor/gems/hpricot-0.6/COPYING new file mode 100644 index 0000000..94b6b84 --- /dev/null +++ b/vendor/gems/hpricot-0.6/COPYING @@ -0,0 +1,18 @@ +Copyright (c) 2006 why the lucky stiff + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/gems/hpricot-0.6/README b/vendor/gems/hpricot-0.6/README new file mode 100644 index 0000000..6443214 --- /dev/null +++ b/vendor/gems/hpricot-0.6/README @@ -0,0 +1,284 @@ += Hpricot, Read Any HTML + +Hpricot is a fast, flexible HTML parser written in C. It's designed to be very +accommodating (like Tanaka Akira's HTree) and to have a very helpful library +(like some JavaScript libs -- JQuery, Prototype -- give you.) The XPath and CSS +parser, in fact, is based on John Resig's JQuery. + +Also, Hpricot can be handy for reading broken XML files, since many of the same +techniques can be used. If a quote is missing, Hpricot tries to figure it out. +If tags overlap, Hpricot works on sorting them out. You know, that sort of +thing. + +*Please read this entire document* before making assumptions about how this +software works. + +== An Overview + +Let's clear up what Hpricot is. + +# Hpricot is *a standalone library*. It requires no other libraries. Just Ruby! +# While priding itself on speed, Hpricot *works hard to sort out bad HTML* and + pays a small penalty in order to get that right. So that's slightly more important + to me than speed. +# *If you can see it in Firefox, then Hpricot should parse it.* That's + how it should be! Let me know the minute it's otherwise. +# Primarily, Hpricot is used for reading HTML and tries to sort out troubled + HTML by having some idea of what good HTML is. Some people still like to use + Hpricot for XML reading, but *remember to use the Hpricot::XML() method* for that! + +== The Hpricot Kingdom + +First, here are all the links you need to know: + +* http://code.whytheluckystiff.net/hpricot is the Hpricot wiki and bug tracker. + Go there for news and recipes and patches. It's the center of activity. +* http://code.whytheluckystiff.net/svn/hpricot/trunk is the main Subversion + repository for Hpricot. You can get the latest code there. +* http://code.whytheluckystiff.net/doc/hpricot is the home for the latest copy of + this reference. +* See COPYING for the terms of this software. (Spoiler: it's absolutely free.) + +If you have any trouble, don't hesitate to contact the author. As always, I'm +not going to say "Use at your own risk" because I don't want this library to be +risky. If you trip on something, I'll share the liability by repairing things +as quickly as I can. Your responsibility is to report the inadequacies. + +== Installing Hpricot + +You may get the latest stable version from Rubyforge. Win32 binaries and source +gems are available. + + $ gem install hpricot + +As Hpricot is still under active development, you can also try the most recent +candidate build here: + + $ gem install hpricot --source http://code.whytheluckystiff.net + +The development gem is usually in pretty good shape actually. You can also +get the bleeding edge code or plain Ruby tarballs on the wiki. + +== An Hpricot Showcase + +We're going to run through a big pile of examples to get you jump-started. +Many of these examples are also found at +http://code.whytheluckystiff.net/hpricot/wiki/HpricotBasics, in case you +want to add some of your own. + +=== Loading Hpricot Itself + +You have probably got the gem, right? To load Hpricot: + + require 'rubygems' + require 'hpricot' + +If you've installed the plain source distribution, go ahead and just: + + require 'hpricot' + +=== Load an HTML Page + +The Hpricot() method takes a string or any IO object and loads the +contents into a document object. + + doc = Hpricot("

A simple test string.

") + +To load from a file, just get the stream open: + + doc = open("index.html") { |f| Hpricot(f) } + +To load from a web URL, use open-uri, which comes with Ruby: + + require 'open-uri' + doc = open("http://qwantz.com/") { |f| Hpricot(f) } + +Hpricot uses an internal buffer to parse the file, so the IO will stream +properly and large documents won't be loaded into memory all at once. However, +the parsed document object will be present in memory, in its entirety. + +=== Search for Elements + +Use Doc.search: + + doc.search("//p[@class='posted']") + #=> # + +Doc.search can take an XPath or CSS expression. In the above example, +all paragraph

elements are grabbed which have a class +attribute of "posted". + +A shortcut is to use the divisor: + + (doc/"p.posted") + #=> # + +=== Finding Just One Element + +If you're looking for a single element, the at method will return the +first element matched by the expression. In this case, you'll get back the +element itself rather than the Hpricot::Elements array. + + doc.at("body")['onload'] + +The above code will find the body tag and give you back the onload +attribute. This is the most common reason to use the element directly: when +reading and writing HTML attributes. + +=== Fetching the Contents of an Element + +Just as with browser scripting, the inner_html property can be used to +get the inner contents of an element. + + (doc/"#elementID").inner_html + #=> "..contents.." + +If your expression matches more than one element, you'll get back the contents +of ''all the matched elements''. So you may want to use first to be +sure you get back only one. + + (doc/"#elementID").first.inner_html + #=> "..contents.." + +=== Fetching the HTML for an Element + +If you want the HTML for the whole element (not just the contents), use +to_html: + + (doc/"#elementID").to_html + #=> "

...
" + +=== Looping + +All searches return a set of Hpricot::Elements. Go ahead and loop +through them like you would an array. + + (doc/"p/a/img").each do |img| + puts img.attributes['class'] + end + +=== Continuing Searches + +Searches can be continued from a collection of elements, in order to search deeper. + + # find all paragraphs. + elements = doc.search("/html/body//p") + # continue the search by finding any images within those paragraphs. + (elements/"img") + #=> # + +Searches can also be continued by searching within container elements. + + # find all images within paragraphs. + doc.search("/html/body//p").each do |para| + puts "== Found a paragraph ==" + pp para + + imgs = para.search("img") + if imgs.any? + puts "== Found #{imgs.length} images inside ==" + end + end + +Of course, the most succinct ways to do the above are using CSS or XPath. + + # the xpath version + (doc/"/html/body//p//img") + # the css version + (doc/"html > body > p img") + # ..or symbols work, too! + (doc/:html/:body/:p/:img) + +=== Looping Edits + +You may certainly edit objects from within your search loops. Then, when you +spit out the HTML, the altered elements will show. + + (doc/"span.entryPermalink").each do |span| + span.attributes['class'] = 'newLinks' + end + puts doc + +This changes all span.entryPermalink elements to +span.newLinks. Keep in mind that there are often more convenient ways +of doing this. Such as the set method: + + (doc/"span.entryPermalink").set(:class => 'newLinks') + +=== Figuring Out Paths + +Every element can tell you its unique path (either XPath or CSS) to get to the +element from the root tag. + +The css_path method: + + doc.at("div > div:nth(1)").css_path + #=> "div > div:nth(1)" + doc.at("#header").css_path + #=> "#header" + +Or, the xpath method: + + doc.at("div > div:nth(1)").xpath + #=> "/div/div:eq(1)" + doc.at("#header").xpath + #=> "//div[@id='header']" + +== Hpricot Fixups + +When loading HTML documents, you have a few settings that can make Hpricot more +or less intense about how it gets involved. + +== :fixup_tags + +Really, there are so many ways to clean up HTML and your intentions may be to +keep the HTML as-is. So Hpricot's default behavior is to keep things flexible. +Making sure to open and close all the tags, but ignore any validation problems. + +As of Hpricot 0.4, there's a new :fixup_tags option which will attempt +to shift the document's tags to meet XHTML 1.0 Strict. + + doc = open("index.html") { |f| Hpricot f, :fixup_tags => true } + +This doesn't quite meet the XHTML 1.0 Strict standard, it just tries to follow +the rules a bit better. Like: say Hpricot finds a paragraph in a link, it's +going to move the paragraph below the link. Or up and out of other elements +where paragraphs don't belong. + +If an unknown element is found, it is ignored. Again, :fixup_tags. + +== :xhtml_strict + +So, let's go beyond just trying to fix the hierarchy. The +:xhtml_strict option really tries to force the document to be an XHTML +1.0 Strict document. Even at the cost of removing elements that get in the way. + + doc = open("index.html") { |f| Hpricot f, :xhtml_strict => true } + +What measures does :xhtml_strict take? + + 1. Shift elements into their proper containers just like :fixup_tags. + 2. Remove unknown elements. + 3. Remove unknown attributes. + 4. Remove illegal content. + 5. Alter the doctype to XHTML 1.0 Strict. + +== Hpricot.XML() + +The last option is the :xml option, which makes some slight variations +on the standard mode. The main difference is that :xml mode won't try to output +tags which are friendlier for browsers. For example, if an opening and closing +br tag is found, XML mode won't try to turn that into an empty element. + +XML mode also doesn't downcase the tags and attributes for you. So pay attention +to case, friends. + +The primary way to use Hpricot's XML mode is to call the Hpricot.XML method: + + doc = open("http://redhanded.hobix.com/index.xml") do |f| + Hpricot.XML(f) + end + +*Also, :fixup_tags is canceled out by the :xml option.* This is because +:fixup_tags makes assumptions based how HTML is structured. Specifically, how +tags are defined in the XHTML 1.0 DTD. diff --git a/vendor/gems/hpricot-0.6/Rakefile b/vendor/gems/hpricot-0.6/Rakefile new file mode 100644 index 0000000..9c6cb43 --- /dev/null +++ b/vendor/gems/hpricot-0.6/Rakefile @@ -0,0 +1,211 @@ +require 'rake' +require 'rake/clean' +require 'rake/gempackagetask' +require 'rake/rdoctask' +require 'rake/testtask' +require 'fileutils' +include FileUtils + +NAME = "hpricot" +REV = `svn info`[/Revision: (\d+)/, 1] rescue nil +VERS = ENV['VERSION'] || "0.6" + (REV ? ".#{REV}" : "") +PKG = "#{NAME}-#{VERS}" +BIN = "*.{bundle,jar,so,obj,pdb,lib,def,exp}" +ARCHLIB = "lib/#{::Config::CONFIG['arch']}" +CLEAN.include ["ext/hpricot_scan/#{BIN}", "lib/**/#{BIN}", 'ext/hpricot_scan/Makefile', + '**/.*.sw?', '*.gem', '.config'] +RDOC_OPTS = ['--quiet', '--title', 'The Hpricot Reference', '--main', 'README', '--inline-source'] +PKG_FILES = %w(CHANGELOG COPYING README Rakefile) + + Dir.glob("{bin,doc,test,lib,extras}/**/*") + + Dir.glob("ext/**/*.{h,java,c,rb,rl}") + + %w[ext/hpricot_scan/hpricot_scan.c] # needed because it's generated later +SPEC = + Gem::Specification.new do |s| + s.name = NAME + s.version = VERS + s.platform = Gem::Platform::RUBY + s.has_rdoc = true + s.rdoc_options += RDOC_OPTS + s.extra_rdoc_files = ["README", "CHANGELOG", "COPYING"] + s.summary = "a swift, liberal HTML parser with a fantastic library" + s.description = s.summary + s.author = "why the lucky stiff" + s.email = 'why@ruby-lang.org' + s.homepage = 'http://code.whytheluckystiff.net/hpricot/' + s.files = PKG_FILES + s.require_paths = [ARCHLIB, "lib"] + s.extensions = FileList["ext/**/extconf.rb"].to_a + s.bindir = "bin" + end + +desc "Does a full compile, test run" +task :default => [:compile, :test] + +desc "Packages up Hpricot." +task :package => [:clean, :ragel] + +desc "Releases packages for all Hpricot packages and platforms." +task :release => [:package, :package_win32, :package_jruby] + +desc "Run all the tests" +Rake::TestTask.new do |t| + t.libs << "test" << ARCHLIB + t.test_files = FileList['test/test_*.rb'] + t.verbose = true +end + +Rake::RDocTask.new do |rdoc| + rdoc.rdoc_dir = 'doc/rdoc' + rdoc.options += RDOC_OPTS + rdoc.main = "README" + rdoc.rdoc_files.add ['README', 'CHANGELOG', 'COPYING', 'lib/**/*.rb'] +end + +Rake::GemPackageTask.new(SPEC) do |p| + p.need_tar = true + p.gem_spec = SPEC +end + +extension = "hpricot_scan" +ext = "ext/hpricot_scan" +ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}" +ext_files = FileList[ + "#{ext}/*.c", + "#{ext}/*.h", + "#{ext}/*.rl", + "#{ext}/extconf.rb", + "#{ext}/Makefile", + "lib" +] + +task "lib" do + directory "lib" +end + +desc "Compiles the Ruby extension" +task :compile => [:hpricot_scan] do + if Dir.glob(File.join(ARCHLIB,"hpricot_scan.*")).length == 0 + STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + STDERR.puts "Gem actually failed to build. Your system is" + STDERR.puts "NOT configured properly to build hpricot." + STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit(1) + end +end +task :hpricot_scan => [:ragel] + +desc "Builds just the #{extension} extension" +task extension.to_sym => ["#{ext}/Makefile", ext_so ] + +file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do + Dir.chdir(ext) do ruby "extconf.rb" end +end + +file ext_so => ext_files do + Dir.chdir(ext) do + sh(PLATFORM =~ /win32/ ? 'nmake' : 'make') + end + mkdir_p ARCHLIB + cp ext_so, ARCHLIB +end + +desc "returns the ragel version" +task :ragel_version do + @ragel_v = `ragel -v`[/(version )(\S*)/,2].to_f +end + +desc "Generates the C scanner code with Ragel." +task :ragel => [:ragel_version] do + sh %{ragel ext/hpricot_scan/hpricot_scan.rl | #{@ragel_v >= 5.18 ? 'rlgen-cd' : 'rlcodegen'} -G2 -o ext/hpricot_scan/hpricot_scan.c} +end + +desc "Generates the Java scanner code with Ragel." +task :ragel_java => [:ragel_version] do + sh %{ragel -J ext/hpricot_scan/hpricot_scan.java.rl | #{@ragel_v >= 5.18 ? 'rlgen-java' : 'rlcodegen'} -o ext/hpricot_scan/HpricotScanService.java} +end + +### Win32 Packages ### + +Win32Spec = SPEC.dup +Win32Spec.platform = Gem::Platform::WIN32 +Win32Spec.files = PKG_FILES + ["#{ARCHLIB}/hpricot_scan.so"] +Win32Spec.extensions = [] + +WIN32_PKG_DIR = "#{PKG}-mswin32" + +desc "Package up the Win32 distribution." +file WIN32_PKG_DIR => [:package] do + sh "tar zxf pkg/#{PKG}.tgz" + mv PKG, WIN32_PKG_DIR +end + +desc "Cross-compile the hpricot_scan extension for win32" +file "hpricot_scan_win32" => [WIN32_PKG_DIR] do + cp "extras/mingw-rbconfig.rb", "#{WIN32_PKG_DIR}/ext/hpricot_scan/rbconfig.rb" + sh "cd #{WIN32_PKG_DIR}/ext/hpricot_scan/ && ruby -I. extconf.rb && make" + mv "#{WIN32_PKG_DIR}/ext/hpricot_scan/hpricot_scan.so", "#{WIN32_PKG_DIR}/#{ARCHLIB}" +end + +desc "Build the binary RubyGems package for win32" +task :package_win32 => ["hpricot_scan_win32"] do + Dir.chdir("#{WIN32_PKG_DIR}") do + Gem::Builder.new(Win32Spec).build + verbose(true) { + mv Dir["*.gem"].first, "../pkg/#{WIN32_PKG_DIR}.gem" + } + end +end + +CLEAN.include WIN32_PKG_DIR + +### JRuby Packages ### + +compile_java = proc do + sh %{javac -source 1.4 -target 1.4 -classpath $JRUBY_HOME/lib/jruby.jar HpricotScanService.java} + sh %{jar cf hpricot_scan.jar HpricotScanService.class} +end + +desc "Compiles the JRuby extension" +task :hpricot_scan_java => [:ragel_java] do + Dir.chdir("ext/hpricot_scan", &compile_java) +end + +JRubySpec = SPEC.dup +JRubySpec.platform = 'jruby' +JRubySpec.files = PKG_FILES + ["#{ARCHLIB}/hpricot_scan.jar"] +JRubySpec.extensions = [] + +JRUBY_PKG_DIR = "#{PKG}-jruby" + +desc "Package up the JRuby distribution." +file JRUBY_PKG_DIR => [:ragel_java, :package] do + sh "tar zxf pkg/#{PKG}.tgz" + mv PKG, JRUBY_PKG_DIR +end + +desc "Cross-compile the hpricot_scan extension for JRuby" +file "hpricot_scan_jruby" => [JRUBY_PKG_DIR] do + Dir.chdir("#{JRUBY_PKG_DIR}/ext/hpricot_scan", &compile_java) + mv "#{JRUBY_PKG_DIR}/ext/hpricot_scan/hpricot_scan.jar", "#{JRUBY_PKG_DIR}/#{ARCHLIB}" +end + +desc "Build the RubyGems package for JRuby" +task :package_jruby => ["hpricot_scan_jruby"] do + Dir.chdir("#{JRUBY_PKG_DIR}") do + Gem::Builder.new(JRubySpec).build + verbose(true) { + mv Dir["*.gem"].first, "../pkg/#{JRUBY_PKG_DIR}.gem" + } + end +end + +CLEAN.include JRUBY_PKG_DIR + +task :install do + sh %{rake package} + sh %{sudo gem install pkg/#{NAME}-#{VERS}} +end + +task :uninstall => [:clean] do + sh %{sudo gem uninstall #{NAME}} +end diff --git a/vendor/gems/hpricot-0.6/ext/hpricot_scan/HpricotScanService.java b/vendor/gems/hpricot-0.6/ext/hpricot_scan/HpricotScanService.java new file mode 100644 index 0000000..efbc941 --- /dev/null +++ b/vendor/gems/hpricot-0.6/ext/hpricot_scan/HpricotScanService.java @@ -0,0 +1,1340 @@ + +import java.io.IOException; + +import org.jruby.Ruby; +import org.jruby.RubyClass; +import org.jruby.RubyHash; +import org.jruby.RubyModule; +import org.jruby.RubyNumeric; +import org.jruby.RubyString; +import org.jruby.runtime.Block; +import org.jruby.runtime.CallbackFactory; +import org.jruby.runtime.builtin.IRubyObject; +import org.jruby.exceptions.RaiseException; +import org.jruby.runtime.load.BasicLibraryService; + +public class HpricotScanService implements BasicLibraryService { + public static String NO_WAY_SERIOUSLY="*** This should not happen, please send a bug report with the HTML you're parsing to why@whytheluckystiff.net. So sorry!"; + + public void ELE(IRubyObject N) { + if (tokend > tokstart || text) { + IRubyObject raw_string = runtime.getNil(); + ele_open = false; text = false; + if (tokstart != -1 && N != cdata && N != sym_text && N != procins && N != comment) { + raw_string = runtime.newString(new String(buf,tokstart,tokend-tokstart)); + } + rb_yield_tokens(N, tag[0], attr, raw_string, taint); + } + } + + public void SET(IRubyObject[] N, int E) { + int mark = 0; + if(N == tag) { + if(mark_tag == -1 || E == mark_tag) { + tag[0] = runtime.newString(""); + } else if(E > mark_tag) { + tag[0] = runtime.newString(new String(buf,mark_tag, E-mark_tag)); + } + } else if(N == akey) { + if(mark_akey == -1 || E == mark_akey) { + akey[0] = runtime.newString(""); + } else if(E > mark_akey) { + akey[0] = runtime.newString(new String(buf,mark_akey, E-mark_akey)); + } + } else if(N == aval) { + if(mark_aval == -1 || E == mark_aval) { + aval[0] = runtime.newString(""); + } else if(E > mark_aval) { + aval[0] = runtime.newString(new String(buf,mark_aval, E-mark_aval)); + } + } + } + + public void CAT(IRubyObject[] N, int E) { + if(N[0].isNil()) { + SET(N,E); + } else { + int mark = 0; + if(N == tag) { + mark = mark_tag; + } else if(N == akey) { + mark = mark_akey; + } else if(N == aval) { + mark = mark_aval; + } + ((RubyString)(N[0])).append(runtime.newString(new String(buf, mark, E-mark))); + } + } + + public void SLIDE(Object N) { + int mark = 0; + if(N == tag) { + mark = mark_tag; + } else if(N == akey) { + mark = mark_akey; + } else if(N == aval) { + mark = mark_aval; + } + if(mark > tokstart) { + if(N == tag) { + mark_tag -= tokstart; + } else if(N == akey) { + mark_akey -= tokstart; + } else if(N == aval) { + mark_aval -= tokstart; + } + } + } + + public void ATTR(IRubyObject K, IRubyObject V) { + if(!K.isNil()) { + if(attr.isNil()) { + attr = RubyHash.newHash(runtime); + } + ((RubyHash)attr).aset(K,V); + } + } + + public void ATTR(IRubyObject[] K, IRubyObject V) { + ATTR(K[0],V); + } + + public void ATTR(IRubyObject K, IRubyObject[] V) { + ATTR(K,V[0]); + } + + public void ATTR(IRubyObject[] K, IRubyObject[] V) { + ATTR(K[0],V[0]); + } + + public void TEXT_PASS() { + if(!text) { + if(ele_open) { + ele_open = false; + if(tokstart > -1) { + mark_tag = tokstart; + } + } else { + mark_tag = p; + } + attr = runtime.getNil(); + tag[0] = runtime.getNil(); + text = true; + } + } + + public void EBLK(IRubyObject N, int T) { + CAT(tag, p - T + 1); + ELE(N); + } + + + public void rb_raise(RubyClass error, String message) { + throw new RaiseException(runtime, error, message, true); + } + + public IRubyObject rb_str_new2(String s) { + return runtime.newString(s); + } + + + + +static final byte[] _hpricot_scan_actions = { + 0, 1, 1, 1, 2, 1, 4, 1, + 5, 1, 6, 1, 7, 1, 8, 1, + 9, 1, 10, 1, 11, 1, 12, 1, + 14, 1, 16, 1, 20, 1, 21, 1, + 22, 1, 24, 1, 25, 1, 26, 1, + 28, 1, 29, 1, 30, 1, 32, 1, + 33, 1, 38, 1, 39, 1, 40, 1, + 41, 1, 42, 1, 43, 1, 44, 1, + 45, 1, 46, 1, 47, 1, 48, 1, + 49, 1, 50, 2, 2, 5, 2, 2, + 6, 2, 2, 11, 2, 2, 12, 2, + 2, 14, 2, 4, 39, 2, 4, 40, + 2, 4, 41, 2, 5, 2, 2, 6, + 14, 2, 7, 6, 2, 7, 14, 2, + 11, 12, 2, 13, 3, 2, 14, 6, + 2, 14, 40, 2, 15, 24, 2, 15, + 28, 2, 15, 32, 2, 15, 45, 2, + 17, 23, 2, 18, 27, 2, 19, 31, + 2, 22, 34, 2, 22, 36, 3, 2, + 6, 14, 3, 2, 14, 6, 3, 6, + 7, 14, 3, 6, 14, 40, 3, 7, + 14, 40, 3, 14, 6, 40, 3, 14, + 13, 3, 3, 22, 0, 37, 3, 22, + 2, 34, 3, 22, 14, 35, 4, 2, + 14, 13, 3, 4, 6, 7, 14, 40, + 4, 22, 2, 14, 35, 4, 22, 6, + 14, 35, 4, 22, 7, 14, 35, 4, + 22, 14, 6, 35, 5, 22, 2, 6, + 14, 35, 5, 22, 2, 14, 6, 35, + 5, 22, 6, 7, 14, 35 +}; + +static final short[] _hpricot_scan_key_offsets = { + 0, 3, 4, 5, 6, 7, 8, 9, + 10, 13, 22, 37, 44, 45, 46, 47, + 48, 49, 52, 57, 69, 81, 86, 93, + 94, 95, 100, 101, 105, 106, 107, 121, + 135, 152, 169, 186, 203, 210, 212, 214, + 220, 222, 227, 232, 238, 240, 245, 251, + 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 282, 296, 300, 313, + 326, 340, 354, 355, 366, 375, 388, 405, + 423, 441, 450, 461, 480, 499, 510, 521, + 536, 538, 540, 556, 572, 575, 587, 599, + 619, 639, 658, 677, 697, 717, 728, 739, + 751, 763, 775, 791, 794, 809, 811, 813, + 829, 845, 848, 860, 871, 890, 910, 930, + 941, 952, 964, 984, 1004, 1016, 1036, 1057, + 1074, 1091, 1095, 1098, 1110, 1122, 1142, 1162, + 1182, 1194, 1206, 1226, 1242, 1258, 1270, 1291, + 1310, 1313, 1328, 1340, 1355, 1358, 1369, 1371, + 1373, 1384, 1391, 1404, 1418, 1432, 1445, 1446, + 1447, 1448, 1449, 1450, 1451, 1455, 1460, 1469, + 1479, 1484, 1491, 1492, 1493, 1494, 1495, 1496, + 1497, 1498, 1499, 1503, 1508, 1512, 1522, 1527, + 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, + 1541, 1542, 1546, 1551, 1553, 1554, 1555, 1560, + 1561, 1562, 1564, 1565, 1566, 1567, 1568, 1572, + 1582, 1591, 1601, 1602, 1603, 1605, 1614, 1615, + 1616, 1617, 1619, 1621, 1624, 1627, 1631, 1633, + 1634, 1636, 1637, 1640 +}; + +static final char[] _hpricot_scan_trans_keys = { + 45, 68, 91, 45, 79, 67, 84, 89, + 80, 69, 32, 9, 13, 32, 58, 95, + 9, 13, 65, 90, 97, 122, 32, 62, + 63, 91, 95, 9, 13, 45, 46, 48, + 58, 65, 90, 97, 122, 32, 62, 80, + 83, 91, 9, 13, 85, 66, 76, 73, + 67, 32, 9, 13, 32, 34, 39, 9, + 13, 9, 34, 61, 95, 32, 37, 39, + 59, 63, 90, 97, 122, 9, 34, 61, + 95, 32, 37, 39, 59, 63, 90, 97, + 122, 32, 62, 91, 9, 13, 32, 34, + 39, 62, 91, 9, 13, 34, 34, 32, + 62, 91, 9, 13, 93, 32, 62, 9, + 13, 39, 39, 9, 39, 61, 95, 32, + 33, 35, 37, 40, 59, 63, 90, 97, + 122, 9, 39, 61, 95, 32, 33, 35, + 37, 40, 59, 63, 90, 97, 122, 9, + 32, 33, 39, 62, 91, 95, 10, 13, + 35, 37, 40, 59, 61, 90, 97, 122, + 9, 32, 34, 39, 62, 91, 95, 10, + 13, 33, 37, 40, 59, 61, 90, 97, + 122, 9, 32, 33, 39, 62, 91, 95, + 10, 13, 35, 37, 40, 59, 61, 90, + 97, 122, 9, 32, 34, 39, 62, 91, + 95, 10, 13, 33, 37, 40, 59, 61, + 90, 97, 122, 32, 34, 39, 62, 91, + 9, 13, 34, 39, 34, 39, 32, 39, + 62, 91, 9, 13, 39, 93, 32, 62, + 93, 9, 13, 32, 39, 62, 9, 13, + 32, 34, 62, 91, 9, 13, 34, 93, + 32, 34, 62, 9, 13, 32, 39, 62, + 91, 9, 13, 9, 39, 61, 95, 32, + 33, 35, 37, 40, 59, 63, 90, 97, + 122, 89, 83, 84, 69, 77, 67, 68, + 65, 84, 65, 91, 58, 95, 65, 90, + 97, 122, 32, 62, 63, 95, 9, 13, + 45, 46, 48, 58, 65, 90, 97, 122, + 32, 62, 9, 13, 32, 47, 62, 63, + 95, 9, 13, 45, 58, 65, 90, 97, + 122, 32, 47, 62, 63, 95, 9, 13, + 45, 58, 65, 90, 97, 122, 32, 47, + 61, 62, 63, 95, 9, 13, 45, 58, + 65, 90, 97, 122, 32, 47, 61, 62, + 63, 95, 9, 13, 45, 58, 65, 90, + 97, 122, 62, 13, 32, 34, 39, 47, + 60, 62, 9, 10, 11, 12, 13, 32, + 47, 60, 62, 9, 10, 11, 12, 32, + 47, 62, 63, 95, 9, 13, 45, 58, + 65, 90, 97, 122, 13, 32, 47, 60, + 62, 63, 95, 9, 10, 11, 12, 45, + 58, 65, 90, 97, 122, 13, 32, 47, + 60, 61, 62, 63, 95, 9, 10, 11, + 12, 45, 58, 65, 90, 97, 122, 13, + 32, 47, 60, 61, 62, 63, 95, 9, + 10, 11, 12, 45, 58, 65, 90, 97, + 122, 13, 32, 47, 60, 62, 9, 10, + 11, 12, 13, 32, 34, 39, 47, 60, + 62, 9, 10, 11, 12, 13, 32, 34, + 39, 47, 60, 62, 63, 95, 9, 10, + 11, 12, 45, 58, 65, 90, 97, 122, + 13, 32, 34, 39, 47, 60, 62, 63, + 95, 9, 10, 11, 12, 45, 58, 65, + 90, 97, 122, 13, 32, 34, 47, 60, + 62, 92, 9, 10, 11, 12, 13, 32, + 34, 47, 60, 62, 92, 9, 10, 11, + 12, 32, 34, 47, 62, 63, 92, 95, + 9, 13, 45, 58, 65, 90, 97, 122, + 34, 92, 34, 92, 32, 34, 47, 61, + 62, 63, 92, 95, 9, 13, 45, 58, + 65, 90, 97, 122, 32, 34, 47, 61, + 62, 63, 92, 95, 9, 13, 45, 58, + 65, 90, 97, 122, 34, 62, 92, 13, + 32, 34, 39, 47, 60, 62, 92, 9, + 10, 11, 12, 13, 32, 34, 39, 47, + 60, 62, 92, 9, 10, 11, 12, 13, + 32, 34, 39, 47, 60, 62, 63, 92, + 95, 9, 10, 11, 12, 45, 58, 65, + 90, 97, 122, 13, 32, 34, 39, 47, + 60, 62, 63, 92, 95, 9, 10, 11, + 12, 45, 58, 65, 90, 97, 122, 13, + 32, 34, 47, 60, 62, 63, 92, 95, + 9, 10, 11, 12, 45, 58, 65, 90, + 97, 122, 13, 32, 34, 47, 60, 62, + 63, 92, 95, 9, 10, 11, 12, 45, + 58, 65, 90, 97, 122, 13, 32, 34, + 47, 60, 61, 62, 63, 92, 95, 9, + 10, 11, 12, 45, 58, 65, 90, 97, + 122, 13, 32, 34, 47, 60, 61, 62, + 63, 92, 95, 9, 10, 11, 12, 45, + 58, 65, 90, 97, 122, 13, 32, 34, + 47, 60, 62, 92, 9, 10, 11, 12, + 13, 32, 34, 47, 60, 62, 92, 9, + 10, 11, 12, 13, 32, 34, 39, 47, + 60, 62, 92, 9, 10, 11, 12, 13, + 32, 34, 39, 47, 60, 62, 92, 9, + 10, 11, 12, 13, 32, 34, 39, 47, + 60, 62, 92, 9, 10, 11, 12, 32, + 34, 39, 47, 62, 63, 92, 95, 9, + 13, 45, 58, 65, 90, 97, 122, 34, + 39, 92, 32, 39, 47, 62, 63, 92, + 95, 9, 13, 45, 58, 65, 90, 97, + 122, 39, 92, 39, 92, 32, 39, 47, + 61, 62, 63, 92, 95, 9, 13, 45, + 58, 65, 90, 97, 122, 32, 39, 47, + 61, 62, 63, 92, 95, 9, 13, 45, + 58, 65, 90, 97, 122, 39, 62, 92, + 13, 32, 34, 39, 47, 60, 62, 92, + 9, 10, 11, 12, 13, 32, 39, 47, + 60, 62, 92, 9, 10, 11, 12, 13, + 32, 39, 47, 60, 62, 63, 92, 95, + 9, 10, 11, 12, 45, 58, 65, 90, + 97, 122, 13, 32, 39, 47, 60, 61, + 62, 63, 92, 95, 9, 10, 11, 12, + 45, 58, 65, 90, 97, 122, 13, 32, + 39, 47, 60, 61, 62, 63, 92, 95, + 9, 10, 11, 12, 45, 58, 65, 90, + 97, 122, 13, 32, 39, 47, 60, 62, + 92, 9, 10, 11, 12, 13, 32, 39, + 47, 60, 62, 92, 9, 10, 11, 12, + 13, 32, 34, 39, 47, 60, 62, 92, + 9, 10, 11, 12, 13, 32, 34, 39, + 47, 60, 62, 63, 92, 95, 9, 10, + 11, 12, 45, 58, 65, 90, 97, 122, + 13, 32, 34, 39, 47, 60, 62, 63, + 92, 95, 9, 10, 11, 12, 45, 58, + 65, 90, 97, 122, 13, 32, 34, 39, + 47, 60, 62, 92, 9, 10, 11, 12, + 13, 32, 34, 39, 47, 60, 62, 63, + 92, 95, 9, 10, 11, 12, 45, 58, + 65, 90, 97, 122, 13, 32, 34, 39, + 47, 60, 61, 62, 63, 92, 95, 9, + 10, 11, 12, 45, 58, 65, 90, 97, + 122, 32, 34, 39, 47, 61, 62, 63, + 92, 95, 9, 13, 45, 58, 65, 90, + 97, 122, 32, 34, 39, 47, 61, 62, + 63, 92, 95, 9, 13, 45, 58, 65, + 90, 97, 122, 34, 39, 62, 92, 34, + 39, 92, 13, 32, 34, 39, 47, 60, + 62, 92, 9, 10, 11, 12, 13, 32, + 34, 39, 47, 60, 62, 92, 9, 10, + 11, 12, 13, 32, 34, 39, 47, 60, + 62, 63, 92, 95, 9, 10, 11, 12, + 45, 58, 65, 90, 97, 122, 13, 32, + 34, 39, 47, 60, 62, 63, 92, 95, + 9, 10, 11, 12, 45, 58, 65, 90, + 97, 122, 13, 32, 34, 39, 47, 60, + 62, 63, 92, 95, 9, 10, 11, 12, + 45, 58, 65, 90, 97, 122, 13, 32, + 34, 39, 47, 60, 62, 92, 9, 10, + 11, 12, 13, 32, 34, 39, 47, 60, + 62, 92, 9, 10, 11, 12, 13, 32, + 34, 39, 47, 60, 62, 63, 92, 95, + 9, 10, 11, 12, 45, 58, 65, 90, + 97, 122, 32, 34, 39, 47, 62, 63, + 92, 95, 9, 13, 45, 58, 65, 90, + 97, 122, 32, 34, 39, 47, 62, 63, + 92, 95, 9, 13, 45, 58, 65, 90, + 97, 122, 13, 32, 34, 39, 47, 60, + 62, 92, 9, 10, 11, 12, 13, 32, + 34, 39, 47, 60, 61, 62, 63, 92, + 95, 9, 10, 11, 12, 45, 58, 65, + 90, 97, 122, 13, 32, 39, 47, 60, + 62, 63, 92, 95, 9, 10, 11, 12, + 45, 58, 65, 90, 97, 122, 34, 39, + 92, 32, 39, 47, 62, 63, 92, 95, + 9, 13, 45, 58, 65, 90, 97, 122, + 13, 32, 34, 39, 47, 60, 62, 92, + 9, 10, 11, 12, 32, 34, 47, 62, + 63, 92, 95, 9, 13, 45, 58, 65, + 90, 97, 122, 34, 39, 92, 13, 32, + 39, 47, 60, 62, 92, 9, 10, 11, + 12, 34, 92, 39, 92, 13, 32, 34, + 39, 47, 60, 62, 9, 10, 11, 12, + 58, 95, 120, 65, 90, 97, 122, 32, + 63, 95, 9, 13, 45, 46, 48, 58, + 65, 90, 97, 122, 32, 63, 95, 109, + 9, 13, 45, 46, 48, 58, 65, 90, + 97, 122, 32, 63, 95, 108, 9, 13, + 45, 46, 48, 58, 65, 90, 97, 122, + 32, 63, 95, 9, 13, 45, 46, 48, + 58, 65, 90, 97, 122, 101, 114, 115, + 105, 111, 110, 32, 61, 9, 13, 32, + 34, 39, 9, 13, 95, 45, 46, 48, + 58, 65, 90, 97, 122, 34, 95, 45, + 46, 48, 58, 65, 90, 97, 122, 32, + 62, 63, 9, 13, 32, 62, 63, 101, + 115, 9, 13, 62, 110, 99, 111, 100, + 105, 110, 103, 32, 61, 9, 13, 32, + 34, 39, 9, 13, 65, 90, 97, 122, + 34, 95, 45, 46, 48, 57, 65, 90, + 97, 122, 32, 62, 63, 9, 13, 32, + 62, 63, 115, 9, 13, 116, 97, 110, + 100, 97, 108, 111, 110, 101, 32, 61, + 9, 13, 32, 34, 39, 9, 13, 110, + 121, 111, 34, 32, 62, 63, 9, 13, + 101, 115, 110, 121, 111, 39, 101, 115, + 65, 90, 97, 122, 39, 95, 45, 46, + 48, 57, 65, 90, 97, 122, 95, 45, + 46, 48, 58, 65, 90, 97, 122, 39, + 95, 45, 46, 48, 58, 65, 90, 97, + 122, 62, 62, 10, 60, 33, 47, 58, + 63, 95, 65, 90, 97, 122, 39, 93, + 34, 34, 92, 39, 92, 34, 39, 92, + 32, 9, 13, 32, 118, 9, 13, 10, + 45, 45, 10, 93, 93, 10, 62, 63, + 62, 0 +}; + +static final byte[] _hpricot_scan_single_lengths = { + 3, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 5, 5, 1, 1, 1, 1, + 1, 1, 3, 4, 4, 3, 5, 1, + 1, 3, 1, 2, 1, 1, 4, 4, + 7, 7, 7, 7, 5, 2, 2, 4, + 2, 3, 3, 4, 2, 3, 4, 4, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 4, 2, 5, 5, + 6, 6, 1, 7, 5, 5, 7, 8, + 8, 5, 7, 9, 9, 7, 7, 7, + 2, 2, 8, 8, 3, 8, 8, 10, + 10, 9, 9, 10, 10, 7, 7, 8, + 8, 8, 8, 3, 7, 2, 2, 8, + 8, 3, 8, 7, 9, 10, 10, 7, + 7, 8, 10, 10, 8, 10, 11, 9, + 9, 4, 3, 8, 8, 10, 10, 10, + 8, 8, 10, 8, 8, 8, 11, 9, + 3, 7, 8, 7, 3, 7, 2, 2, + 7, 3, 3, 4, 4, 3, 1, 1, + 1, 1, 1, 1, 2, 3, 1, 2, + 3, 5, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 3, 0, 2, 3, 4, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 3, 2, 1, 1, 3, 1, + 1, 2, 1, 1, 1, 1, 0, 2, + 1, 2, 1, 1, 2, 5, 1, 1, + 1, 2, 2, 3, 1, 2, 2, 1, + 2, 1, 3, 1 +}; + +static final byte[] _hpricot_scan_range_lengths = { + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 3, 5, 1, 0, 0, 0, 0, + 0, 1, 1, 4, 4, 1, 1, 0, + 0, 1, 0, 1, 0, 0, 5, 5, + 5, 5, 5, 5, 1, 0, 0, 1, + 0, 1, 1, 1, 0, 1, 1, 5, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 2, 5, 1, 4, 4, + 4, 4, 0, 2, 2, 4, 5, 5, + 5, 2, 2, 5, 5, 2, 2, 4, + 0, 0, 4, 4, 0, 2, 2, 5, + 5, 5, 5, 5, 5, 2, 2, 2, + 2, 2, 4, 0, 4, 0, 0, 4, + 4, 0, 2, 2, 5, 5, 5, 2, + 2, 2, 5, 5, 2, 5, 5, 4, + 4, 0, 0, 2, 2, 5, 5, 5, + 2, 2, 5, 4, 4, 2, 5, 5, + 0, 4, 2, 4, 0, 2, 0, 0, + 2, 2, 5, 5, 5, 5, 0, 0, + 0, 0, 0, 0, 1, 1, 4, 4, + 1, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 1, 2, 4, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 2, 4, + 4, 4, 0, 0, 0, 2, 0, 0, + 0, 0, 0, 0, 1, 1, 0, 0, + 0, 0, 0, 0 +}; + +static final short[] _hpricot_scan_index_offsets = { + 0, 4, 6, 8, 10, 12, 14, 16, + 18, 21, 28, 39, 46, 48, 50, 52, + 54, 56, 59, 64, 73, 82, 87, 94, + 96, 98, 103, 105, 109, 111, 113, 123, + 133, 146, 159, 172, 185, 192, 195, 198, + 204, 207, 212, 217, 223, 226, 231, 237, + 247, 249, 251, 253, 255, 257, 259, 261, + 263, 265, 267, 269, 274, 284, 288, 298, + 308, 319, 330, 332, 342, 350, 360, 373, + 387, 401, 409, 419, 434, 449, 459, 469, + 481, 484, 487, 500, 513, 517, 528, 539, + 555, 571, 586, 601, 617, 633, 643, 653, + 664, 675, 686, 699, 703, 715, 718, 721, + 734, 747, 751, 762, 772, 787, 803, 819, + 829, 839, 850, 866, 882, 893, 909, 926, + 940, 954, 959, 963, 974, 985, 1001, 1017, + 1033, 1044, 1055, 1071, 1084, 1097, 1108, 1125, + 1140, 1144, 1156, 1167, 1179, 1183, 1193, 1196, + 1199, 1209, 1215, 1224, 1234, 1244, 1253, 1255, + 1257, 1259, 1261, 1263, 1265, 1269, 1274, 1280, + 1287, 1292, 1299, 1301, 1303, 1305, 1307, 1309, + 1311, 1313, 1315, 1319, 1324, 1327, 1334, 1339, + 1345, 1347, 1349, 1351, 1353, 1355, 1357, 1359, + 1361, 1363, 1367, 1372, 1375, 1377, 1379, 1384, + 1386, 1388, 1391, 1393, 1395, 1397, 1399, 1402, + 1409, 1415, 1422, 1424, 1426, 1429, 1437, 1439, + 1441, 1443, 1446, 1449, 1453, 1456, 1460, 1463, + 1465, 1468, 1470, 1474 +}; + +static final short[] _hpricot_scan_indicies = { + 335, 336, 337, 296, 356, 296, 349, 296, + 399, 296, 401, 296, 354, 296, 350, 296, + 400, 296, 308, 308, 296, 308, 309, 309, + 308, 309, 309, 296, 328, 330, 329, 331, + 329, 328, 329, 329, 329, 329, 296, 310, + 302, 311, 312, 0, 310, 296, 353, 296, + 342, 296, 347, 296, 346, 296, 343, 296, + 304, 304, 296, 304, 305, 306, 304, 296, + 321, 320, 321, 321, 321, 321, 321, 321, + 296, 319, 320, 319, 319, 319, 319, 319, + 319, 296, 298, 302, 0, 298, 296, 298, + 300, 307, 302, 0, 298, 296, 6, 222, + 6, 13, 358, 302, 0, 358, 69, 1, + 0, 1, 302, 1, 69, 6, 182, 6, + 5, 322, 323, 322, 322, 322, 322, 322, + 322, 322, 296, 299, 303, 299, 299, 299, + 299, 299, 299, 299, 296, 297, 297, 299, + 303, 302, 0, 299, 298, 299, 299, 299, + 299, 296, 297, 297, 300, 301, 302, 0, + 299, 298, 299, 299, 299, 299, 296, 186, + 186, 188, 42, 184, 185, 188, 187, 188, + 188, 188, 188, 182, 43, 43, 38, 44, + 40, 34, 41, 37, 41, 41, 41, 41, + 5, 37, 38, 39, 40, 34, 37, 5, + 63, 224, 223, 63, 64, 62, 371, 6, + 40, 34, 371, 5, 35, 36, 34, 26, + 27, 1, 26, 0, 36, 6, 40, 36, + 5, 60, 6, 61, 58, 60, 13, 35, + 59, 58, 59, 6, 61, 59, 13, 183, + 6, 184, 185, 183, 182, 41, 42, 41, + 41, 41, 41, 41, 41, 41, 5, 403, + 296, 351, 296, 352, 296, 345, 296, 348, + 296, 398, 296, 344, 296, 341, 296, 402, + 296, 397, 296, 355, 296, 338, 338, 338, + 338, 296, 332, 334, 333, 333, 332, 333, + 333, 333, 333, 296, 313, 314, 313, 296, + 324, 326, 327, 325, 325, 324, 325, 325, + 325, 296, 315, 317, 318, 316, 316, 315, + 316, 316, 316, 296, 364, 366, 367, 368, + 365, 365, 364, 365, 365, 365, 69, 359, + 361, 362, 162, 360, 360, 359, 360, 360, + 360, 69, 369, 69, 157, 157, 159, 160, + 161, 69, 162, 157, 158, 156, 66, 66, + 68, 69, 70, 66, 67, 65, 363, 361, + 162, 360, 360, 363, 360, 360, 360, 69, + 66, 66, 74, 69, 76, 73, 73, 66, + 67, 73, 73, 73, 65, 132, 132, 135, + 69, 136, 137, 134, 134, 132, 133, 134, + 134, 134, 65, 71, 71, 74, 69, 75, + 76, 73, 73, 71, 72, 73, 73, 73, + 65, 66, 66, 68, 69, 70, 66, 67, + 65, 226, 226, 228, 229, 230, 69, 70, + 226, 227, 156, 163, 163, 159, 160, 161, + 69, 162, 165, 165, 163, 164, 165, 165, + 165, 156, 226, 226, 228, 229, 231, 69, + 76, 165, 165, 226, 227, 165, 165, 165, + 156, 248, 248, 84, 246, 199, 250, 195, + 248, 249, 189, 92, 92, 84, 95, 7, + 96, 97, 92, 93, 91, 372, 3, 48, + 50, 47, 8, 47, 372, 47, 47, 47, + 7, 3, 8, 7, 11, 8, 7, 122, + 3, 124, 125, 126, 123, 8, 123, 122, + 123, 123, 123, 7, 46, 3, 48, 49, + 50, 47, 8, 47, 46, 47, 47, 47, + 7, 3, 45, 8, 7, 190, 190, 192, + 193, 194, 7, 50, 195, 190, 191, 189, + 196, 196, 192, 193, 194, 7, 50, 195, + 196, 197, 189, 196, 196, 192, 193, 194, + 7, 50, 198, 195, 198, 196, 197, 198, + 198, 198, 189, 242, 242, 244, 245, 247, + 7, 103, 198, 195, 198, 242, 243, 198, + 198, 198, 189, 248, 248, 84, 247, 199, + 251, 198, 195, 198, 248, 249, 198, 198, + 198, 189, 92, 92, 84, 101, 7, 103, + 100, 97, 100, 92, 93, 100, 100, 100, + 91, 144, 144, 84, 147, 7, 148, 149, + 146, 97, 146, 144, 145, 146, 146, 146, + 91, 98, 98, 84, 101, 7, 102, 103, + 100, 97, 100, 98, 99, 100, 100, 100, + 91, 92, 92, 84, 95, 7, 96, 97, + 92, 93, 91, 92, 92, 94, 95, 7, + 96, 97, 92, 93, 91, 242, 242, 244, + 245, 246, 7, 96, 195, 242, 243, 189, + 258, 258, 263, 94, 256, 215, 261, 211, + 258, 259, 205, 105, 105, 80, 94, 108, + 9, 109, 110, 105, 106, 104, 373, 10, + 11, 55, 57, 54, 12, 54, 373, 54, + 54, 54, 9, 10, 11, 12, 9, 370, + 3, 31, 33, 30, 4, 30, 370, 30, + 30, 30, 2, 3, 4, 2, 10, 4, + 2, 117, 3, 119, 120, 121, 118, 4, + 118, 117, 118, 118, 118, 2, 29, 3, + 31, 32, 33, 30, 4, 30, 29, 30, + 30, 30, 2, 3, 28, 4, 2, 167, + 167, 169, 170, 171, 2, 33, 172, 167, + 168, 166, 78, 78, 84, 81, 2, 82, + 83, 78, 79, 77, 78, 78, 84, 88, + 2, 90, 87, 83, 87, 78, 79, 87, + 87, 87, 77, 138, 138, 84, 141, 2, + 142, 143, 140, 83, 140, 138, 139, 140, + 140, 140, 77, 85, 85, 84, 88, 2, + 89, 90, 87, 83, 87, 85, 86, 87, + 87, 87, 77, 78, 78, 84, 81, 2, + 82, 83, 78, 79, 77, 78, 78, 80, + 81, 2, 82, 83, 78, 79, 77, 232, + 232, 234, 235, 236, 2, 82, 172, 232, + 233, 166, 173, 173, 169, 170, 171, 2, + 33, 175, 172, 175, 173, 174, 175, 175, + 175, 166, 232, 232, 234, 235, 237, 2, + 90, 175, 172, 175, 232, 233, 175, 175, + 175, 166, 258, 258, 80, 260, 256, 215, + 261, 211, 258, 259, 205, 105, 105, 80, + 94, 114, 9, 116, 113, 110, 113, 105, + 106, 113, 113, 113, 104, 150, 150, 80, + 94, 153, 9, 154, 155, 152, 110, 152, + 150, 151, 152, 152, 152, 104, 53, 10, + 11, 55, 56, 57, 54, 12, 54, 53, + 54, 54, 54, 9, 127, 10, 11, 129, + 130, 131, 128, 12, 128, 127, 128, 128, + 128, 9, 10, 11, 52, 12, 9, 51, + 51, 12, 9, 206, 206, 208, 209, 210, + 9, 57, 211, 206, 207, 205, 212, 212, + 208, 209, 210, 9, 57, 211, 212, 213, + 205, 212, 212, 208, 209, 210, 9, 57, + 214, 211, 214, 212, 213, 214, 214, 214, + 205, 252, 252, 254, 255, 257, 9, 116, + 214, 211, 214, 252, 253, 214, 214, 214, + 205, 258, 258, 80, 260, 257, 215, 262, + 214, 211, 214, 258, 259, 214, 214, 214, + 205, 105, 105, 80, 94, 108, 9, 109, + 110, 105, 106, 104, 105, 105, 107, 107, + 108, 9, 109, 110, 105, 106, 104, 258, + 258, 263, 94, 257, 215, 262, 214, 211, + 214, 258, 259, 214, 214, 214, 205, 218, + 10, 216, 220, 221, 219, 217, 219, 218, + 219, 219, 219, 215, 218, 225, 11, 220, + 221, 219, 217, 219, 218, 219, 219, 219, + 215, 252, 252, 254, 255, 256, 9, 109, + 211, 252, 253, 205, 111, 111, 80, 94, + 114, 9, 115, 116, 113, 110, 113, 111, + 112, 113, 113, 113, 104, 238, 238, 84, + 237, 176, 241, 175, 172, 175, 238, 239, + 175, 175, 175, 166, 10, 216, 217, 215, + 178, 3, 180, 181, 179, 177, 179, 178, + 179, 179, 179, 176, 173, 173, 169, 170, + 171, 2, 33, 172, 173, 174, 166, 201, + 3, 203, 204, 202, 200, 202, 201, 202, + 202, 202, 199, 225, 11, 217, 215, 238, + 238, 84, 236, 176, 240, 172, 238, 239, + 166, 3, 200, 199, 3, 177, 176, 163, + 163, 159, 160, 161, 69, 162, 163, 164, + 156, 339, 339, 340, 339, 339, 296, 15, + 357, 357, 15, 357, 357, 357, 357, 296, + 15, 357, 357, 408, 15, 357, 357, 357, + 357, 296, 15, 357, 357, 404, 15, 357, + 357, 357, 357, 296, 16, 357, 357, 16, + 357, 357, 357, 357, 296, 287, 264, 294, + 264, 396, 264, 387, 264, 393, 264, 268, + 264, 268, 265, 268, 264, 265, 266, 267, + 265, 264, 282, 282, 282, 282, 282, 264, + 275, 276, 276, 276, 276, 276, 264, 269, + 270, 271, 269, 264, 269, 270, 271, 272, + 273, 269, 264, 270, 264, 388, 264, 285, + 264, 394, 264, 385, 264, 289, 264, 390, + 264, 288, 264, 288, 374, 288, 264, 374, + 375, 376, 374, 264, 283, 283, 264, 277, + 278, 278, 278, 278, 278, 264, 274, 270, + 271, 274, 264, 274, 270, 271, 273, 274, + 264, 295, 264, 384, 264, 389, 264, 286, + 264, 284, 264, 290, 264, 395, 264, 391, + 264, 380, 264, 380, 377, 380, 264, 377, + 378, 379, 377, 264, 291, 292, 264, 293, + 264, 279, 264, 381, 270, 271, 381, 264, + 386, 264, 293, 264, 405, 406, 264, 392, + 264, 279, 264, 407, 264, 392, 264, 383, + 383, 264, 277, 281, 281, 281, 281, 281, + 264, 382, 382, 382, 382, 382, 264, 275, + 280, 280, 280, 280, 280, 264, 415, 414, + 422, 421, 24, 25, 23, 19, 20, 21, + 22, 21, 21, 21, 18, 6, 5, 1, + 0, 6, 13, 3, 8, 7, 3, 4, + 2, 10, 11, 12, 9, 15, 15, 14, + 16, 17, 16, 14, 412, 413, 411, 410, + 409, 419, 420, 418, 417, 416, 426, 424, + 427, 425, 424, 423, 0 +}; + +static final short[] _hpricot_scan_trans_targs_wi = { + 26, 27, 101, 69, 102, 29, 25, 80, + 81, 99, 100, 79, 122, 24, 204, 212, + 213, 150, 204, 0, 59, 62, 145, 204, + 204, 205, 41, 207, 210, 104, 103, 105, + 106, 210, 40, 41, 42, 36, 37, 46, + 206, 47, 32, 35, 34, 209, 83, 82, + 84, 85, 209, 98, 211, 119, 120, 121, + 123, 211, 44, 45, 43, 208, 38, 39, + 43, 68, 69, 70, 73, 204, 204, 65, + 72, 71, 73, 74, 204, 107, 100, 108, + 108, 111, 210, 112, 70, 104, 110, 109, + 111, 113, 210, 78, 79, 90, 90, 93, + 209, 94, 83, 92, 91, 93, 95, 209, + 97, 98, 117, 117, 128, 211, 129, 119, + 134, 118, 128, 133, 211, 104, 103, 105, + 106, 210, 83, 82, 84, 85, 209, 119, + 120, 121, 123, 211, 65, 72, 71, 73, + 74, 204, 104, 110, 109, 111, 113, 210, + 83, 92, 91, 93, 95, 209, 119, 134, + 118, 128, 133, 211, 68, 144, 74, 142, + 143, 73, 204, 75, 76, 71, 107, 138, + 113, 136, 137, 111, 112, 114, 115, 109, + 101, 102, 100, 103, 105, 210, 29, 39, + 206, 40, 35, 36, 47, 78, 86, 95, + 139, 140, 93, 94, 87, 88, 91, 80, + 81, 79, 82, 84, 209, 97, 124, 133, + 131, 132, 128, 129, 125, 126, 118, 99, + 79, 122, 98, 120, 121, 211, 24, 38, + 43, 100, 75, 76, 77, 141, 73, 73, + 114, 115, 116, 135, 111, 111, 100, 108, + 210, 210, 87, 88, 89, 96, 93, 93, + 79, 90, 209, 209, 125, 126, 127, 130, + 128, 128, 98, 117, 90, 211, 211, 108, + 204, 157, 158, 200, 156, 161, 204, 162, + 163, 176, 175, 160, 159, 174, 173, 190, + 201, 199, 159, 173, 181, 165, 180, 151, + 170, 168, 182, 188, 191, 189, 152, 177, + 204, 33, 22, 31, 23, 34, 204, 32, + 18, 19, 30, 28, 9, 10, 11, 12, + 48, 61, 204, 63, 64, 66, 204, 20, + 21, 20, 31, 32, 63, 62, 66, 204, + 11, 10, 204, 26, 61, 60, 204, 1, + 2, 53, 60, 146, 147, 56, 14, 17, + 55, 52, 16, 15, 21, 3, 7, 50, + 51, 13, 6, 204, 204, 146, 25, 65, + 64, 66, 67, 69, 65, 64, 66, 67, + 204, 204, 100, 39, 79, 98, 171, 172, + 198, 186, 187, 193, 185, 190, 201, 199, + 178, 167, 192, 154, 164, 179, 169, 184, + 195, 155, 166, 183, 153, 58, 54, 4, + 8, 5, 57, 49, 149, 194, 196, 197, + 148, 214, 202, 214, 214, 215, 214, 214, + 216, 203, 216, 216, 217, 216, 216, 218, + 218, 218, 218, 219 +}; + +static final short[] _hpricot_scan_trans_actions_wi = { + 0, 0, 0, 7, 0, 0, 21, 0, + 0, 0, 7, 7, 0, 0, 65, 0, + 31, 0, 67, 0, 0, 1, 0, 63, + 132, 178, 0, 144, 147, 0, 174, 23, + 0, 186, 0, 21, 0, 0, 0, 21, + 144, 0, 111, 0, 111, 147, 0, 174, + 23, 0, 186, 7, 147, 0, 174, 23, + 0, 186, 0, 0, 0, 144, 0, 21, + 21, 0, 9, 9, 102, 73, 162, 9, + 9, 174, 117, 0, 170, 0, 9, 9, + 7, 102, 205, 0, 7, 9, 9, 174, + 117, 0, 215, 0, 9, 9, 7, 102, + 205, 0, 9, 9, 174, 117, 0, 215, + 0, 9, 9, 7, 102, 205, 0, 9, + 9, 174, 117, 0, 215, 11, 0, 108, + 11, 210, 11, 0, 108, 11, 210, 11, + 0, 108, 11, 210, 105, 105, 0, 158, + 11, 195, 105, 105, 0, 158, 11, 232, + 105, 105, 0, 158, 11, 232, 105, 105, + 0, 158, 11, 232, 3, 3, 3, 0, + 0, 87, 120, 3, 3, 190, 3, 3, + 3, 0, 7, 87, 3, 3, 3, 190, + 3, 3, 3, 190, 87, 200, 3, 3, + 182, 3, 3, 3, 3, 3, 3, 3, + 7, 0, 87, 3, 3, 3, 190, 3, + 3, 3, 190, 87, 200, 3, 3, 3, + 7, 7, 87, 3, 3, 3, 190, 3, + 75, 3, 3, 190, 87, 200, 3, 3, + 84, 99, 78, 78, 0, 0, 150, 154, + 78, 78, 0, 7, 150, 154, 78, 78, + 220, 226, 78, 78, 7, 0, 150, 154, + 78, 78, 220, 226, 78, 78, 7, 7, + 150, 154, 78, 78, 75, 220, 226, 99, + 69, 0, 0, 0, 0, 0, 49, 0, + 0, 0, 0, 13, 0, 15, 0, 17, + 0, 0, 3, 3, 0, 0, 0, 0, + 0, 0, 0, 3, 3, 0, 0, 0, + 71, 0, 0, 0, 0, 19, 51, 19, + 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 55, 0, 114, 0, 53, 0, + 19, 3, 3, 81, 5, 0, 5, 93, + 5, 0, 90, 5, 5, 0, 96, 0, + 0, 0, 1, 25, 25, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 61, 59, 0, 0, 0, + 174, 23, 0, 0, 11, 0, 108, 11, + 166, 57, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 3, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 3, 0, + 0, 35, 0, 33, 123, 31, 37, 135, + 41, 0, 39, 126, 31, 43, 138, 47, + 141, 45, 129, 0 +}; + +static final short[] _hpricot_scan_to_state_actions = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 27, 0, + 27, 0, 27, 0 +}; + +static final short[] _hpricot_scan_from_state_actions = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 29, 0, + 29, 0, 29, 0 +}; + +static final int hpricot_scan_start = 204; + +static final int hpricot_scan_error = -1; + + +public final static int BUFSIZE=16384; + +private void rb_yield_tokens(IRubyObject sym, IRubyObject tag, IRubyObject attr, IRubyObject raw, boolean taint) { + IRubyObject ary; + if (sym == runtime.newSymbol("text")) { + raw = tag; + } + ary = runtime.newArray(new IRubyObject[]{sym, tag, attr, raw}); + if (taint) { + ary.setTaint(true); + tag.setTaint(true); + attr.setTaint(true); + raw.setTaint(true); + } + block.yield(runtime.getCurrentContext(), ary, null, null, false); +} + + +int cs, act, have = 0, nread = 0, curline = 1, p=-1; +boolean text = false; +int tokstart=-1, tokend; +char[] buf; +Ruby runtime; +IRubyObject attr, bufsize; +IRubyObject[] tag, akey, aval; +int mark_tag, mark_akey, mark_aval; +boolean done = false, ele_open = false; +int buffer_size = 0; +boolean taint = false; +Block block = null; + + +IRubyObject xmldecl, doctype, procins, stag, etag, emptytag, comment, + cdata, sym_text; + +IRubyObject hpricot_scan(IRubyObject recv, IRubyObject port) { + attr = bufsize = runtime.getNil(); + tag = new IRubyObject[]{runtime.getNil()}; + akey = new IRubyObject[]{runtime.getNil()}; + aval = new IRubyObject[]{runtime.getNil()}; + + RubyClass rb_eHpricotParseError = runtime.getModule("Hpricot").getClass("ParseError"); + + taint = port.isTaint(); + if ( !port.respondsTo("read")) { + if ( port.respondsTo("to_str")) { + port = port.callMethod(runtime.getCurrentContext(),"to_str"); + } else { + throw runtime.newArgumentError("bad Hpricot argument, String or IO only please."); + } + } + + buffer_size = BUFSIZE; + if (recv.getInstanceVariable("@buffer_size") != null) { + bufsize = recv.getInstanceVariable("@buffer_size"); + if (!bufsize.isNil()) { + buffer_size = RubyNumeric.fix2int(bufsize); + } + } + buf = new char[buffer_size]; + + + { + cs = hpricot_scan_start; + tokstart = -1; + tokend = -1; + act = 0; + } + + while( !done ) { + IRubyObject str; + p = have; + int pe; + int len, space = buffer_size - have; + + if ( space == 0 ) { + /* We've used up the entire buffer storing an already-parsed token + * prefix that must be preserved. Likely caused by super-long attributes. + * See ticket #13. */ + rb_raise(rb_eHpricotParseError, "ran out of buffer space on element <" + tag.toString() + ">, starting on line "+curline+"."); + } + + if (port.respondsTo("read")) { + str = port.callMethod(runtime.getCurrentContext(),"read",runtime.newFixnum(space)); + } else { + str = ((RubyString)port).substr(nread,space); + } + + str = str.convertToString(); + String sss = str.toString(); + char[] chars = sss.toCharArray(); + System.arraycopy(chars,0,buf,p,chars.length); + + len = sss.length(); + nread += len; + + if ( len < space ) { + len++; + done = true; + } + + pe = p + len; + char[] data = buf; + + + { + int _klen; + int _trans; + int _acts; + int _nacts; + int _keys; + + if ( p != pe ) { + _resume: while ( true ) { + _again: do { + _acts = _hpricot_scan_from_state_actions[cs]; + _nacts = (int) _hpricot_scan_actions[_acts++]; + while ( _nacts-- > 0 ) { + switch ( _hpricot_scan_actions[_acts++] ) { + case 21: + {tokstart = p;} + break; + } + } + + _match: do { + _keys = _hpricot_scan_key_offsets[cs]; + _trans = _hpricot_scan_index_offsets[cs]; + _klen = _hpricot_scan_single_lengths[cs]; + if ( _klen > 0 ) { + int _lower = _keys; + int _mid; + int _upper = _keys + _klen - 1; + while (true) { + if ( _upper < _lower ) + break; + + _mid = _lower + ((_upper-_lower) >> 1); + if ( data[p] < _hpricot_scan_trans_keys[_mid] ) + _upper = _mid - 1; + else if ( data[p] > _hpricot_scan_trans_keys[_mid] ) + _lower = _mid + 1; + else { + _trans += (_mid - _keys); + break _match; + } + } + _keys += _klen; + _trans += _klen; + } + + _klen = _hpricot_scan_range_lengths[cs]; + if ( _klen > 0 ) { + int _lower = _keys; + int _mid; + int _upper = _keys + (_klen<<1) - 2; + while (true) { + if ( _upper < _lower ) + break; + + _mid = _lower + (((_upper-_lower) >> 1) & ~1); + if ( data[p] < _hpricot_scan_trans_keys[_mid] ) + _upper = _mid - 2; + else if ( data[p] > _hpricot_scan_trans_keys[_mid+1] ) + _lower = _mid + 2; + else { + _trans += ((_mid - _keys)>>1); + break _match; + } + } + _trans += _klen; + } + } while (false); + + _trans = _hpricot_scan_indicies[_trans]; + cs = _hpricot_scan_trans_targs_wi[_trans]; + + if ( _hpricot_scan_trans_actions_wi[_trans] == 0 ) + break _again; + + _acts = _hpricot_scan_trans_actions_wi[_trans]; + _nacts = (int) _hpricot_scan_actions[_acts++]; + while ( _nacts-- > 0 ) + { + switch ( _hpricot_scan_actions[_acts++] ) + { + case 0: + { + if (text) { + CAT(tag, p); + ELE(sym_text); + text = false; + } + attr = runtime.getNil(); + tag[0] = runtime.getNil(); + mark_tag = -1; + ele_open = true; + } + break; + case 1: + { mark_tag = p; } + break; + case 2: + { mark_aval = p; } + break; + case 3: + { mark_akey = p; } + break; + case 4: + { SET(tag, p); } + break; + case 5: + { SET(aval, p); } + break; + case 6: + { + if (buf[p-1] == '"' || buf[p-1] == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + break; + case 7: + { SET(akey, p); } + break; + case 8: + { SET(aval, p); ATTR(rb_str_new2("version"), aval); } + break; + case 9: + { SET(aval, p); ATTR(rb_str_new2("encoding"), aval); } + break; + case 10: + { SET(aval, p); ATTR(rb_str_new2("standalone"), aval); } + break; + case 11: + { SET(aval, p); ATTR(rb_str_new2("public_id"), aval); } + break; + case 12: + { SET(aval, p); ATTR(rb_str_new2("system_id"), aval); } + break; + case 13: + { + akey[0] = runtime.getNil(); + aval[0] = runtime.getNil(); + mark_akey = -1; + mark_aval = -1; + } + break; + case 14: + { + ATTR(akey, aval); + } + break; + case 15: + {curline += 1;} + break; + case 16: + { TEXT_PASS(); } + break; + case 17: + { EBLK(comment, 3); {cs = 204; if (true) break _again;} } + break; + case 18: + { EBLK(cdata, 3); {cs = 204; if (true) break _again;} } + break; + case 19: + { EBLK(procins, 2); {cs = 204; if (true) break _again;} } + break; + case 22: + {tokend = p+1;} + break; + case 23: + {tokend = p+1;{p = ((tokend))-1;}} + break; + case 24: + {tokend = p+1;{ TEXT_PASS(); }{p = ((tokend))-1;}} + break; + case 25: + {tokend = p;{ TEXT_PASS(); }{p = ((tokend))-1;}} + break; + case 26: + {{ TEXT_PASS(); }{p = ((tokend))-1;}} + break; + case 27: + {tokend = p+1;{p = ((tokend))-1;}} + break; + case 28: + {tokend = p+1;{ TEXT_PASS(); }{p = ((tokend))-1;}} + break; + case 29: + {tokend = p;{ TEXT_PASS(); }{p = ((tokend))-1;}} + break; + case 30: + {{ TEXT_PASS(); }{p = ((tokend))-1;}} + break; + case 31: + {tokend = p+1;{p = ((tokend))-1;}} + break; + case 32: + {tokend = p+1;{ TEXT_PASS(); }{p = ((tokend))-1;}} + break; + case 33: + {tokend = p;{ TEXT_PASS(); }{p = ((tokend))-1;}} + break; + case 34: + {act = 8;} + break; + case 35: + {act = 10;} + break; + case 36: + {act = 12;} + break; + case 37: + {act = 15;} + break; + case 38: + {tokend = p+1;{ ELE(xmldecl); }{p = ((tokend))-1;}} + break; + case 39: + {tokend = p+1;{ ELE(doctype); }{p = ((tokend))-1;}} + break; + case 40: + {tokend = p+1;{ ELE(stag); }{p = ((tokend))-1;}} + break; + case 41: + {tokend = p+1;{ ELE(etag); }{p = ((tokend))-1;}} + break; + case 42: + {tokend = p+1;{ ELE(emptytag); }{p = ((tokend))-1;}} + break; + case 43: + {tokend = p+1;{ {{p = ((tokend))-1;}{cs = 214; if (true) break _again;}} }{p = ((tokend))-1;}} + break; + case 44: + {tokend = p+1;{ {{p = ((tokend))-1;}{cs = 216; if (true) break _again;}} }{p = ((tokend))-1;}} + break; + case 45: + {tokend = p+1;{ TEXT_PASS(); }{p = ((tokend))-1;}} + break; + case 46: + {tokend = p;{ {{p = ((tokend))-1;}{cs = 218; if (true) break _again;}} }{p = ((tokend))-1;}} + break; + case 47: + {tokend = p;{ TEXT_PASS(); }{p = ((tokend))-1;}} + break; + case 48: + {{ {{p = ((tokend))-1;}{cs = 218; if (true) break _again;}} }{p = ((tokend))-1;}} + break; + case 49: + {{ TEXT_PASS(); }{p = ((tokend))-1;}} + break; + case 50: + { switch( act ) { + case 8: + { ELE(doctype); } + break; + case 10: + { ELE(stag); } + break; + case 12: + { ELE(emptytag); } + break; + case 15: + { TEXT_PASS(); } + break; + default: break; + } + {p = ((tokend))-1;}} + break; + } + } + + } while (false); + _acts = _hpricot_scan_to_state_actions[cs]; + _nacts = (int) _hpricot_scan_actions[_acts++]; + while ( _nacts-- > 0 ) { + switch ( _hpricot_scan_actions[_acts++] ) { + case 20: + {tokstart = -1;} + break; + } + } + + if ( ++p == pe ) + break _resume; + } + } + } + + if ( cs == hpricot_scan_error ) { + if(!tag[0].isNil()) { + rb_raise(rb_eHpricotParseError, "parse error on element <"+tag.toString()+">, starting on line "+curline+".\n" + NO_WAY_SERIOUSLY); + } else { + rb_raise(rb_eHpricotParseError, "parse error on line "+curline+".\n" + NO_WAY_SERIOUSLY); + } + } + + if ( done && ele_open ) { + ele_open = false; + if(tokstart > -1) { + mark_tag = tokstart; + tokstart = -1; + text = true; + } + } + + if(tokstart == -1) { + have = 0; + /* text nodes have no tokstart because each byte is parsed alone */ + if(mark_tag != -1 && text) { + if (done) { + if(mark_tag < p-1) { + CAT(tag, p-1); + ELE(sym_text); + } + } else { + CAT(tag, p); + } + } + mark_tag = 0; + } else { + have = pe - tokstart; + System.arraycopy(buf,tokstart,buf,0,have); + SLIDE(tag); + SLIDE(akey); + SLIDE(aval); + tokend = (tokend - tokstart); + tokstart = 0; + } + } + return runtime.getNil(); +} + +public static IRubyObject __hpricot_scan(IRubyObject recv, IRubyObject port, Block block) { + Ruby runtime = recv.getRuntime(); + HpricotScanService service = new HpricotScanService(); + service.runtime = runtime; + service.xmldecl = runtime.newSymbol("xmldecl"); + service.doctype = runtime.newSymbol("doctype"); + service.procins = runtime.newSymbol("procins"); + service.stag = runtime.newSymbol("stag"); + service.etag = runtime.newSymbol("etag"); + service.emptytag = runtime.newSymbol("emptytag"); + service.comment = runtime.newSymbol("comment"); + service.cdata = runtime.newSymbol("cdata"); + service.sym_text = runtime.newSymbol("text"); + service.block = block; + return service.hpricot_scan(recv, port); +} + + +public boolean basicLoad(final Ruby runtime) throws IOException { + Init_hpricot_scan(runtime); + return true; +} + +public static void Init_hpricot_scan(Ruby runtime) { + RubyModule mHpricot = runtime.defineModule("Hpricot"); + mHpricot.getMetaClass().attr_accessor(new IRubyObject[]{runtime.newSymbol("buffer_size")}); + CallbackFactory fact = runtime.callbackFactory(HpricotScanService.class); + mHpricot.getMetaClass().defineMethod("scan",fact.getSingletonMethod("__hpricot_scan",IRubyObject.class)); + mHpricot.defineClassUnder("ParseError",runtime.getClass("Exception"),runtime.getClass("Exception").getAllocator()); +} +} diff --git a/vendor/gems/hpricot-0.6/ext/hpricot_scan/extconf.rb b/vendor/gems/hpricot-0.6/ext/hpricot_scan/extconf.rb new file mode 100644 index 0000000..c7542eb --- /dev/null +++ b/vendor/gems/hpricot-0.6/ext/hpricot_scan/extconf.rb @@ -0,0 +1,6 @@ +require 'mkmf' + +dir_config("hpricot_scan") +have_library("c", "main") + +create_makefile("hpricot_scan") diff --git a/vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_common.rl b/vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_common.rl new file mode 100644 index 0000000..52d3764 --- /dev/null +++ b/vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_common.rl @@ -0,0 +1,76 @@ +%%{ + + machine hpricot_common; + + # + # HTML tokens + # (a blatant rip from HTree) + # + newline = '\n' @{curline += 1;} ; + NameChar = [\-A-Za-z0-9._:?] ; + Name = [A-Za-z_:] NameChar* ; + StartComment = "" ; + StartCdata = "" ; + + NameCap = Name >_tag %tag; + NameAttr = NameChar+ >_akey %akey ; + Q1Char = ( "\\\'" | [^'] ) ; + Q1Attr = Q1Char* >_aval %aval ; + Q2Char = ( "\\\"" | [^"] ) ; + Q2Attr = Q2Char* >_aval %aval ; + UnqAttr = ( space >_aval | [^ \t\r\n<>"'] >_aval [^ \t\r\n<>]* %aunq ) ; + Nmtoken = NameChar+ >_akey %akey ; + + Attr = NameAttr space* "=" space* ('"' Q2Attr '"' | "'" Q1Attr "'" | UnqAttr space+ ) space* ; + AttrEnd = ( NameAttr space* "=" space* UnqAttr? | Nmtoken >new_attr %save_attr ) ; + AttrSet = ( Attr >new_attr %save_attr | Nmtoken >new_attr space+ %save_attr ) ; + StartTag = "<" NameCap space+ AttrSet* (AttrEnd >new_attr %save_attr)? ">" | "<" NameCap ">"; + EmptyTag = "<" NameCap space+ AttrSet* (AttrEnd >new_attr %save_attr)? "/>" | "<" NameCap "/>" ; + + EndTag = "" ; + XmlVersionNum = [a-zA-Z0-9_.:\-]+ >_aval %xmlver ; + XmlVersionInfo = space+ "version" space* "=" space* ("'" XmlVersionNum "'" | '"' XmlVersionNum '"' ) ; + XmlEncName = [A-Za-z] >_aval [A-Za-z0-9._\-]* %xmlenc ; + XmlEncodingDecl = space+ "encoding" space* "=" space* ("'" XmlEncName "'" | '"' XmlEncName '"' ) ; + XmlYesNo = ("yes" | "no") >_aval %xmlsd ; + XmlSDDecl = space+ "standalone" space* "=" space* ("'" XmlYesNo "'" | '"' XmlYesNo '"') ; + XmlDecl = "" ; + + SystemLiteral = '"' [^"]* >_aval %sysid '"' | "'" [^']* >_aval %sysid "'" ; + PubidLiteral = '"' [\t a-zA-Z0-9\-'()+,./:=?;!*\#@$_%]* >_aval %pubid '"' | + "'" [\t a-zA-Z0-9\-'()+,./:=?;!*\#@$_%]* >_aval %pubid "'" ; + ExternalID = ( "SYSTEM" | "PUBLIC" space+ PubidLiteral ) (space+ SystemLiteral)? ; + DocType = "" ; + StartXmlProcIns = "{ TEXT_PASS(); } space+ ; + EndXmlProcIns = "?"? ">" ; + + html_comment := |* + EndComment @{ EBLK(comment, 3); fgoto main; }; + any | newline { TEXT_PASS(); }; + *|; + + html_cdata := |* + EndCdata @{ EBLK(cdata, 3); fgoto main; }; + any | newline { TEXT_PASS(); }; + *|; + + html_procins := |* + EndXmlProcIns @{ EBLK(procins, 2); fgoto main; }; + any | newline { TEXT_PASS(); }; + *|; + + main := |* + XmlDecl >newEle { ELE(xmldecl); }; + DocType >newEle { ELE(doctype); }; + StartXmlProcIns >newEle { fgoto html_procins; }; + StartTag >newEle { ELE(stag); }; + EndTag >newEle { ELE(etag); }; + EmptyTag >newEle { ELE(emptytag); }; + StartComment >newEle { fgoto html_comment; }; + StartCdata >newEle { fgoto html_cdata; }; + any | newline { TEXT_PASS(); }; + *|; + +}%%; diff --git a/vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.c b/vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.c new file mode 100644 index 0000000..15db082 --- /dev/null +++ b/vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.c @@ -0,0 +1,5976 @@ +#line 1 "ext/hpricot_scan/hpricot_scan.rl" +/* + * hpricot_scan.rl + * + * $Author: why $ + * $Date: 2006-05-08 22:03:50 -0600 (Mon, 08 May 2006) $ + * + * Copyright (C) 2006 why the lucky stiff + */ +#include + +#define NO_WAY_SERIOUSLY "*** This should not happen, please send a bug report with the HTML you're parsing to why@whytheluckystiff.net. So sorry!" + +static VALUE sym_xmldecl, sym_doctype, sym_procins, sym_stag, sym_etag, sym_emptytag, sym_comment, + sym_cdata, sym_text; +static VALUE rb_eHpricotParseError; +static ID s_read, s_to_str; + +#define ELE(N) \ + if (tokend > tokstart || text == 1) { \ + VALUE raw_string = Qnil; \ + ele_open = 0; text = 0; \ + if (tokstart != 0 && sym_##N != sym_cdata && sym_##N != sym_text && sym_##N != sym_procins && sym_##N != sym_comment) { \ + raw_string = rb_str_new(tokstart, tokend-tokstart); \ + } \ + rb_yield_tokens(sym_##N, tag, attr, raw_string, taint); \ + } + +#define SET(N, E) \ + if (mark_##N == NULL || E == mark_##N) \ + N = rb_str_new2(""); \ + else if (E > mark_##N) \ + N = rb_str_new(mark_##N, E - mark_##N); + +#define CAT(N, E) if (NIL_P(N)) { SET(N, E); } else { rb_str_cat(N, mark_##N, E - mark_##N); } + +#define SLIDE(N) if ( mark_##N > tokstart ) mark_##N = buf + (mark_##N - tokstart); + +#define ATTR(K, V) \ + if (!NIL_P(K)) { \ + if (NIL_P(attr)) attr = rb_hash_new(); \ + rb_hash_aset(attr, K, V); \ + } + +#define TEXT_PASS() \ + if (text == 0) \ + { \ + if (ele_open == 1) { \ + ele_open = 0; \ + if (tokstart > 0) { \ + mark_tag = tokstart; \ + } \ + } else { \ + mark_tag = p; \ + } \ + attr = Qnil; \ + tag = Qnil; \ + text = 1; \ + } + +#define EBLK(N, T) CAT(tag, p - T + 1); ELE(N); + +#line 107 "ext/hpricot_scan/hpricot_scan.rl" + + + +#line 68 "ext/hpricot_scan/hpricot_scan.c" +static const int hpricot_scan_start = 204; + +static const int hpricot_scan_error = -1; + +#line 110 "ext/hpricot_scan/hpricot_scan.rl" + +#define BUFSIZE 16384 + +void rb_yield_tokens(VALUE sym, VALUE tag, VALUE attr, VALUE raw, int taint) +{ + VALUE ary; + if (sym == sym_text) { + raw = tag; + } + ary = rb_ary_new3(4, sym, tag, attr, raw); + if (taint) { + OBJ_TAINT(ary); + OBJ_TAINT(tag); + OBJ_TAINT(attr); + OBJ_TAINT(raw); + } + rb_yield(ary); +} + +VALUE hpricot_scan(VALUE self, VALUE port) +{ + int cs, act, have = 0, nread = 0, curline = 1, text = 0; + char *tokstart = 0, *tokend = 0, *buf = NULL; + + VALUE attr = Qnil, tag = Qnil, akey = Qnil, aval = Qnil, bufsize = Qnil; + char *mark_tag = 0, *mark_akey = 0, *mark_aval = 0; + int done = 0, ele_open = 0, buffer_size = 0; + + int taint = OBJ_TAINTED( port ); + if ( !rb_respond_to( port, s_read ) ) + { + if ( rb_respond_to( port, s_to_str ) ) + { + port = rb_funcall( port, s_to_str, 0 ); + StringValue(port); + } + else + { + rb_raise( rb_eArgError, "bad Hpricot argument, String or IO only please." ); + } + } + + buffer_size = BUFSIZE; + if (rb_ivar_defined(self, rb_intern("@buffer_size")) == Qtrue) { + bufsize = rb_ivar_get(self, rb_intern("@buffer_size")); + if (!NIL_P(bufsize)) { + buffer_size = NUM2INT(bufsize); + } + } + buf = ALLOC_N(char, buffer_size); + + +#line 126 "ext/hpricot_scan/hpricot_scan.c" + { + cs = hpricot_scan_start; + tokstart = 0; + tokend = 0; + act = 0; + } +#line 162 "ext/hpricot_scan/hpricot_scan.rl" + + while ( !done ) { + VALUE str; + char *p = buf + have, *pe; + int len, space = buffer_size - have; + + if ( space == 0 ) { + /* We've used up the entire buffer storing an already-parsed token + * prefix that must be preserved. Likely caused by super-long attributes. + * See ticket #13. */ + rb_raise(rb_eHpricotParseError, "ran out of buffer space on element <%s>, starting on line %d.", RSTRING(tag)->ptr, curline); + } + + if ( rb_respond_to( port, s_read ) ) + { + str = rb_funcall( port, s_read, 1, INT2FIX(space) ); + } + else + { + str = rb_str_substr( port, nread, space ); + } + + StringValue(str); + memcpy( p, RSTRING(str)->ptr, RSTRING(str)->len ); + len = RSTRING(str)->len; + nread += len; + + /* If this is the last buffer, tack on an EOF. */ + if ( len < space ) { + p[len++] = 0; + done = 1; + } + + pe = p + len; + +#line 169 "ext/hpricot_scan/hpricot_scan.c" + { + if ( p == pe ) + goto _out; + switch ( cs ) + { +tr14: +#line 67 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p;{ {{p = ((tokend))-1;}{goto st218;}} }{p = ((tokend))-1;}} + goto st204; +tr18: +#line 73 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p;{ TEXT_PASS(); }{p = ((tokend))-1;}} + goto st204; +tr23: +#line 73 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ TEXT_PASS(); }{p = ((tokend))-1;}} + goto st204; +tr24: +#line 9 "ext/hpricot_scan/hpricot_scan.rl" + {curline += 1;} +#line 73 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ TEXT_PASS(); }{p = ((tokend))-1;}} + goto st204; +tr69: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + { switch( act ) { + case 8: + { ELE(doctype); } + break; + case 10: + { ELE(stag); } + break; + case 12: + { ELE(emptytag); } + break; + case 15: + { TEXT_PASS(); } + break; + default: break; + } + {p = ((tokend))-1;}} + goto st204; +tr70: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ ELE(stag); }{p = ((tokend))-1;}} + goto st204; +tr76: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ ELE(stag); }{p = ((tokend))-1;}} + goto st204; +tr137: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ ELE(stag); }{p = ((tokend))-1;}} + goto st204; +tr162: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ ELE(stag); }{p = ((tokend))-1;}} + goto st204; +tr264: +#line 67 "ext/hpricot_scan/hpricot_scan.rl" + {{ {{p = ((tokend))-1;}{goto st218;}} }{p = ((tokend))-1;}} + goto st204; +tr270: +#line 65 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ ELE(xmldecl); }{p = ((tokend))-1;}} + goto st204; +tr296: +#line 73 "ext/hpricot_scan/hpricot_scan.rl" + {{ TEXT_PASS(); }{p = ((tokend))-1;}} + goto st204; +tr302: +#line 66 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ ELE(doctype); }{p = ((tokend))-1;}} + goto st204; +tr314: +#line 69 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ ELE(etag); }{p = ((tokend))-1;}} + goto st204; +tr318: +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ ELE(stag); }{p = ((tokend))-1;}} + goto st204; +tr327: +#line 80 "ext/hpricot_scan/hpricot_scan.rl" + { SET(tag, p); } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ ELE(stag); }{p = ((tokend))-1;}} + goto st204; +tr330: +#line 80 "ext/hpricot_scan/hpricot_scan.rl" + { SET(tag, p); } +#line 66 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ ELE(doctype); }{p = ((tokend))-1;}} + goto st204; +tr334: +#line 80 "ext/hpricot_scan/hpricot_scan.rl" + { SET(tag, p); } +#line 69 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ ELE(etag); }{p = ((tokend))-1;}} + goto st204; +tr355: +#line 72 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ {{p = ((tokend))-1;}{goto st216;}} }{p = ((tokend))-1;}} + goto st204; +tr356: +#line 71 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ {{p = ((tokend))-1;}{goto st214;}} }{p = ((tokend))-1;}} + goto st204; +tr368: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ ELE(stag); }{p = ((tokend))-1;}} + goto st204; +tr369: +#line 70 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ ELE(emptytag); }{p = ((tokend))-1;}} + goto st204; +st204: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokstart = 0;} + if ( ++p == pe ) + goto _out204; +case 204: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokstart = p;} +#line 333 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 10: goto tr24; + case 60: goto tr25; + } + goto tr23; +tr25: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 65 "ext/hpricot_scan/hpricot_scan.rl" + { + if (text == 1) { + CAT(tag, p); + ELE(text); + text = 0; + } + attr = Qnil; + tag = Qnil; + mark_tag = NULL; + ele_open = 1; + } +#line 73 "ext/hpricot_scan/hpricot_scan.rl" + {act = 15;} + goto st205; +st205: + if ( ++p == pe ) + goto _out205; +case 205: +#line 361 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 33: goto st0; + case 47: goto st59; + case 58: goto tr21; + case 63: goto st145; + case 95: goto tr21; + } + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr21; + } else if ( (*p) >= 65 ) + goto tr21; + goto tr18; +st0: + if ( ++p == pe ) + goto _out0; +case 0: + switch( (*p) ) { + case 45: goto st1; + case 68: goto st2; + case 91: goto st53; + } + goto tr296; +st1: + if ( ++p == pe ) + goto _out1; +case 1: + if ( (*p) == 45 ) + goto tr356; + goto tr296; +st2: + if ( ++p == pe ) + goto _out2; +case 2: + if ( (*p) == 79 ) + goto st3; + goto tr296; +st3: + if ( ++p == pe ) + goto _out3; +case 3: + if ( (*p) == 67 ) + goto st4; + goto tr296; +st4: + if ( ++p == pe ) + goto _out4; +case 4: + if ( (*p) == 84 ) + goto st5; + goto tr296; +st5: + if ( ++p == pe ) + goto _out5; +case 5: + if ( (*p) == 89 ) + goto st6; + goto tr296; +st6: + if ( ++p == pe ) + goto _out6; +case 6: + if ( (*p) == 80 ) + goto st7; + goto tr296; +st7: + if ( ++p == pe ) + goto _out7; +case 7: + if ( (*p) == 69 ) + goto st8; + goto tr296; +st8: + if ( ++p == pe ) + goto _out8; +case 8: + if ( (*p) == 32 ) + goto st9; + if ( 9 <= (*p) && (*p) <= 13 ) + goto st9; + goto tr296; +st9: + if ( ++p == pe ) + goto _out9; +case 9: + switch( (*p) ) { + case 32: goto st9; + case 58: goto tr309; + case 95: goto tr309; + } + if ( (*p) < 65 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto st9; + } else if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr309; + } else + goto tr309; + goto tr296; +tr309: +#line 77 "ext/hpricot_scan/hpricot_scan.rl" + { mark_tag = p; } + goto st10; +st10: + if ( ++p == pe ) + goto _out10; +case 10: +#line 469 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto tr328; + case 62: goto tr330; + case 63: goto st10; + case 91: goto tr331; + case 95: goto st10; + } + if ( (*p) < 48 ) { + if ( (*p) > 13 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st10; + } else if ( (*p) >= 9 ) + goto tr328; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st10; + } else if ( (*p) >= 65 ) + goto st10; + } else + goto st10; + goto tr296; +tr328: +#line 80 "ext/hpricot_scan/hpricot_scan.rl" + { SET(tag, p); } + goto st11; +st11: + if ( ++p == pe ) + goto _out11; +case 11: +#line 500 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st11; + case 62: goto tr302; + case 80: goto st12; + case 83: goto st48; + case 91: goto st26; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st11; + goto tr296; +st12: + if ( ++p == pe ) + goto _out12; +case 12: + if ( (*p) == 85 ) + goto st13; + goto tr296; +st13: + if ( ++p == pe ) + goto _out13; +case 13: + if ( (*p) == 66 ) + goto st14; + goto tr296; +st14: + if ( ++p == pe ) + goto _out14; +case 14: + if ( (*p) == 76 ) + goto st15; + goto tr296; +st15: + if ( ++p == pe ) + goto _out15; +case 15: + if ( (*p) == 73 ) + goto st16; + goto tr296; +st16: + if ( ++p == pe ) + goto _out16; +case 16: + if ( (*p) == 67 ) + goto st17; + goto tr296; +st17: + if ( ++p == pe ) + goto _out17; +case 17: + if ( (*p) == 32 ) + goto st18; + if ( 9 <= (*p) && (*p) <= 13 ) + goto st18; + goto tr296; +st18: + if ( ++p == pe ) + goto _out18; +case 18: + switch( (*p) ) { + case 32: goto st18; + case 34: goto st19; + case 39: goto st30; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st18; + goto tr296; +st19: + if ( ++p == pe ) + goto _out19; +case 19: + switch( (*p) ) { + case 9: goto tr321; + case 34: goto tr320; + case 61: goto tr321; + case 95: goto tr321; + } + if ( (*p) < 39 ) { + if ( 32 <= (*p) && (*p) <= 37 ) + goto tr321; + } else if ( (*p) > 59 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr321; + } else if ( (*p) >= 63 ) + goto tr321; + } else + goto tr321; + goto tr296; +tr321: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st20; +st20: + if ( ++p == pe ) + goto _out20; +case 20: +#line 597 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 9: goto st20; + case 34: goto tr320; + case 61: goto st20; + case 95: goto st20; + } + if ( (*p) < 39 ) { + if ( 32 <= (*p) && (*p) <= 37 ) + goto st20; + } else if ( (*p) > 59 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st20; + } else if ( (*p) >= 63 ) + goto st20; + } else + goto st20; + goto tr296; +tr320: +#line 91 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); ATTR(rb_str_new2("public_id"), aval); } + goto st21; +st21: + if ( ++p == pe ) + goto _out21; +case 21: +#line 624 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st22; + case 62: goto tr302; + case 91: goto st26; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st22; + goto tr296; +st22: + if ( ++p == pe ) + goto _out22; +case 22: + switch( (*p) ) { + case 32: goto st22; + case 34: goto st23; + case 39: goto st28; + case 62: goto tr302; + case 91: goto st26; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st22; + goto tr296; +st23: + if ( ++p == pe ) + goto _out23; +case 23: + if ( (*p) == 34 ) + goto tr6; + goto tr222; +tr222: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st24; +st24: + if ( ++p == pe ) + goto _out24; +case 24: +#line 662 "ext/hpricot_scan/hpricot_scan.c" + if ( (*p) == 34 ) + goto tr6; + goto st24; +tr6: +#line 92 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); ATTR(rb_str_new2("system_id"), aval); } + goto st25; +st25: + if ( ++p == pe ) + goto _out25; +case 25: +#line 674 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st25; + case 62: goto tr302; + case 91: goto st26; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st25; + goto tr69; +tr331: +#line 80 "ext/hpricot_scan/hpricot_scan.rl" + { SET(tag, p); } + goto st26; +st26: + if ( ++p == pe ) + goto _out26; +case 26: +#line 691 "ext/hpricot_scan/hpricot_scan.c" + if ( (*p) == 93 ) + goto st27; + goto st26; +st27: + if ( ++p == pe ) + goto _out27; +case 27: + switch( (*p) ) { + case 32: goto st27; + case 62: goto tr302; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st27; + goto tr69; +st28: + if ( ++p == pe ) + goto _out28; +case 28: + if ( (*p) == 39 ) + goto tr6; + goto tr182; +tr182: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st29; +st29: + if ( ++p == pe ) + goto _out29; +case 29: +#line 721 "ext/hpricot_scan/hpricot_scan.c" + if ( (*p) == 39 ) + goto tr6; + goto st29; +st30: + if ( ++p == pe ) + goto _out30; +case 30: + switch( (*p) ) { + case 9: goto tr322; + case 39: goto tr323; + case 61: goto tr322; + case 95: goto tr322; + } + if ( (*p) < 40 ) { + if ( (*p) > 33 ) { + if ( 35 <= (*p) && (*p) <= 37 ) + goto tr322; + } else if ( (*p) >= 32 ) + goto tr322; + } else if ( (*p) > 59 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr322; + } else if ( (*p) >= 63 ) + goto tr322; + } else + goto tr322; + goto tr296; +tr322: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st31; +st31: + if ( ++p == pe ) + goto _out31; +case 31: +#line 758 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 9: goto st31; + case 39: goto tr303; + case 61: goto st31; + case 95: goto st31; + } + if ( (*p) < 40 ) { + if ( (*p) > 33 ) { + if ( 35 <= (*p) && (*p) <= 37 ) + goto st31; + } else if ( (*p) >= 32 ) + goto st31; + } else if ( (*p) > 59 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st31; + } else if ( (*p) >= 63 ) + goto st31; + } else + goto st31; + goto tr296; +tr42: +#line 91 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); ATTR(rb_str_new2("public_id"), aval); } +#line 92 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); ATTR(rb_str_new2("system_id"), aval); } + goto st32; +tr303: +#line 91 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); ATTR(rb_str_new2("public_id"), aval); } + goto st32; +tr323: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 91 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); ATTR(rb_str_new2("public_id"), aval); } + goto st32; +st32: + if ( ++p == pe ) + goto _out32; +case 32: +#line 800 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 9: goto st33; + case 32: goto st33; + case 33: goto st31; + case 39: goto tr303; + case 62: goto tr302; + case 91: goto st26; + case 95: goto st31; + } + if ( (*p) < 40 ) { + if ( (*p) > 13 ) { + if ( 35 <= (*p) && (*p) <= 37 ) + goto st31; + } else if ( (*p) >= 10 ) + goto st22; + } else if ( (*p) > 59 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st31; + } else if ( (*p) >= 61 ) + goto st31; + } else + goto st31; + goto tr296; +st33: + if ( ++p == pe ) + goto _out33; +case 33: + switch( (*p) ) { + case 9: goto st33; + case 32: goto st33; + case 34: goto st23; + case 39: goto tr301; + case 62: goto tr302; + case 91: goto st26; + case 95: goto st31; + } + if ( (*p) < 40 ) { + if ( (*p) > 13 ) { + if ( 33 <= (*p) && (*p) <= 37 ) + goto st31; + } else if ( (*p) >= 10 ) + goto st22; + } else if ( (*p) > 59 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st31; + } else if ( (*p) >= 61 ) + goto st31; + } else + goto st31; + goto tr296; +tr44: +#line 91 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); ATTR(rb_str_new2("public_id"), aval); } +#line 92 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); ATTR(rb_str_new2("system_id"), aval); } + goto st34; +tr301: +#line 91 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); ATTR(rb_str_new2("public_id"), aval); } + goto st34; +st34: + if ( ++p == pe ) + goto _out34; +case 34: +#line 867 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 9: goto tr186; + case 32: goto tr186; + case 33: goto tr188; + case 39: goto tr42; + case 62: goto tr184; + case 91: goto tr185; + case 95: goto tr188; + } + if ( (*p) < 40 ) { + if ( (*p) > 13 ) { + if ( 35 <= (*p) && (*p) <= 37 ) + goto tr188; + } else if ( (*p) >= 10 ) + goto tr187; + } else if ( (*p) > 59 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr188; + } else if ( (*p) >= 61 ) + goto tr188; + } else + goto tr188; + goto tr182; +tr186: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st35; +st35: + if ( ++p == pe ) + goto _out35; +case 35: +#line 900 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 9: goto st35; + case 32: goto st35; + case 34: goto st37; + case 39: goto tr44; + case 62: goto tr40; + case 91: goto st40; + case 95: goto st47; + } + if ( (*p) < 40 ) { + if ( (*p) > 13 ) { + if ( 33 <= (*p) && (*p) <= 37 ) + goto st47; + } else if ( (*p) >= 10 ) + goto st36; + } else if ( (*p) > 59 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st47; + } else if ( (*p) >= 61 ) + goto st47; + } else + goto st47; + goto st29; +tr187: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st36; +st36: + if ( ++p == pe ) + goto _out36; +case 36: +#line 933 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st36; + case 34: goto st37; + case 39: goto tr39; + case 62: goto tr40; + case 91: goto st40; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st36; + goto st29; +st37: + if ( ++p == pe ) + goto _out37; +case 37: + switch( (*p) ) { + case 34: goto tr63; + case 39: goto tr224; + } + goto tr223; +tr223: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st38; +st38: + if ( ++p == pe ) + goto _out38; +case 38: +#line 961 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 34: goto tr63; + case 39: goto tr64; + } + goto st38; +tr63: +#line 92 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); ATTR(rb_str_new2("system_id"), aval); } + goto st39; +tr183: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st39; +st39: + if ( ++p == pe ) + goto _out39; +case 39: +#line 979 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st39; + case 39: goto tr6; + case 62: goto tr40; + case 91: goto st40; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st39; + goto st29; +tr40: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 66 "ext/hpricot_scan/hpricot_scan.rl" + {act = 8;} + goto st206; +tr184: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 66 "ext/hpricot_scan/hpricot_scan.rl" + {act = 8;} + goto st206; +st206: + if ( ++p == pe ) + goto _out206; +case 206: +#line 1007 "ext/hpricot_scan/hpricot_scan.c" + if ( (*p) == 39 ) + goto tr6; + goto st29; +tr185: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st40; +st40: + if ( ++p == pe ) + goto _out40; +case 40: +#line 1019 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 39: goto tr35; + case 93: goto st42; + } + goto st40; +tr35: +#line 92 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); ATTR(rb_str_new2("system_id"), aval); } + goto st41; +st41: + if ( ++p == pe ) + goto _out41; +case 41: +#line 1033 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st41; + case 62: goto tr27; + case 93: goto st27; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st41; + goto st26; +tr27: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 66 "ext/hpricot_scan/hpricot_scan.rl" + {act = 8;} + goto st207; +st207: + if ( ++p == pe ) + goto _out207; +case 207: +#line 1052 "ext/hpricot_scan/hpricot_scan.c" + if ( (*p) == 93 ) + goto st27; + goto st26; +st42: + if ( ++p == pe ) + goto _out42; +case 42: + switch( (*p) ) { + case 32: goto st42; + case 39: goto tr6; + case 62: goto tr40; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st42; + goto st29; +tr64: +#line 92 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); ATTR(rb_str_new2("system_id"), aval); } + goto st43; +tr224: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 92 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); ATTR(rb_str_new2("system_id"), aval); } + goto st43; +st43: + if ( ++p == pe ) + goto _out43; +case 43: +#line 1082 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st43; + case 34: goto tr6; + case 62: goto tr61; + case 91: goto st44; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st43; + goto st24; +tr61: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 66 "ext/hpricot_scan/hpricot_scan.rl" + {act = 8;} + goto st208; +st208: + if ( ++p == pe ) + goto _out208; +case 208: +#line 1102 "ext/hpricot_scan/hpricot_scan.c" + if ( (*p) == 34 ) + goto tr6; + goto st24; +st44: + if ( ++p == pe ) + goto _out44; +case 44: + switch( (*p) ) { + case 34: goto tr35; + case 93: goto st45; + } + goto st44; +st45: + if ( ++p == pe ) + goto _out45; +case 45: + switch( (*p) ) { + case 32: goto st45; + case 34: goto tr6; + case 62: goto tr61; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st45; + goto st24; +tr39: +#line 92 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); ATTR(rb_str_new2("system_id"), aval); } + goto st46; +st46: + if ( ++p == pe ) + goto _out46; +case 46: +#line 1135 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto tr183; + case 39: goto tr6; + case 62: goto tr184; + case 91: goto tr185; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto tr183; + goto tr182; +tr188: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st47; +st47: + if ( ++p == pe ) + goto _out47; +case 47: +#line 1153 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 9: goto st47; + case 39: goto tr42; + case 61: goto st47; + case 95: goto st47; + } + if ( (*p) < 40 ) { + if ( (*p) > 33 ) { + if ( 35 <= (*p) && (*p) <= 37 ) + goto st47; + } else if ( (*p) >= 32 ) + goto st47; + } else if ( (*p) > 59 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st47; + } else if ( (*p) >= 63 ) + goto st47; + } else + goto st47; + goto st29; +st48: + if ( ++p == pe ) + goto _out48; +case 48: + if ( (*p) == 89 ) + goto st49; + goto tr296; +st49: + if ( ++p == pe ) + goto _out49; +case 49: + if ( (*p) == 83 ) + goto st50; + goto tr296; +st50: + if ( ++p == pe ) + goto _out50; +case 50: + if ( (*p) == 84 ) + goto st51; + goto tr296; +st51: + if ( ++p == pe ) + goto _out51; +case 51: + if ( (*p) == 69 ) + goto st52; + goto tr296; +st52: + if ( ++p == pe ) + goto _out52; +case 52: + if ( (*p) == 77 ) + goto st21; + goto tr296; +st53: + if ( ++p == pe ) + goto _out53; +case 53: + if ( (*p) == 67 ) + goto st54; + goto tr296; +st54: + if ( ++p == pe ) + goto _out54; +case 54: + if ( (*p) == 68 ) + goto st55; + goto tr296; +st55: + if ( ++p == pe ) + goto _out55; +case 55: + if ( (*p) == 65 ) + goto st56; + goto tr296; +st56: + if ( ++p == pe ) + goto _out56; +case 56: + if ( (*p) == 84 ) + goto st57; + goto tr296; +st57: + if ( ++p == pe ) + goto _out57; +case 57: + if ( (*p) == 65 ) + goto st58; + goto tr296; +st58: + if ( ++p == pe ) + goto _out58; +case 58: + if ( (*p) == 91 ) + goto tr355; + goto tr296; +st59: + if ( ++p == pe ) + goto _out59; +case 59: + switch( (*p) ) { + case 58: goto tr338; + case 95: goto tr338; + } + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr338; + } else if ( (*p) >= 65 ) + goto tr338; + goto tr296; +tr338: +#line 77 "ext/hpricot_scan/hpricot_scan.rl" + { mark_tag = p; } + goto st60; +st60: + if ( ++p == pe ) + goto _out60; +case 60: +#line 1274 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto tr332; + case 62: goto tr334; + case 63: goto st60; + case 95: goto st60; + } + if ( (*p) < 48 ) { + if ( (*p) > 13 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st60; + } else if ( (*p) >= 9 ) + goto tr332; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st60; + } else if ( (*p) >= 65 ) + goto st60; + } else + goto st60; + goto tr296; +tr332: +#line 80 "ext/hpricot_scan/hpricot_scan.rl" + { SET(tag, p); } + goto st61; +st61: + if ( ++p == pe ) + goto _out61; +case 61: +#line 1304 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st61; + case 62: goto tr314; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st61; + goto tr296; +tr21: +#line 77 "ext/hpricot_scan/hpricot_scan.rl" + { mark_tag = p; } + goto st62; +st62: + if ( ++p == pe ) + goto _out62; +case 62: +#line 1320 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto tr324; + case 47: goto tr326; + case 62: goto tr327; + case 63: goto st62; + case 95: goto st62; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto tr324; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st62; + } else if ( (*p) >= 65 ) + goto st62; + } else + goto st62; + goto tr296; +tr324: +#line 80 "ext/hpricot_scan/hpricot_scan.rl" + { SET(tag, p); } + goto st63; +st63: + if ( ++p == pe ) + goto _out63; +case 63: +#line 1348 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st63; + case 47: goto st66; + case 62: goto tr318; + case 63: goto tr316; + case 95: goto tr316; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto st63; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr316; + } else if ( (*p) >= 65 ) + goto tr316; + } else + goto tr316; + goto tr296; +tr360: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 94 "ext/hpricot_scan/hpricot_scan.rl" + { + akey = Qnil; + aval = Qnil; + mark_akey = NULL; + mark_aval = NULL; + } +#line 79 "ext/hpricot_scan/hpricot_scan.rl" + { mark_akey = p; } + goto st64; +tr316: +#line 94 "ext/hpricot_scan/hpricot_scan.rl" + { + akey = Qnil; + aval = Qnil; + mark_akey = NULL; + mark_aval = NULL; + } +#line 79 "ext/hpricot_scan/hpricot_scan.rl" + { mark_akey = p; } + goto st64; +st64: + if ( ++p == pe ) + goto _out64; +case 64: +#line 1398 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto tr364; + case 47: goto tr366; + case 61: goto tr367; + case 62: goto tr368; + case 63: goto st64; + case 95: goto st64; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto tr364; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st64; + } else if ( (*p) >= 65 ) + goto st64; + } else + goto st64; + goto tr69; +tr71: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st65; +tr364: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } + goto st65; +tr132: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st65; +st65: + if ( ++p == pe ) + goto _out65; +case 65: +#line 1443 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st65; + case 47: goto tr361; + case 61: goto st67; + case 62: goto tr162; + case 63: goto tr360; + case 95: goto tr360; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto st65; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr360; + } else if ( (*p) >= 65 ) + goto tr360; + } else + goto tr360; + goto tr69; +tr361: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st66; +tr366: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st66; +tr326: +#line 80 "ext/hpricot_scan/hpricot_scan.rl" + { SET(tag, p); } + goto st66; +st66: + if ( ++p == pe ) + goto _out66; +case 66: +#line 1486 "ext/hpricot_scan/hpricot_scan.c" + if ( (*p) == 62 ) + goto tr369; + goto tr69; +tr367: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } + goto st67; +st67: + if ( ++p == pe ) + goto _out67; +case 67: +#line 1498 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr157; + case 32: goto tr157; + case 34: goto st142; + case 39: goto st143; + case 47: goto tr161; + case 60: goto tr69; + case 62: goto tr162; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr158; + } else if ( (*p) >= 9 ) + goto tr157; + goto tr156; +tr156: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st68; +st68: + if ( ++p == pe ) + goto _out68; +case 68: +#line 1522 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr66; + case 32: goto tr66; + case 47: goto tr68; + case 60: goto tr69; + case 62: goto tr70; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr67; + } else if ( (*p) >= 9 ) + goto tr66; + goto st68; +tr3: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st69; +tr66: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st69; +st69: + if ( ++p == pe ) + goto _out69; +case 69: +#line 1551 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st69; + case 47: goto tr361; + case 62: goto tr162; + case 63: goto tr360; + case 95: goto tr360; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto st69; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr360; + } else if ( (*p) >= 65 ) + goto tr360; + } else + goto tr360; + goto tr69; +tr84: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st70; +tr67: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st70; +st70: + if ( ++p == pe ) + goto _out70; +case 70: +#line 1586 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr66; + case 32: goto tr66; + case 47: goto tr74; + case 60: goto tr69; + case 62: goto tr76; + case 63: goto tr73; + case 95: goto tr73; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr67; + } else if ( (*p) >= 9 ) + goto tr66; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr73; + } else if ( (*p) >= 65 ) + goto tr73; + } else + goto tr73; + goto st68; +tr73: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 94 "ext/hpricot_scan/hpricot_scan.rl" + { + akey = Qnil; + aval = Qnil; + mark_akey = NULL; + mark_aval = NULL; + } +#line 79 "ext/hpricot_scan/hpricot_scan.rl" + { mark_akey = p; } + goto st71; +tr165: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 94 "ext/hpricot_scan/hpricot_scan.rl" + { + akey = Qnil; + aval = Qnil; + mark_akey = NULL; + mark_aval = NULL; + } +#line 79 "ext/hpricot_scan/hpricot_scan.rl" + { mark_akey = p; } + goto st71; +st71: + if ( ++p == pe ) + goto _out71; +case 71: +#line 1647 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr132; + case 32: goto tr132; + case 47: goto tr135; + case 60: goto tr69; + case 61: goto tr136; + case 62: goto tr137; + case 63: goto st71; + case 95: goto st71; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr133; + } else if ( (*p) >= 9 ) + goto tr132; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st71; + } else if ( (*p) >= 65 ) + goto st71; + } else + goto st71; + goto st68; +tr72: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st72; +tr133: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st72; +st72: + if ( ++p == pe ) + goto _out72; +case 72: +#line 1693 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr71; + case 32: goto tr71; + case 47: goto tr74; + case 60: goto tr69; + case 61: goto st74; + case 62: goto tr76; + case 63: goto tr73; + case 95: goto tr73; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr72; + } else if ( (*p) >= 9 ) + goto tr71; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr73; + } else if ( (*p) >= 65 ) + goto tr73; + } else + goto tr73; + goto st68; +tr68: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st73; +tr74: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st73; +tr135: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st73; +tr161: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st73; +tr230: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st73; +tr231: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st73; +st73: + if ( ++p == pe ) + goto _out73; +case 73: +#line 1792 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr66; + case 32: goto tr66; + case 47: goto tr68; + case 60: goto tr69; + case 62: goto tr70; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr67; + } else if ( (*p) >= 9 ) + goto tr66; + goto st68; +tr136: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } + goto st74; +tr158: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st74; +st74: + if ( ++p == pe ) + goto _out74; +case 74: +#line 1818 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr226; + case 32: goto tr226; + case 34: goto st77; + case 39: goto st141; + case 47: goto tr230; + case 60: goto tr69; + case 62: goto tr70; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr227; + } else if ( (*p) >= 9 ) + goto tr226; + goto tr156; +tr163: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st75; +tr226: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st75; +st75: + if ( ++p == pe ) + goto _out75; +case 75: +#line 1851 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr163; + case 32: goto tr163; + case 34: goto st142; + case 39: goto st143; + case 47: goto tr161; + case 60: goto tr69; + case 62: goto tr162; + case 63: goto tr165; + case 95: goto tr165; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr164; + } else if ( (*p) >= 9 ) + goto tr163; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr165; + } else if ( (*p) >= 65 ) + goto tr165; + } else + goto tr165; + goto tr156; +tr164: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st76; +tr227: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st76; +st76: + if ( ++p == pe ) + goto _out76; +case 76: +#line 1895 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr226; + case 32: goto tr226; + case 34: goto st77; + case 39: goto st141; + case 47: goto tr231; + case 60: goto tr69; + case 62: goto tr76; + case 63: goto tr165; + case 95: goto tr165; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr227; + } else if ( (*p) >= 9 ) + goto tr226; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr165; + } else if ( (*p) >= 65 ) + goto tr165; + } else + goto tr165; + goto tr156; +st77: + if ( ++p == pe ) + goto _out77; +case 77: + switch( (*p) ) { + case 13: goto tr248; + case 32: goto tr248; + case 34: goto tr84; + case 47: goto tr246; + case 60: goto tr199; + case 62: goto tr250; + case 92: goto tr195; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr249; + } else if ( (*p) >= 9 ) + goto tr248; + goto tr189; +tr189: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st78; +st78: + if ( ++p == pe ) + goto _out78; +case 78: +#line 1949 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr92; + case 32: goto tr92; + case 34: goto tr84; + case 47: goto tr95; + case 60: goto st80; + case 62: goto tr96; + case 92: goto st94; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr93; + } else if ( (*p) >= 9 ) + goto tr92; + goto st78; +tr11: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st79; +tr92: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st79; +tr201: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st79; +tr216: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st79; +tr248: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st79; +st79: + if ( ++p == pe ) + goto _out79; +case 79: +#line 1999 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st79; + case 34: goto tr3; + case 47: goto tr48; + case 62: goto tr50; + case 63: goto tr47; + case 92: goto st81; + case 95: goto tr47; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto st79; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr47; + } else if ( (*p) >= 65 ) + goto tr47; + } else + goto tr47; + goto st80; +tr199: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st80; +st80: + if ( ++p == pe ) + goto _out80; +case 80: +#line 2029 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 34: goto tr3; + case 92: goto st81; + } + goto st80; +tr200: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st81; +st81: + if ( ++p == pe ) + goto _out81; +case 81: +#line 2043 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 34: goto tr11; + case 92: goto st81; + } + goto st80; +tr47: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 94 "ext/hpricot_scan/hpricot_scan.rl" + { + akey = Qnil; + aval = Qnil; + mark_akey = NULL; + mark_aval = NULL; + } +#line 79 "ext/hpricot_scan/hpricot_scan.rl" + { mark_akey = p; } + goto st82; +tr202: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 94 "ext/hpricot_scan/hpricot_scan.rl" + { + akey = Qnil; + aval = Qnil; + mark_akey = NULL; + mark_aval = NULL; + } +#line 79 "ext/hpricot_scan/hpricot_scan.rl" + { mark_akey = p; } + goto st82; +st82: + if ( ++p == pe ) + goto _out82; +case 82: +#line 2085 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto tr122; + case 34: goto tr3; + case 47: goto tr124; + case 61: goto tr125; + case 62: goto tr126; + case 63: goto st82; + case 92: goto st81; + case 95: goto st82; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto tr122; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st82; + } else if ( (*p) >= 65 ) + goto st82; + } else + goto st82; + goto st80; +tr98: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st83; +tr122: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } + goto st83; +tr144: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st83; +st83: + if ( ++p == pe ) + goto _out83; +case 83: +#line 2132 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st83; + case 34: goto tr3; + case 47: goto tr48; + case 61: goto st85; + case 62: goto tr50; + case 63: goto tr47; + case 92: goto st81; + case 95: goto tr47; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto st83; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr47; + } else if ( (*p) >= 65 ) + goto tr47; + } else + goto tr47; + goto st80; +tr48: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st84; +tr124: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st84; +tr203: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st84; +st84: + if ( ++p == pe ) + goto _out84; +case 84: +#line 2181 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 34: goto tr3; + case 62: goto tr45; + case 92: goto st81; + } + goto st80; +tr45: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 70 "ext/hpricot_scan/hpricot_scan.rl" + {act = 12;} + goto st209; +tr50: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st209; +tr96: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st209; +tr103: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st209; +tr126: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st209; +tr149: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st209; +tr204: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st209; +tr250: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st209; +tr251: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st209; +st209: + if ( ++p == pe ) + goto _out209; +case 209: +#line 2313 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 34: goto tr3; + case 92: goto st81; + } + goto st80; +tr125: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } + goto st85; +st85: + if ( ++p == pe ) + goto _out85; +case 85: +#line 2327 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr190; + case 32: goto tr190; + case 34: goto tr192; + case 39: goto st140; + case 47: goto tr194; + case 60: goto st80; + case 62: goto tr50; + case 92: goto tr195; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr191; + } else if ( (*p) >= 9 ) + goto tr190; + goto tr189; +tr190: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st86; +st86: + if ( ++p == pe ) + goto _out86; +case 86: +#line 2352 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr196; + case 32: goto tr196; + case 34: goto tr192; + case 39: goto st140; + case 47: goto tr194; + case 60: goto st80; + case 62: goto tr50; + case 92: goto tr195; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr197; + } else if ( (*p) >= 9 ) + goto tr196; + goto tr189; +tr196: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st87; +tr242: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st87; +st87: + if ( ++p == pe ) + goto _out87; +case 87: +#line 2386 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr196; + case 32: goto tr196; + case 34: goto tr192; + case 39: goto st140; + case 47: goto tr194; + case 60: goto st80; + case 62: goto tr50; + case 63: goto tr198; + case 92: goto tr195; + case 95: goto tr198; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr197; + } else if ( (*p) >= 9 ) + goto tr196; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr198; + } else if ( (*p) >= 65 ) + goto tr198; + } else + goto tr198; + goto tr189; +tr197: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st88; +tr243: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st88; +st88: + if ( ++p == pe ) + goto _out88; +case 88: +#line 2431 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr242; + case 32: goto tr242; + case 34: goto tr244; + case 39: goto st96; + case 47: goto tr247; + case 60: goto st80; + case 62: goto tr103; + case 63: goto tr198; + case 92: goto tr195; + case 95: goto tr198; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr243; + } else if ( (*p) >= 9 ) + goto tr242; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr198; + } else if ( (*p) >= 65 ) + goto tr198; + } else + goto tr198; + goto tr189; +tr244: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st89; +st89: + if ( ++p == pe ) + goto _out89; +case 89: +#line 2467 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr248; + case 32: goto tr248; + case 34: goto tr84; + case 47: goto tr247; + case 60: goto tr199; + case 62: goto tr251; + case 63: goto tr198; + case 92: goto tr195; + case 95: goto tr198; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr249; + } else if ( (*p) >= 9 ) + goto tr248; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr198; + } else if ( (*p) >= 65 ) + goto tr198; + } else + goto tr198; + goto tr189; +tr94: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st90; +tr93: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st90; +tr260: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st90; +tr249: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st90; +st90: + if ( ++p == pe ) + goto _out90; +case 90: +#line 2524 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr92; + case 32: goto tr92; + case 34: goto tr84; + case 47: goto tr101; + case 60: goto st80; + case 62: goto tr103; + case 63: goto tr100; + case 92: goto st94; + case 95: goto tr100; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr93; + } else if ( (*p) >= 9 ) + goto tr92; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr100; + } else if ( (*p) >= 65 ) + goto tr100; + } else + goto tr100; + goto st78; +tr100: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 94 "ext/hpricot_scan/hpricot_scan.rl" + { + akey = Qnil; + aval = Qnil; + mark_akey = NULL; + mark_aval = NULL; + } +#line 79 "ext/hpricot_scan/hpricot_scan.rl" + { mark_akey = p; } + goto st91; +tr198: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 94 "ext/hpricot_scan/hpricot_scan.rl" + { + akey = Qnil; + aval = Qnil; + mark_akey = NULL; + mark_aval = NULL; + } +#line 79 "ext/hpricot_scan/hpricot_scan.rl" + { mark_akey = p; } + goto st91; +st91: + if ( ++p == pe ) + goto _out91; +case 91: +#line 2587 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr144; + case 32: goto tr144; + case 34: goto tr84; + case 47: goto tr147; + case 60: goto st80; + case 61: goto tr148; + case 62: goto tr149; + case 63: goto st91; + case 92: goto st94; + case 95: goto st91; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr145; + } else if ( (*p) >= 9 ) + goto tr144; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st91; + } else if ( (*p) >= 65 ) + goto st91; + } else + goto st91; + goto st78; +tr99: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st92; +tr145: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st92; +st92: + if ( ++p == pe ) + goto _out92; +case 92: +#line 2635 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr98; + case 32: goto tr98; + case 34: goto tr84; + case 47: goto tr101; + case 60: goto st80; + case 61: goto st95; + case 62: goto tr103; + case 63: goto tr100; + case 92: goto st94; + case 95: goto tr100; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr99; + } else if ( (*p) >= 9 ) + goto tr98; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr100; + } else if ( (*p) >= 65 ) + goto tr100; + } else + goto tr100; + goto st78; +tr95: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st93; +tr101: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st93; +tr147: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st93; +tr194: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st93; +tr246: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st93; +tr247: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st93; +st93: + if ( ++p == pe ) + goto _out93; +case 93: +#line 2736 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr92; + case 32: goto tr92; + case 34: goto tr84; + case 47: goto tr95; + case 60: goto st80; + case 62: goto tr96; + case 92: goto st94; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr93; + } else if ( (*p) >= 9 ) + goto tr92; + goto st78; +tr195: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st94; +st94: + if ( ++p == pe ) + goto _out94; +case 94: +#line 2760 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr92; + case 32: goto tr92; + case 34: goto tr94; + case 47: goto tr95; + case 60: goto st80; + case 62: goto tr96; + case 92: goto st94; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr93; + } else if ( (*p) >= 9 ) + goto tr92; + goto st78; +tr148: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } + goto st95; +tr191: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st95; +st95: + if ( ++p == pe ) + goto _out95; +case 95: +#line 2788 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr242; + case 32: goto tr242; + case 34: goto tr244; + case 39: goto st96; + case 47: goto tr246; + case 60: goto st80; + case 62: goto tr96; + case 92: goto tr195; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr243; + } else if ( (*p) >= 9 ) + goto tr242; + goto tr189; +st96: + if ( ++p == pe ) + goto _out96; +case 96: + switch( (*p) ) { + case 13: goto tr258; + case 32: goto tr258; + case 34: goto tr263; + case 39: goto tr94; + case 47: goto tr256; + case 60: goto tr215; + case 62: goto tr261; + case 92: goto tr211; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr259; + } else if ( (*p) >= 9 ) + goto tr258; + goto tr205; +tr205: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st97; +st97: + if ( ++p == pe ) + goto _out97; +case 97: +#line 2833 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr105; + case 32: goto tr105; + case 34: goto tr80; + case 39: goto tr94; + case 47: goto tr108; + case 60: goto st99; + case 62: goto tr109; + case 92: goto st129; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr106; + } else if ( (*p) >= 9 ) + goto tr105; + goto st97; +tr51: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st98; +tr105: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st98; +tr218: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st98; +tr258: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st98; +st98: + if ( ++p == pe ) + goto _out98; +case 98: +#line 2878 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st98; + case 34: goto tr10; + case 39: goto tr11; + case 47: goto tr55; + case 62: goto tr57; + case 63: goto tr54; + case 92: goto st122; + case 95: goto tr54; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto st98; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr54; + } else if ( (*p) >= 65 ) + goto tr54; + } else + goto tr54; + goto st99; +tr215: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st99; +st99: + if ( ++p == pe ) + goto _out99; +case 99: +#line 2909 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 34: goto tr10; + case 39: goto tr11; + case 92: goto st122; + } + goto st99; +tr10: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st100; +tr78: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st100; +tr178: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st100; +tr225: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st100; +tr238: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st100; +st100: + if ( ++p == pe ) + goto _out100; +case 100: +#line 2950 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st100; + case 39: goto tr3; + case 47: goto tr31; + case 62: goto tr33; + case 63: goto tr30; + case 92: goto st102; + case 95: goto tr30; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto st100; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr30; + } else if ( (*p) >= 65 ) + goto tr30; + } else + goto tr30; + goto st101; +tr176: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st101; +st101: + if ( ++p == pe ) + goto _out101; +case 101: +#line 2980 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 39: goto tr3; + case 92: goto st102; + } + goto st101; +tr177: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st102; +st102: + if ( ++p == pe ) + goto _out102; +case 102: +#line 2994 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 39: goto tr10; + case 92: goto st102; + } + goto st101; +tr30: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 94 "ext/hpricot_scan/hpricot_scan.rl" + { + akey = Qnil; + aval = Qnil; + mark_akey = NULL; + mark_aval = NULL; + } +#line 79 "ext/hpricot_scan/hpricot_scan.rl" + { mark_akey = p; } + goto st103; +tr179: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 94 "ext/hpricot_scan/hpricot_scan.rl" + { + akey = Qnil; + aval = Qnil; + mark_akey = NULL; + mark_aval = NULL; + } +#line 79 "ext/hpricot_scan/hpricot_scan.rl" + { mark_akey = p; } + goto st103; +st103: + if ( ++p == pe ) + goto _out103; +case 103: +#line 3036 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto tr117; + case 39: goto tr3; + case 47: goto tr119; + case 61: goto tr120; + case 62: goto tr121; + case 63: goto st103; + case 92: goto st102; + case 95: goto st103; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto tr117; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st103; + } else if ( (*p) >= 65 ) + goto st103; + } else + goto st103; + goto st101; +tr85: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st104; +tr117: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } + goto st104; +tr138: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st104; +st104: + if ( ++p == pe ) + goto _out104; +case 104: +#line 3083 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st104; + case 39: goto tr3; + case 47: goto tr31; + case 61: goto st106; + case 62: goto tr33; + case 63: goto tr30; + case 92: goto st102; + case 95: goto tr30; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto st104; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr30; + } else if ( (*p) >= 65 ) + goto tr30; + } else + goto tr30; + goto st101; +tr31: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st105; +tr119: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st105; +tr180: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st105; +st105: + if ( ++p == pe ) + goto _out105; +case 105: +#line 3132 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 39: goto tr3; + case 62: goto tr28; + case 92: goto st102; + } + goto st101; +tr28: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 70 "ext/hpricot_scan/hpricot_scan.rl" + {act = 12;} + goto st210; +tr33: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st210; +tr82: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st210; +tr90: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st210; +tr121: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st210; +tr143: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st210; +tr181: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st210; +tr240: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st210; +tr241: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st210; +st210: + if ( ++p == pe ) + goto _out210; +case 210: +#line 3264 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 39: goto tr3; + case 92: goto st102; + } + goto st101; +tr120: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } + goto st106; +st106: + if ( ++p == pe ) + goto _out106; +case 106: +#line 3278 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr167; + case 32: goto tr167; + case 34: goto st136; + case 39: goto tr170; + case 47: goto tr171; + case 60: goto st101; + case 62: goto tr33; + case 92: goto tr172; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr168; + } else if ( (*p) >= 9 ) + goto tr167; + goto tr166; +tr166: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st107; +st107: + if ( ++p == pe ) + goto _out107; +case 107: +#line 3303 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr78; + case 32: goto tr78; + case 39: goto tr84; + case 47: goto tr81; + case 60: goto st101; + case 62: goto tr82; + case 92: goto st112; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr79; + } else if ( (*p) >= 9 ) + goto tr78; + goto st107; +tr80: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st108; +tr79: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st108; +tr263: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st108; +tr239: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st108; +st108: + if ( ++p == pe ) + goto _out108; +case 108: +#line 3349 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr78; + case 32: goto tr78; + case 39: goto tr84; + case 47: goto tr88; + case 60: goto st101; + case 62: goto tr90; + case 63: goto tr87; + case 92: goto st112; + case 95: goto tr87; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr79; + } else if ( (*p) >= 9 ) + goto tr78; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr87; + } else if ( (*p) >= 65 ) + goto tr87; + } else + goto tr87; + goto st107; +tr87: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 94 "ext/hpricot_scan/hpricot_scan.rl" + { + akey = Qnil; + aval = Qnil; + mark_akey = NULL; + mark_aval = NULL; + } +#line 79 "ext/hpricot_scan/hpricot_scan.rl" + { mark_akey = p; } + goto st109; +tr175: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 94 "ext/hpricot_scan/hpricot_scan.rl" + { + akey = Qnil; + aval = Qnil; + mark_akey = NULL; + mark_aval = NULL; + } +#line 79 "ext/hpricot_scan/hpricot_scan.rl" + { mark_akey = p; } + goto st109; +st109: + if ( ++p == pe ) + goto _out109; +case 109: +#line 3412 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr138; + case 32: goto tr138; + case 39: goto tr84; + case 47: goto tr141; + case 60: goto st101; + case 61: goto tr142; + case 62: goto tr143; + case 63: goto st109; + case 92: goto st112; + case 95: goto st109; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr139; + } else if ( (*p) >= 9 ) + goto tr138; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st109; + } else if ( (*p) >= 65 ) + goto st109; + } else + goto st109; + goto st107; +tr86: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st110; +tr139: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st110; +st110: + if ( ++p == pe ) + goto _out110; +case 110: +#line 3460 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr85; + case 32: goto tr85; + case 39: goto tr84; + case 47: goto tr88; + case 60: goto st101; + case 61: goto st113; + case 62: goto tr90; + case 63: goto tr87; + case 92: goto st112; + case 95: goto tr87; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr86; + } else if ( (*p) >= 9 ) + goto tr85; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr87; + } else if ( (*p) >= 65 ) + goto tr87; + } else + goto tr87; + goto st107; +tr81: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st111; +tr88: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st111; +tr141: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st111; +tr171: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st111; +tr236: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st111; +tr237: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st111; +st111: + if ( ++p == pe ) + goto _out111; +case 111: +#line 3561 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr78; + case 32: goto tr78; + case 39: goto tr84; + case 47: goto tr81; + case 60: goto st101; + case 62: goto tr82; + case 92: goto st112; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr79; + } else if ( (*p) >= 9 ) + goto tr78; + goto st107; +tr172: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st112; +st112: + if ( ++p == pe ) + goto _out112; +case 112: +#line 3585 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr78; + case 32: goto tr78; + case 39: goto tr80; + case 47: goto tr81; + case 60: goto st101; + case 62: goto tr82; + case 92: goto st112; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr79; + } else if ( (*p) >= 9 ) + goto tr78; + goto st107; +tr142: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } + goto st113; +tr168: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st113; +st113: + if ( ++p == pe ) + goto _out113; +case 113: +#line 3613 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr232; + case 32: goto tr232; + case 34: goto st116; + case 39: goto tr235; + case 47: goto tr236; + case 60: goto st101; + case 62: goto tr82; + case 92: goto tr172; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr233; + } else if ( (*p) >= 9 ) + goto tr232; + goto tr166; +tr173: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st114; +tr232: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st114; +st114: + if ( ++p == pe ) + goto _out114; +case 114: +#line 3647 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr173; + case 32: goto tr173; + case 34: goto st136; + case 39: goto tr170; + case 47: goto tr171; + case 60: goto st101; + case 62: goto tr33; + case 63: goto tr175; + case 92: goto tr172; + case 95: goto tr175; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr174; + } else if ( (*p) >= 9 ) + goto tr173; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr175; + } else if ( (*p) >= 65 ) + goto tr175; + } else + goto tr175; + goto tr166; +tr174: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st115; +tr233: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st115; +st115: + if ( ++p == pe ) + goto _out115; +case 115: +#line 3692 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr232; + case 32: goto tr232; + case 34: goto st116; + case 39: goto tr235; + case 47: goto tr237; + case 60: goto st101; + case 62: goto tr90; + case 63: goto tr175; + case 92: goto tr172; + case 95: goto tr175; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr233; + } else if ( (*p) >= 9 ) + goto tr232; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr175; + } else if ( (*p) >= 65 ) + goto tr175; + } else + goto tr175; + goto tr166; +st116: + if ( ++p == pe ) + goto _out116; +case 116: + switch( (*p) ) { + case 13: goto tr258; + case 32: goto tr258; + case 34: goto tr80; + case 39: goto tr260; + case 47: goto tr256; + case 60: goto tr215; + case 62: goto tr261; + case 92: goto tr211; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr259; + } else if ( (*p) >= 9 ) + goto tr258; + goto tr205; +tr107: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st117; +tr106: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st117; +tr259: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st117; +st117: + if ( ++p == pe ) + goto _out117; +case 117: +#line 3764 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr105; + case 32: goto tr105; + case 34: goto tr80; + case 39: goto tr94; + case 47: goto tr114; + case 60: goto st99; + case 62: goto tr116; + case 63: goto tr113; + case 92: goto st129; + case 95: goto tr113; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr106; + } else if ( (*p) >= 9 ) + goto tr105; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr113; + } else if ( (*p) >= 65 ) + goto tr113; + } else + goto tr113; + goto st97; +tr113: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 94 "ext/hpricot_scan/hpricot_scan.rl" + { + akey = Qnil; + aval = Qnil; + mark_akey = NULL; + mark_aval = NULL; + } +#line 79 "ext/hpricot_scan/hpricot_scan.rl" + { mark_akey = p; } + goto st118; +tr214: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 94 "ext/hpricot_scan/hpricot_scan.rl" + { + akey = Qnil; + aval = Qnil; + mark_akey = NULL; + mark_aval = NULL; + } +#line 79 "ext/hpricot_scan/hpricot_scan.rl" + { mark_akey = p; } + goto st118; +st118: + if ( ++p == pe ) + goto _out118; +case 118: +#line 3828 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr150; + case 32: goto tr150; + case 34: goto tr80; + case 39: goto tr94; + case 47: goto tr153; + case 60: goto st99; + case 61: goto tr154; + case 62: goto tr155; + case 63: goto st118; + case 92: goto st129; + case 95: goto st118; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr151; + } else if ( (*p) >= 9 ) + goto tr150; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st118; + } else if ( (*p) >= 65 ) + goto st118; + } else + goto st118; + goto st97; +tr111: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st119; +tr127: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } + goto st119; +tr150: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st119; +st119: + if ( ++p == pe ) + goto _out119; +case 119: +#line 3881 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st119; + case 34: goto tr10; + case 39: goto tr11; + case 47: goto tr55; + case 61: goto st123; + case 62: goto tr57; + case 63: goto tr54; + case 92: goto st122; + case 95: goto tr54; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto st119; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr54; + } else if ( (*p) >= 65 ) + goto tr54; + } else + goto tr54; + goto st99; +tr54: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 94 "ext/hpricot_scan/hpricot_scan.rl" + { + akey = Qnil; + aval = Qnil; + mark_akey = NULL; + mark_aval = NULL; + } +#line 79 "ext/hpricot_scan/hpricot_scan.rl" + { mark_akey = p; } + goto st120; +tr219: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 94 "ext/hpricot_scan/hpricot_scan.rl" + { + akey = Qnil; + aval = Qnil; + mark_akey = NULL; + mark_aval = NULL; + } +#line 79 "ext/hpricot_scan/hpricot_scan.rl" + { mark_akey = p; } + goto st120; +st120: + if ( ++p == pe ) + goto _out120; +case 120: +#line 3941 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto tr127; + case 34: goto tr10; + case 39: goto tr11; + case 47: goto tr129; + case 61: goto tr130; + case 62: goto tr131; + case 63: goto st120; + case 92: goto st122; + case 95: goto st120; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto tr127; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st120; + } else if ( (*p) >= 65 ) + goto st120; + } else + goto st120; + goto st99; +tr55: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st121; +tr129: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st121; +tr220: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st121; +st121: + if ( ++p == pe ) + goto _out121; +case 121: +#line 3991 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 34: goto tr10; + case 39: goto tr11; + case 62: goto tr52; + case 92: goto st122; + } + goto st99; +tr52: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 70 "ext/hpricot_scan/hpricot_scan.rl" + {act = 12;} + goto st211; +tr57: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st211; +tr109: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st211; +tr116: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st211; +tr131: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st211; +tr155: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st211; +tr221: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st211; +tr261: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st211; +tr262: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 68 "ext/hpricot_scan/hpricot_scan.rl" + {act = 10;} + goto st211; +st211: + if ( ++p == pe ) + goto _out211; +case 211: +#line 4124 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 34: goto tr10; + case 39: goto tr11; + case 92: goto st122; + } + goto st99; +tr217: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st122; +st122: + if ( ++p == pe ) + goto _out122; +case 122: +#line 4139 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 34: goto tr51; + case 39: goto tr51; + case 92: goto st122; + } + goto st99; +tr130: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } + goto st123; +st123: + if ( ++p == pe ) + goto _out123; +case 123: +#line 4154 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr206; + case 32: goto tr206; + case 34: goto tr208; + case 39: goto tr209; + case 47: goto tr210; + case 60: goto st99; + case 62: goto tr57; + case 92: goto tr211; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr207; + } else if ( (*p) >= 9 ) + goto tr206; + goto tr205; +tr206: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st124; +st124: + if ( ++p == pe ) + goto _out124; +case 124: +#line 4179 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr212; + case 32: goto tr212; + case 34: goto tr208; + case 39: goto tr209; + case 47: goto tr210; + case 60: goto st99; + case 62: goto tr57; + case 92: goto tr211; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr213; + } else if ( (*p) >= 9 ) + goto tr212; + goto tr205; +tr212: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st125; +tr252: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st125; +st125: + if ( ++p == pe ) + goto _out125; +case 125: +#line 4213 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr212; + case 32: goto tr212; + case 34: goto tr208; + case 39: goto tr209; + case 47: goto tr210; + case 60: goto st99; + case 62: goto tr57; + case 63: goto tr214; + case 92: goto tr211; + case 95: goto tr214; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr213; + } else if ( (*p) >= 9 ) + goto tr212; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr214; + } else if ( (*p) >= 65 ) + goto tr214; + } else + goto tr214; + goto tr205; +tr213: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st126; +tr253: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st126; +st126: + if ( ++p == pe ) + goto _out126; +case 126: +#line 4258 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr252; + case 32: goto tr252; + case 34: goto tr254; + case 39: goto tr255; + case 47: goto tr257; + case 60: goto st99; + case 62: goto tr116; + case 63: goto tr214; + case 92: goto tr211; + case 95: goto tr214; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr253; + } else if ( (*p) >= 9 ) + goto tr252; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr214; + } else if ( (*p) >= 65 ) + goto tr214; + } else + goto tr214; + goto tr205; +tr254: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st127; +st127: + if ( ++p == pe ) + goto _out127; +case 127: +#line 4294 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr258; + case 32: goto tr258; + case 34: goto tr80; + case 39: goto tr260; + case 47: goto tr257; + case 60: goto tr215; + case 62: goto tr262; + case 63: goto tr214; + case 92: goto tr211; + case 95: goto tr214; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr259; + } else if ( (*p) >= 9 ) + goto tr258; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr214; + } else if ( (*p) >= 65 ) + goto tr214; + } else + goto tr214; + goto tr205; +tr108: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st128; +tr114: +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st128; +tr153: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st128; +tr210: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st128; +tr256: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } + goto st128; +tr257: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } +#line 101 "ext/hpricot_scan/hpricot_scan.rl" + { + ATTR(akey, aval); + } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st128; +st128: + if ( ++p == pe ) + goto _out128; +case 128: +#line 4395 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr105; + case 32: goto tr105; + case 34: goto tr80; + case 39: goto tr94; + case 47: goto tr108; + case 60: goto st99; + case 62: goto tr109; + case 92: goto st129; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr106; + } else if ( (*p) >= 9 ) + goto tr105; + goto st97; +tr211: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st129; +st129: + if ( ++p == pe ) + goto _out129; +case 129: +#line 4420 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr105; + case 32: goto tr105; + case 34: goto tr107; + case 39: goto tr107; + case 47: goto tr108; + case 60: goto st99; + case 62: goto tr109; + case 92: goto st129; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr106; + } else if ( (*p) >= 9 ) + goto tr105; + goto st97; +tr255: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st130; +st130: + if ( ++p == pe ) + goto _out130; +case 130: +#line 4445 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr258; + case 32: goto tr258; + case 34: goto tr263; + case 39: goto tr94; + case 47: goto tr257; + case 60: goto tr215; + case 62: goto tr262; + case 63: goto tr214; + case 92: goto tr211; + case 95: goto tr214; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr259; + } else if ( (*p) >= 9 ) + goto tr258; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr214; + } else if ( (*p) >= 65 ) + goto tr214; + } else + goto tr214; + goto tr205; +tr208: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st131; +st131: + if ( ++p == pe ) + goto _out131; +case 131: +#line 4481 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto tr218; + case 34: goto tr10; + case 39: goto tr216; + case 47: goto tr220; + case 62: goto tr221; + case 63: goto tr219; + case 92: goto tr217; + case 95: goto tr219; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto tr218; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr219; + } else if ( (*p) >= 65 ) + goto tr219; + } else + goto tr219; + goto tr215; +tr209: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st132; +st132: + if ( ++p == pe ) + goto _out132; +case 132: +#line 4512 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto tr218; + case 34: goto tr225; + case 39: goto tr11; + case 47: goto tr220; + case 62: goto tr221; + case 63: goto tr219; + case 92: goto tr217; + case 95: goto tr219; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto tr218; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr219; + } else if ( (*p) >= 65 ) + goto tr219; + } else + goto tr219; + goto tr215; +tr154: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } + goto st133; +tr207: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st133; +st133: + if ( ++p == pe ) + goto _out133; +case 133: +#line 4547 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr252; + case 32: goto tr252; + case 34: goto tr254; + case 39: goto tr255; + case 47: goto tr256; + case 60: goto st99; + case 62: goto tr109; + case 92: goto tr211; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr253; + } else if ( (*p) >= 9 ) + goto tr252; + goto tr205; +tr112: +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st134; +tr151: +#line 87 "ext/hpricot_scan/hpricot_scan.rl" + { SET(akey, p); } +#line 83 "ext/hpricot_scan/hpricot_scan.rl" + { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + goto st134; +st134: + if ( ++p == pe ) + goto _out134; +case 134: +#line 4584 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr111; + case 32: goto tr111; + case 34: goto tr80; + case 39: goto tr94; + case 47: goto tr114; + case 60: goto st99; + case 61: goto st133; + case 62: goto tr116; + case 63: goto tr113; + case 92: goto st129; + case 95: goto tr113; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr112; + } else if ( (*p) >= 9 ) + goto tr111; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr113; + } else if ( (*p) >= 65 ) + goto tr113; + } else + goto tr113; + goto st97; +tr235: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st135; +st135: + if ( ++p == pe ) + goto _out135; +case 135: +#line 4621 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr238; + case 32: goto tr238; + case 39: goto tr84; + case 47: goto tr237; + case 60: goto tr176; + case 62: goto tr241; + case 63: goto tr175; + case 92: goto tr172; + case 95: goto tr175; + } + if ( (*p) < 45 ) { + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr239; + } else if ( (*p) >= 9 ) + goto tr238; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr175; + } else if ( (*p) >= 65 ) + goto tr175; + } else + goto tr175; + goto tr166; +st136: + if ( ++p == pe ) + goto _out136; +case 136: + switch( (*p) ) { + case 34: goto tr10; + case 39: goto tr216; + case 92: goto tr217; + } + goto tr215; +tr170: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st137; +st137: + if ( ++p == pe ) + goto _out137; +case 137: +#line 4666 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto tr178; + case 39: goto tr3; + case 47: goto tr180; + case 62: goto tr181; + case 63: goto tr179; + case 92: goto tr177; + case 95: goto tr179; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto tr178; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr179; + } else if ( (*p) >= 65 ) + goto tr179; + } else + goto tr179; + goto tr176; +tr167: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st138; +st138: + if ( ++p == pe ) + goto _out138; +case 138: +#line 4696 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr173; + case 32: goto tr173; + case 34: goto st136; + case 39: goto tr170; + case 47: goto tr171; + case 60: goto st101; + case 62: goto tr33; + case 92: goto tr172; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr174; + } else if ( (*p) >= 9 ) + goto tr173; + goto tr166; +tr192: +#line 82 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); } + goto st139; +st139: + if ( ++p == pe ) + goto _out139; +case 139: +#line 4721 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto tr201; + case 34: goto tr3; + case 47: goto tr203; + case 62: goto tr204; + case 63: goto tr202; + case 92: goto tr200; + case 95: goto tr202; + } + if ( (*p) < 45 ) { + if ( 9 <= (*p) && (*p) <= 13 ) + goto tr201; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr202; + } else if ( (*p) >= 65 ) + goto tr202; + } else + goto tr202; + goto tr199; +st140: + if ( ++p == pe ) + goto _out140; +case 140: + switch( (*p) ) { + case 34: goto tr225; + case 39: goto tr11; + case 92: goto tr217; + } + goto tr215; +st141: + if ( ++p == pe ) + goto _out141; +case 141: + switch( (*p) ) { + case 13: goto tr238; + case 32: goto tr238; + case 39: goto tr84; + case 47: goto tr236; + case 60: goto tr176; + case 62: goto tr240; + case 92: goto tr172; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr239; + } else if ( (*p) >= 9 ) + goto tr238; + goto tr166; +st142: + if ( ++p == pe ) + goto _out142; +case 142: + switch( (*p) ) { + case 34: goto tr3; + case 92: goto tr200; + } + goto tr199; +st143: + if ( ++p == pe ) + goto _out143; +case 143: + switch( (*p) ) { + case 39: goto tr3; + case 92: goto tr177; + } + goto tr176; +tr157: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st144; +st144: + if ( ++p == pe ) + goto _out144; +case 144: +#line 4798 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 13: goto tr163; + case 32: goto tr163; + case 34: goto st142; + case 39: goto st143; + case 47: goto tr161; + case 60: goto tr69; + case 62: goto tr162; + } + if ( (*p) > 10 ) { + if ( 11 <= (*p) && (*p) <= 12 ) + goto tr164; + } else if ( (*p) >= 9 ) + goto tr163; + goto tr156; +st145: + if ( ++p == pe ) + goto _out145; +case 145: + switch( (*p) ) { + case 58: goto tr339; + case 95: goto tr339; + case 120: goto tr340; + } + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr339; + } else if ( (*p) >= 65 ) + goto tr339; + goto tr296; +tr339: +#line 46 "ext/hpricot_scan/hpricot_scan.rl" + { TEXT_PASS(); } + goto st146; +st146: + if ( ++p == pe ) + goto _out146; +case 146: +#line 4837 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st212; + case 63: goto st146; + case 95: goto st146; + } + if ( (*p) < 48 ) { + if ( (*p) > 13 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st146; + } else if ( (*p) >= 9 ) + goto st212; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st146; + } else if ( (*p) >= 65 ) + goto st146; + } else + goto st146; + goto tr296; +st212: + if ( ++p == pe ) + goto _out212; +case 212: + if ( (*p) == 32 ) + goto st212; + if ( 9 <= (*p) && (*p) <= 13 ) + goto st212; + goto tr14; +tr340: +#line 46 "ext/hpricot_scan/hpricot_scan.rl" + { TEXT_PASS(); } + goto st147; +st147: + if ( ++p == pe ) + goto _out147; +case 147: +#line 4875 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st212; + case 63: goto st146; + case 95: goto st146; + case 109: goto st148; + } + if ( (*p) < 48 ) { + if ( (*p) > 13 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st146; + } else if ( (*p) >= 9 ) + goto st212; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st146; + } else if ( (*p) >= 65 ) + goto st146; + } else + goto st146; + goto tr296; +st148: + if ( ++p == pe ) + goto _out148; +case 148: + switch( (*p) ) { + case 32: goto st212; + case 63: goto st146; + case 95: goto st146; + case 108: goto st149; + } + if ( (*p) < 48 ) { + if ( (*p) > 13 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st146; + } else if ( (*p) >= 9 ) + goto st212; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st146; + } else if ( (*p) >= 65 ) + goto st146; + } else + goto st146; + goto tr296; +st149: + if ( ++p == pe ) + goto _out149; +case 149: + switch( (*p) ) { + case 32: goto tr16; + case 63: goto st146; + case 95: goto st146; + } + if ( (*p) < 48 ) { + if ( (*p) > 13 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st146; + } else if ( (*p) >= 9 ) + goto tr16; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st146; + } else if ( (*p) >= 65 ) + goto st146; + } else + goto st146; + goto tr296; +tr16: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} + goto st213; +st213: + if ( ++p == pe ) + goto _out213; +case 213: +#line 4954 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto tr16; + case 118: goto st150; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto tr16; + goto tr14; +st150: + if ( ++p == pe ) + goto _out150; +case 150: + if ( (*p) == 101 ) + goto st151; + goto tr264; +st151: + if ( ++p == pe ) + goto _out151; +case 151: + if ( (*p) == 114 ) + goto st152; + goto tr264; +st152: + if ( ++p == pe ) + goto _out152; +case 152: + if ( (*p) == 115 ) + goto st153; + goto tr264; +st153: + if ( ++p == pe ) + goto _out153; +case 153: + if ( (*p) == 105 ) + goto st154; + goto tr264; +st154: + if ( ++p == pe ) + goto _out154; +case 154: + if ( (*p) == 111 ) + goto st155; + goto tr264; +st155: + if ( ++p == pe ) + goto _out155; +case 155: + if ( (*p) == 110 ) + goto st156; + goto tr264; +st156: + if ( ++p == pe ) + goto _out156; +case 156: + switch( (*p) ) { + case 32: goto st156; + case 61: goto st157; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st156; + goto tr264; +st157: + if ( ++p == pe ) + goto _out157; +case 157: + switch( (*p) ) { + case 32: goto st157; + case 34: goto st158; + case 39: goto st200; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st157; + goto tr264; +st158: + if ( ++p == pe ) + goto _out158; +case 158: + if ( (*p) == 95 ) + goto tr282; + if ( (*p) < 48 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto tr282; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr282; + } else if ( (*p) >= 65 ) + goto tr282; + } else + goto tr282; + goto tr264; +tr282: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st159; +st159: + if ( ++p == pe ) + goto _out159; +case 159: +#line 5053 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 34: goto tr275; + case 95: goto st159; + } + if ( (*p) < 48 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st159; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st159; + } else if ( (*p) >= 65 ) + goto st159; + } else + goto st159; + goto tr264; +tr275: +#line 88 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); ATTR(rb_str_new2("version"), aval); } + goto st160; +st160: + if ( ++p == pe ) + goto _out160; +case 160: +#line 5078 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st161; + case 62: goto tr270; + case 63: goto st162; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st161; + goto tr264; +st161: + if ( ++p == pe ) + goto _out161; +case 161: + switch( (*p) ) { + case 32: goto st161; + case 62: goto tr270; + case 63: goto st162; + case 101: goto st163; + case 115: goto st176; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st161; + goto tr264; +st162: + if ( ++p == pe ) + goto _out162; +case 162: + if ( (*p) == 62 ) + goto tr270; + goto tr264; +st163: + if ( ++p == pe ) + goto _out163; +case 163: + if ( (*p) == 110 ) + goto st164; + goto tr264; +st164: + if ( ++p == pe ) + goto _out164; +case 164: + if ( (*p) == 99 ) + goto st165; + goto tr264; +st165: + if ( ++p == pe ) + goto _out165; +case 165: + if ( (*p) == 111 ) + goto st166; + goto tr264; +st166: + if ( ++p == pe ) + goto _out166; +case 166: + if ( (*p) == 100 ) + goto st167; + goto tr264; +st167: + if ( ++p == pe ) + goto _out167; +case 167: + if ( (*p) == 105 ) + goto st168; + goto tr264; +st168: + if ( ++p == pe ) + goto _out168; +case 168: + if ( (*p) == 110 ) + goto st169; + goto tr264; +st169: + if ( ++p == pe ) + goto _out169; +case 169: + if ( (*p) == 103 ) + goto st170; + goto tr264; +st170: + if ( ++p == pe ) + goto _out170; +case 170: + switch( (*p) ) { + case 32: goto st170; + case 61: goto st171; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st170; + goto tr264; +st171: + if ( ++p == pe ) + goto _out171; +case 171: + switch( (*p) ) { + case 32: goto st171; + case 34: goto st172; + case 39: goto st198; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st171; + goto tr264; +st172: + if ( ++p == pe ) + goto _out172; +case 172: + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr283; + } else if ( (*p) >= 65 ) + goto tr283; + goto tr264; +tr283: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st173; +st173: + if ( ++p == pe ) + goto _out173; +case 173: +#line 5198 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 34: goto tr277; + case 95: goto st173; + } + if ( (*p) < 48 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st173; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st173; + } else if ( (*p) >= 65 ) + goto st173; + } else + goto st173; + goto tr264; +tr277: +#line 89 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); ATTR(rb_str_new2("encoding"), aval); } + goto st174; +st174: + if ( ++p == pe ) + goto _out174; +case 174: +#line 5223 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st175; + case 62: goto tr270; + case 63: goto st162; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st175; + goto tr264; +st175: + if ( ++p == pe ) + goto _out175; +case 175: + switch( (*p) ) { + case 32: goto st175; + case 62: goto tr270; + case 63: goto st162; + case 115: goto st176; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st175; + goto tr264; +st176: + if ( ++p == pe ) + goto _out176; +case 176: + if ( (*p) == 116 ) + goto st177; + goto tr264; +st177: + if ( ++p == pe ) + goto _out177; +case 177: + if ( (*p) == 97 ) + goto st178; + goto tr264; +st178: + if ( ++p == pe ) + goto _out178; +case 178: + if ( (*p) == 110 ) + goto st179; + goto tr264; +st179: + if ( ++p == pe ) + goto _out179; +case 179: + if ( (*p) == 100 ) + goto st180; + goto tr264; +st180: + if ( ++p == pe ) + goto _out180; +case 180: + if ( (*p) == 97 ) + goto st181; + goto tr264; +st181: + if ( ++p == pe ) + goto _out181; +case 181: + if ( (*p) == 108 ) + goto st182; + goto tr264; +st182: + if ( ++p == pe ) + goto _out182; +case 182: + if ( (*p) == 111 ) + goto st183; + goto tr264; +st183: + if ( ++p == pe ) + goto _out183; +case 183: + if ( (*p) == 110 ) + goto st184; + goto tr264; +st184: + if ( ++p == pe ) + goto _out184; +case 184: + if ( (*p) == 101 ) + goto st185; + goto tr264; +st185: + if ( ++p == pe ) + goto _out185; +case 185: + switch( (*p) ) { + case 32: goto st185; + case 61: goto st186; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st185; + goto tr264; +st186: + if ( ++p == pe ) + goto _out186; +case 186: + switch( (*p) ) { + case 32: goto st186; + case 34: goto st187; + case 39: goto st193; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st186; + goto tr264; +st187: + if ( ++p == pe ) + goto _out187; +case 187: + switch( (*p) ) { + case 110: goto tr291; + case 121: goto tr292; + } + goto tr264; +tr291: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st188; +st188: + if ( ++p == pe ) + goto _out188; +case 188: +#line 5348 "ext/hpricot_scan/hpricot_scan.c" + if ( (*p) == 111 ) + goto st189; + goto tr264; +st189: + if ( ++p == pe ) + goto _out189; +case 189: + if ( (*p) == 34 ) + goto tr279; + goto tr264; +tr279: +#line 90 "ext/hpricot_scan/hpricot_scan.rl" + { SET(aval, p); ATTR(rb_str_new2("standalone"), aval); } + goto st190; +st190: + if ( ++p == pe ) + goto _out190; +case 190: +#line 5367 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 32: goto st190; + case 62: goto tr270; + case 63: goto st162; + } + if ( 9 <= (*p) && (*p) <= 13 ) + goto st190; + goto tr264; +tr292: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st191; +st191: + if ( ++p == pe ) + goto _out191; +case 191: +#line 5384 "ext/hpricot_scan/hpricot_scan.c" + if ( (*p) == 101 ) + goto st192; + goto tr264; +st192: + if ( ++p == pe ) + goto _out192; +case 192: + if ( (*p) == 115 ) + goto st189; + goto tr264; +st193: + if ( ++p == pe ) + goto _out193; +case 193: + switch( (*p) ) { + case 110: goto tr405; + case 121: goto tr406; + } + goto tr264; +tr405: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st194; +st194: + if ( ++p == pe ) + goto _out194; +case 194: +#line 5412 "ext/hpricot_scan/hpricot_scan.c" + if ( (*p) == 111 ) + goto st195; + goto tr264; +st195: + if ( ++p == pe ) + goto _out195; +case 195: + if ( (*p) == 39 ) + goto tr279; + goto tr264; +tr406: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st196; +st196: + if ( ++p == pe ) + goto _out196; +case 196: +#line 5431 "ext/hpricot_scan/hpricot_scan.c" + if ( (*p) == 101 ) + goto st197; + goto tr264; +st197: + if ( ++p == pe ) + goto _out197; +case 197: + if ( (*p) == 115 ) + goto st195; + goto tr264; +st198: + if ( ++p == pe ) + goto _out198; +case 198: + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr383; + } else if ( (*p) >= 65 ) + goto tr383; + goto tr264; +tr383: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st199; +st199: + if ( ++p == pe ) + goto _out199; +case 199: +#line 5460 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 39: goto tr277; + case 95: goto st199; + } + if ( (*p) < 48 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st199; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st199; + } else if ( (*p) >= 65 ) + goto st199; + } else + goto st199; + goto tr264; +st200: + if ( ++p == pe ) + goto _out200; +case 200: + if ( (*p) == 95 ) + goto tr382; + if ( (*p) < 48 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto tr382; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr382; + } else if ( (*p) >= 65 ) + goto tr382; + } else + goto tr382; + goto tr264; +tr382: +#line 78 "ext/hpricot_scan/hpricot_scan.rl" + { mark_aval = p; } + goto st201; +st201: + if ( ++p == pe ) + goto _out201; +case 201: +#line 5503 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 39: goto tr275; + case 95: goto st201; + } + if ( (*p) < 48 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st201; + } else if ( (*p) > 58 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st201; + } else if ( (*p) >= 65 ) + goto st201; + } else + goto st201; + goto tr264; +tr409: +#line 51 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p;{ TEXT_PASS(); }{p = ((tokend))-1;}} + goto st214; +tr411: +#line 51 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ TEXT_PASS(); }{p = ((tokend))-1;}} + goto st214; +tr412: +#line 9 "ext/hpricot_scan/hpricot_scan.rl" + {curline += 1;} +#line 51 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ TEXT_PASS(); }{p = ((tokend))-1;}} + goto st214; +tr414: +#line 51 "ext/hpricot_scan/hpricot_scan.rl" + {{ TEXT_PASS(); }{p = ((tokend))-1;}} + goto st214; +tr415: +#line 50 "ext/hpricot_scan/hpricot_scan.rl" + { EBLK(comment, 3); {goto st204;} } +#line 50 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{p = ((tokend))-1;}} + goto st214; +st214: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokstart = 0;} + if ( ++p == pe ) + goto _out214; +case 214: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokstart = p;} +#line 5552 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 10: goto tr412; + case 45: goto tr413; + } + goto tr411; +tr413: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} + goto st215; +st215: + if ( ++p == pe ) + goto _out215; +case 215: +#line 5566 "ext/hpricot_scan/hpricot_scan.c" + if ( (*p) == 45 ) + goto st202; + goto tr409; +st202: + if ( ++p == pe ) + goto _out202; +case 202: + if ( (*p) == 62 ) + goto tr415; + goto tr414; +tr416: +#line 56 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p;{ TEXT_PASS(); }{p = ((tokend))-1;}} + goto st216; +tr418: +#line 56 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ TEXT_PASS(); }{p = ((tokend))-1;}} + goto st216; +tr419: +#line 9 "ext/hpricot_scan/hpricot_scan.rl" + {curline += 1;} +#line 56 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ TEXT_PASS(); }{p = ((tokend))-1;}} + goto st216; +tr421: +#line 56 "ext/hpricot_scan/hpricot_scan.rl" + {{ TEXT_PASS(); }{p = ((tokend))-1;}} + goto st216; +tr422: +#line 55 "ext/hpricot_scan/hpricot_scan.rl" + { EBLK(cdata, 3); {goto st204;} } +#line 55 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{p = ((tokend))-1;}} + goto st216; +st216: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokstart = 0;} + if ( ++p == pe ) + goto _out216; +case 216: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokstart = p;} +#line 5609 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 10: goto tr419; + case 93: goto tr420; + } + goto tr418; +tr420: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;} + goto st217; +st217: + if ( ++p == pe ) + goto _out217; +case 217: +#line 5623 "ext/hpricot_scan/hpricot_scan.c" + if ( (*p) == 93 ) + goto st203; + goto tr416; +st203: + if ( ++p == pe ) + goto _out203; +case 203: + if ( (*p) == 62 ) + goto tr422; + goto tr421; +tr423: +#line 61 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p;{ TEXT_PASS(); }{p = ((tokend))-1;}} + goto st218; +tr424: +#line 60 "ext/hpricot_scan/hpricot_scan.rl" + { EBLK(procins, 2); {goto st204;} } +#line 60 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{p = ((tokend))-1;}} + goto st218; +tr425: +#line 61 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ TEXT_PASS(); }{p = ((tokend))-1;}} + goto st218; +tr426: +#line 9 "ext/hpricot_scan/hpricot_scan.rl" + {curline += 1;} +#line 61 "ext/hpricot_scan/hpricot_scan.rl" + {tokend = p+1;{ TEXT_PASS(); }{p = ((tokend))-1;}} + goto st218; +st218: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokstart = 0;} + if ( ++p == pe ) + goto _out218; +case 218: +#line 1 "ext/hpricot_scan/hpricot_scan.rl" + {tokstart = p;} +#line 5662 "ext/hpricot_scan/hpricot_scan.c" + switch( (*p) ) { + case 10: goto tr426; + case 62: goto tr424; + case 63: goto st219; + } + goto tr425; +st219: + if ( ++p == pe ) + goto _out219; +case 219: + if ( (*p) == 62 ) + goto tr424; + goto tr423; + } + _out204: cs = 204; goto _out; + _out205: cs = 205; goto _out; + _out0: cs = 0; goto _out; + _out1: cs = 1; goto _out; + _out2: cs = 2; goto _out; + _out3: cs = 3; goto _out; + _out4: cs = 4; goto _out; + _out5: cs = 5; goto _out; + _out6: cs = 6; goto _out; + _out7: cs = 7; goto _out; + _out8: cs = 8; goto _out; + _out9: cs = 9; goto _out; + _out10: cs = 10; goto _out; + _out11: cs = 11; goto _out; + _out12: cs = 12; goto _out; + _out13: cs = 13; goto _out; + _out14: cs = 14; goto _out; + _out15: cs = 15; goto _out; + _out16: cs = 16; goto _out; + _out17: cs = 17; goto _out; + _out18: cs = 18; goto _out; + _out19: cs = 19; goto _out; + _out20: cs = 20; goto _out; + _out21: cs = 21; goto _out; + _out22: cs = 22; goto _out; + _out23: cs = 23; goto _out; + _out24: cs = 24; goto _out; + _out25: cs = 25; goto _out; + _out26: cs = 26; goto _out; + _out27: cs = 27; goto _out; + _out28: cs = 28; goto _out; + _out29: cs = 29; goto _out; + _out30: cs = 30; goto _out; + _out31: cs = 31; goto _out; + _out32: cs = 32; goto _out; + _out33: cs = 33; goto _out; + _out34: cs = 34; goto _out; + _out35: cs = 35; goto _out; + _out36: cs = 36; goto _out; + _out37: cs = 37; goto _out; + _out38: cs = 38; goto _out; + _out39: cs = 39; goto _out; + _out206: cs = 206; goto _out; + _out40: cs = 40; goto _out; + _out41: cs = 41; goto _out; + _out207: cs = 207; goto _out; + _out42: cs = 42; goto _out; + _out43: cs = 43; goto _out; + _out208: cs = 208; goto _out; + _out44: cs = 44; goto _out; + _out45: cs = 45; goto _out; + _out46: cs = 46; goto _out; + _out47: cs = 47; goto _out; + _out48: cs = 48; goto _out; + _out49: cs = 49; goto _out; + _out50: cs = 50; goto _out; + _out51: cs = 51; goto _out; + _out52: cs = 52; goto _out; + _out53: cs = 53; goto _out; + _out54: cs = 54; goto _out; + _out55: cs = 55; goto _out; + _out56: cs = 56; goto _out; + _out57: cs = 57; goto _out; + _out58: cs = 58; goto _out; + _out59: cs = 59; goto _out; + _out60: cs = 60; goto _out; + _out61: cs = 61; goto _out; + _out62: cs = 62; goto _out; + _out63: cs = 63; goto _out; + _out64: cs = 64; goto _out; + _out65: cs = 65; goto _out; + _out66: cs = 66; goto _out; + _out67: cs = 67; goto _out; + _out68: cs = 68; goto _out; + _out69: cs = 69; goto _out; + _out70: cs = 70; goto _out; + _out71: cs = 71; goto _out; + _out72: cs = 72; goto _out; + _out73: cs = 73; goto _out; + _out74: cs = 74; goto _out; + _out75: cs = 75; goto _out; + _out76: cs = 76; goto _out; + _out77: cs = 77; goto _out; + _out78: cs = 78; goto _out; + _out79: cs = 79; goto _out; + _out80: cs = 80; goto _out; + _out81: cs = 81; goto _out; + _out82: cs = 82; goto _out; + _out83: cs = 83; goto _out; + _out84: cs = 84; goto _out; + _out209: cs = 209; goto _out; + _out85: cs = 85; goto _out; + _out86: cs = 86; goto _out; + _out87: cs = 87; goto _out; + _out88: cs = 88; goto _out; + _out89: cs = 89; goto _out; + _out90: cs = 90; goto _out; + _out91: cs = 91; goto _out; + _out92: cs = 92; goto _out; + _out93: cs = 93; goto _out; + _out94: cs = 94; goto _out; + _out95: cs = 95; goto _out; + _out96: cs = 96; goto _out; + _out97: cs = 97; goto _out; + _out98: cs = 98; goto _out; + _out99: cs = 99; goto _out; + _out100: cs = 100; goto _out; + _out101: cs = 101; goto _out; + _out102: cs = 102; goto _out; + _out103: cs = 103; goto _out; + _out104: cs = 104; goto _out; + _out105: cs = 105; goto _out; + _out210: cs = 210; goto _out; + _out106: cs = 106; goto _out; + _out107: cs = 107; goto _out; + _out108: cs = 108; goto _out; + _out109: cs = 109; goto _out; + _out110: cs = 110; goto _out; + _out111: cs = 111; goto _out; + _out112: cs = 112; goto _out; + _out113: cs = 113; goto _out; + _out114: cs = 114; goto _out; + _out115: cs = 115; goto _out; + _out116: cs = 116; goto _out; + _out117: cs = 117; goto _out; + _out118: cs = 118; goto _out; + _out119: cs = 119; goto _out; + _out120: cs = 120; goto _out; + _out121: cs = 121; goto _out; + _out211: cs = 211; goto _out; + _out122: cs = 122; goto _out; + _out123: cs = 123; goto _out; + _out124: cs = 124; goto _out; + _out125: cs = 125; goto _out; + _out126: cs = 126; goto _out; + _out127: cs = 127; goto _out; + _out128: cs = 128; goto _out; + _out129: cs = 129; goto _out; + _out130: cs = 130; goto _out; + _out131: cs = 131; goto _out; + _out132: cs = 132; goto _out; + _out133: cs = 133; goto _out; + _out134: cs = 134; goto _out; + _out135: cs = 135; goto _out; + _out136: cs = 136; goto _out; + _out137: cs = 137; goto _out; + _out138: cs = 138; goto _out; + _out139: cs = 139; goto _out; + _out140: cs = 140; goto _out; + _out141: cs = 141; goto _out; + _out142: cs = 142; goto _out; + _out143: cs = 143; goto _out; + _out144: cs = 144; goto _out; + _out145: cs = 145; goto _out; + _out146: cs = 146; goto _out; + _out212: cs = 212; goto _out; + _out147: cs = 147; goto _out; + _out148: cs = 148; goto _out; + _out149: cs = 149; goto _out; + _out213: cs = 213; goto _out; + _out150: cs = 150; goto _out; + _out151: cs = 151; goto _out; + _out152: cs = 152; goto _out; + _out153: cs = 153; goto _out; + _out154: cs = 154; goto _out; + _out155: cs = 155; goto _out; + _out156: cs = 156; goto _out; + _out157: cs = 157; goto _out; + _out158: cs = 158; goto _out; + _out159: cs = 159; goto _out; + _out160: cs = 160; goto _out; + _out161: cs = 161; goto _out; + _out162: cs = 162; goto _out; + _out163: cs = 163; goto _out; + _out164: cs = 164; goto _out; + _out165: cs = 165; goto _out; + _out166: cs = 166; goto _out; + _out167: cs = 167; goto _out; + _out168: cs = 168; goto _out; + _out169: cs = 169; goto _out; + _out170: cs = 170; goto _out; + _out171: cs = 171; goto _out; + _out172: cs = 172; goto _out; + _out173: cs = 173; goto _out; + _out174: cs = 174; goto _out; + _out175: cs = 175; goto _out; + _out176: cs = 176; goto _out; + _out177: cs = 177; goto _out; + _out178: cs = 178; goto _out; + _out179: cs = 179; goto _out; + _out180: cs = 180; goto _out; + _out181: cs = 181; goto _out; + _out182: cs = 182; goto _out; + _out183: cs = 183; goto _out; + _out184: cs = 184; goto _out; + _out185: cs = 185; goto _out; + _out186: cs = 186; goto _out; + _out187: cs = 187; goto _out; + _out188: cs = 188; goto _out; + _out189: cs = 189; goto _out; + _out190: cs = 190; goto _out; + _out191: cs = 191; goto _out; + _out192: cs = 192; goto _out; + _out193: cs = 193; goto _out; + _out194: cs = 194; goto _out; + _out195: cs = 195; goto _out; + _out196: cs = 196; goto _out; + _out197: cs = 197; goto _out; + _out198: cs = 198; goto _out; + _out199: cs = 199; goto _out; + _out200: cs = 200; goto _out; + _out201: cs = 201; goto _out; + _out214: cs = 214; goto _out; + _out215: cs = 215; goto _out; + _out202: cs = 202; goto _out; + _out216: cs = 216; goto _out; + _out217: cs = 217; goto _out; + _out203: cs = 203; goto _out; + _out218: cs = 218; goto _out; + _out219: cs = 219; goto _out; + + _out: {} + } +#line 197 "ext/hpricot_scan/hpricot_scan.rl" + + if ( cs == hpricot_scan_error ) { + free(buf); + if ( !NIL_P(tag) ) + { + rb_raise(rb_eHpricotParseError, "parse error on element <%s>, starting on line %d.\n" NO_WAY_SERIOUSLY, RSTRING(tag)->ptr, curline); + } + else + { + rb_raise(rb_eHpricotParseError, "parse error on line %d.\n" NO_WAY_SERIOUSLY, curline); + } + } + + if ( done && ele_open ) + { + ele_open = 0; + if (tokstart > 0) { + mark_tag = tokstart; + tokstart = 0; + text = 1; + } + } + + if ( tokstart == 0 ) + { + have = 0; + /* text nodes have no tokstart because each byte is parsed alone */ + if ( mark_tag != NULL && text == 1 ) + { + if (done) + { + if (mark_tag < p-1) + { + CAT(tag, p-1); + ELE(text); + } + } + else + { + CAT(tag, p); + } + } + mark_tag = buf; + } + else + { + have = pe - tokstart; + memmove( buf, tokstart, have ); + SLIDE(tag); + SLIDE(akey); + SLIDE(aval); + tokend = buf + (tokend - tokstart); + tokstart = buf; + } + } + free(buf); +} + +void Init_hpricot_scan() +{ + VALUE mHpricot = rb_define_module("Hpricot"); + rb_define_attr(rb_singleton_class(mHpricot), "buffer_size", 1, 1); + rb_define_singleton_method(mHpricot, "scan", hpricot_scan, 1); + rb_eHpricotParseError = rb_define_class_under(mHpricot, "ParseError", rb_eException); + + s_read = rb_intern("read"); + s_to_str = rb_intern("to_str"); + sym_xmldecl = ID2SYM(rb_intern("xmldecl")); + sym_doctype = ID2SYM(rb_intern("doctype")); + sym_procins = ID2SYM(rb_intern("procins")); + sym_stag = ID2SYM(rb_intern("stag")); + sym_etag = ID2SYM(rb_intern("etag")); + sym_emptytag = ID2SYM(rb_intern("emptytag")); + sym_comment = ID2SYM(rb_intern("comment")); + sym_cdata = ID2SYM(rb_intern("cdata")); + sym_text = ID2SYM(rb_intern("text")); +} diff --git a/vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.h b/vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.h new file mode 100644 index 0000000..ecbe3b1 --- /dev/null +++ b/vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.h @@ -0,0 +1,79 @@ +/* + * hpricot_scan.h + * + * $Author: why $ + * $Date: 2006-05-08 22:03:50 -0600 (Mon, 08 May 2006) $ + * + * Copyright (C) 2006 why the lucky stiff + * You can redistribute it and/or modify it under the same terms as Ruby. + */ + +#ifndef hpricot_scan_h +#define hpricot_scan_h + +#include + +#if defined(_WIN32) +#include +#endif + +/* + * Memory Allocation + */ +#if defined(HAVE_ALLOCA_H) && !defined(__GNUC__) +#include +#endif + +#ifndef NULL +# define NULL (void *)0 +#endif + +#define BUFSIZE 16384 + +#define S_ALLOC_N(type,n) (type*)malloc(sizeof(type)*(n)) +#define S_ALLOC(type) (type*)malloc(sizeof(type)) +#define S_REALLOC_N(var,type,n) (var)=(type*)realloc((char*)(var),sizeof(type)*(n)) +#define S_FREE(n) free(n); n = NULL; + +#define S_ALLOCA_N(type,n) (type*)alloca(sizeof(type)*(n)) + +#define S_MEMZERO(p,type,n) memset((p), 0, sizeof(type)*(n)) +#define S_MEMCPY(p1,p2,type,n) memcpy((p1), (p2), sizeof(type)*(n)) +#define S_MEMMOVE(p1,p2,type,n) memmove((p1), (p2), sizeof(type)*(n)) +#define S_MEMCMP(p1,p2,type,n) memcmp((p1), (p2), sizeof(type)*(n)) + +typedef struct { + void *name; + void *attributes; +} hpricot_element; + +typedef void (*hpricot_element_cb)(void *data, hpricot_element *token); + +typedef struct hpricot_scan { + int lineno; + int cs; + size_t nread; + size_t mark; + + void *data; + + hpricot_element_cb xmldecl; + hpricot_element_cb doctype; + hpricot_element_cb xmlprocins; + hpricot_element_cb starttag; + hpricot_element_cb endtag; + hpricot_element_cb emptytag; + hpricot_element_cb comment; + hpricot_element_cb cdata; + +} http_scan; + +// int hpricot_scan_init(hpricot_scan *scan); +// int hpricot_scan_finish(hpricot_scan *scan); +// size_t hpricot_scan_execute(hpricot_scan *scan, const char *data, size_t len, size_t off); +// int hpricot_scan_has_error(hpricot_scan *scan); +// int hpricot_scan_is_finished(hpricot_scan *scan); +// +// #define hpricot_scan_nread(scan) (scan)->nread + +#endif diff --git a/vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.java.rl b/vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.java.rl new file mode 100644 index 0000000..b5860a8 --- /dev/null +++ b/vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.java.rl @@ -0,0 +1,363 @@ + +import java.io.IOException; + +import org.jruby.Ruby; +import org.jruby.RubyClass; +import org.jruby.RubyHash; +import org.jruby.RubyModule; +import org.jruby.RubyNumeric; +import org.jruby.RubyString; +import org.jruby.runtime.Block; +import org.jruby.runtime.CallbackFactory; +import org.jruby.runtime.builtin.IRubyObject; +import org.jruby.exceptions.RaiseException; +import org.jruby.runtime.load.BasicLibraryService; + +public class HpricotScanService implements BasicLibraryService { + public static String NO_WAY_SERIOUSLY="*** This should not happen, please send a bug report with the HTML you're parsing to why@whytheluckystiff.net. So sorry!"; + + public void ELE(IRubyObject N) { + if (tokend > tokstart || text) { + IRubyObject raw_string = runtime.getNil(); + ele_open = false; text = false; + if (tokstart != -1 && N != cdata && N != sym_text && N != procins && N != comment) { + raw_string = runtime.newString(new String(buf,tokstart,tokend-tokstart)); + } + rb_yield_tokens(N, tag[0], attr, raw_string, taint); + } + } + + public void SET(IRubyObject[] N, int E) { + int mark = 0; + if(N == tag) { + if(mark_tag == -1 || E == mark_tag) { + tag[0] = runtime.newString(""); + } else if(E > mark_tag) { + tag[0] = runtime.newString(new String(buf,mark_tag, E-mark_tag)); + } + } else if(N == akey) { + if(mark_akey == -1 || E == mark_akey) { + akey[0] = runtime.newString(""); + } else if(E > mark_akey) { + akey[0] = runtime.newString(new String(buf,mark_akey, E-mark_akey)); + } + } else if(N == aval) { + if(mark_aval == -1 || E == mark_aval) { + aval[0] = runtime.newString(""); + } else if(E > mark_aval) { + aval[0] = runtime.newString(new String(buf,mark_aval, E-mark_aval)); + } + } + } + + public void CAT(IRubyObject[] N, int E) { + if(N[0].isNil()) { + SET(N,E); + } else { + int mark = 0; + if(N == tag) { + mark = mark_tag; + } else if(N == akey) { + mark = mark_akey; + } else if(N == aval) { + mark = mark_aval; + } + ((RubyString)(N[0])).append(runtime.newString(new String(buf, mark, E-mark))); + } + } + + public void SLIDE(Object N) { + int mark = 0; + if(N == tag) { + mark = mark_tag; + } else if(N == akey) { + mark = mark_akey; + } else if(N == aval) { + mark = mark_aval; + } + if(mark > tokstart) { + if(N == tag) { + mark_tag -= tokstart; + } else if(N == akey) { + mark_akey -= tokstart; + } else if(N == aval) { + mark_aval -= tokstart; + } + } + } + + public void ATTR(IRubyObject K, IRubyObject V) { + if(!K.isNil()) { + if(attr.isNil()) { + attr = RubyHash.newHash(runtime); + } + ((RubyHash)attr).aset(K,V); + } + } + + public void ATTR(IRubyObject[] K, IRubyObject V) { + ATTR(K[0],V); + } + + public void ATTR(IRubyObject K, IRubyObject[] V) { + ATTR(K,V[0]); + } + + public void ATTR(IRubyObject[] K, IRubyObject[] V) { + ATTR(K[0],V[0]); + } + + public void TEXT_PASS() { + if(!text) { + if(ele_open) { + ele_open = false; + if(tokstart > -1) { + mark_tag = tokstart; + } + } else { + mark_tag = p; + } + attr = runtime.getNil(); + tag[0] = runtime.getNil(); + text = true; + } + } + + public void EBLK(IRubyObject N, int T) { + CAT(tag, p - T + 1); + ELE(N); + } + + + public void rb_raise(RubyClass error, String message) { + throw new RaiseException(runtime, error, message, true); + } + + public IRubyObject rb_str_new2(String s) { + return runtime.newString(s); + } + +%%{ + machine hpricot_scan; + + action newEle { + if (text) { + CAT(tag, p); + ELE(sym_text); + text = false; + } + attr = runtime.getNil(); + tag[0] = runtime.getNil(); + mark_tag = -1; + ele_open = true; + } + + action _tag { mark_tag = p; } + action _aval { mark_aval = p; } + action _akey { mark_akey = p; } + action tag { SET(tag, p); } + action tagc { SET(tag, p-1); } + action aval { SET(aval, p); } + action aunq { + if (buf[p-1] == '"' || buf[p-1] == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + action akey { SET(akey, p); } + action xmlver { SET(aval, p); ATTR(rb_str_new2("version"), aval); } + action xmlenc { SET(aval, p); ATTR(rb_str_new2("encoding"), aval); } + action xmlsd { SET(aval, p); ATTR(rb_str_new2("standalone"), aval); } + action pubid { SET(aval, p); ATTR(rb_str_new2("public_id"), aval); } + action sysid { SET(aval, p); ATTR(rb_str_new2("system_id"), aval); } + + action new_attr { + akey[0] = runtime.getNil(); + aval[0] = runtime.getNil(); + mark_akey = -1; + mark_aval = -1; + } + + action save_attr { + ATTR(akey, aval); + } + + include hpricot_common "ext/hpricot_scan/hpricot_common.rl"; + +}%% + +%% write data nofinal; + +public final static int BUFSIZE=16384; + +private void rb_yield_tokens(IRubyObject sym, IRubyObject tag, IRubyObject attr, IRubyObject raw, boolean taint) { + IRubyObject ary; + if (sym == runtime.newSymbol("text")) { + raw = tag; + } + ary = runtime.newArray(new IRubyObject[]{sym, tag, attr, raw}); + if (taint) { + ary.setTaint(true); + tag.setTaint(true); + attr.setTaint(true); + raw.setTaint(true); + } + block.yield(runtime.getCurrentContext(), ary, null, null, false); +} + + +int cs, act, have = 0, nread = 0, curline = 1, p=-1; +boolean text = false; +int tokstart=-1, tokend; +char[] buf; +Ruby runtime; +IRubyObject attr, bufsize; +IRubyObject[] tag, akey, aval; +int mark_tag, mark_akey, mark_aval; +boolean done = false, ele_open = false; +int buffer_size = 0; +boolean taint = false; +Block block = null; + + +IRubyObject xmldecl, doctype, procins, stag, etag, emptytag, comment, + cdata, sym_text; + +IRubyObject hpricot_scan(IRubyObject recv, IRubyObject port) { + attr = bufsize = runtime.getNil(); + tag = new IRubyObject[]{runtime.getNil()}; + akey = new IRubyObject[]{runtime.getNil()}; + aval = new IRubyObject[]{runtime.getNil()}; + + RubyClass rb_eHpricotParseError = runtime.getModule("Hpricot").getClass("ParseError"); + + taint = port.isTaint(); + if ( !port.respondsTo("read")) { + if ( port.respondsTo("to_str")) { + port = port.callMethod(runtime.getCurrentContext(),"to_str"); + } else { + throw runtime.newArgumentError("bad Hpricot argument, String or IO only please."); + } + } + + buffer_size = BUFSIZE; + if (recv.getInstanceVariable("@buffer_size") != null) { + bufsize = recv.getInstanceVariable("@buffer_size"); + if (!bufsize.isNil()) { + buffer_size = RubyNumeric.fix2int(bufsize); + } + } + buf = new char[buffer_size]; + + %% write init; + + while( !done ) { + IRubyObject str; + p = have; + int pe; + int len, space = buffer_size - have; + + if ( space == 0 ) { + /* We've used up the entire buffer storing an already-parsed token + * prefix that must be preserved. Likely caused by super-long attributes. + * See ticket #13. */ + rb_raise(rb_eHpricotParseError, "ran out of buffer space on element <" + tag.toString() + ">, starting on line "+curline+"."); + } + + if (port.respondsTo("read")) { + str = port.callMethod(runtime.getCurrentContext(),"read",runtime.newFixnum(space)); + } else { + str = ((RubyString)port).substr(nread,space); + } + + str = str.convertToString(); + String sss = str.toString(); + char[] chars = sss.toCharArray(); + System.arraycopy(chars,0,buf,p,chars.length); + + len = sss.length(); + nread += len; + + if ( len < space ) { + len++; + done = true; + } + + pe = p + len; + char[] data = buf; + + %% write exec; + + if ( cs == hpricot_scan_error ) { + if(!tag[0].isNil()) { + rb_raise(rb_eHpricotParseError, "parse error on element <"+tag.toString()+">, starting on line "+curline+".\n" + NO_WAY_SERIOUSLY); + } else { + rb_raise(rb_eHpricotParseError, "parse error on line "+curline+".\n" + NO_WAY_SERIOUSLY); + } + } + + if ( done && ele_open ) { + ele_open = false; + if(tokstart > -1) { + mark_tag = tokstart; + tokstart = -1; + text = true; + } + } + + if(tokstart == -1) { + have = 0; + /* text nodes have no tokstart because each byte is parsed alone */ + if(mark_tag != -1 && text) { + if (done) { + if(mark_tag < p-1) { + CAT(tag, p-1); + ELE(sym_text); + } + } else { + CAT(tag, p); + } + } + mark_tag = 0; + } else { + have = pe - tokstart; + System.arraycopy(buf,tokstart,buf,0,have); + SLIDE(tag); + SLIDE(akey); + SLIDE(aval); + tokend = (tokend - tokstart); + tokstart = 0; + } + } + return runtime.getNil(); +} + +public static IRubyObject __hpricot_scan(IRubyObject recv, IRubyObject port, Block block) { + Ruby runtime = recv.getRuntime(); + HpricotScanService service = new HpricotScanService(); + service.runtime = runtime; + service.xmldecl = runtime.newSymbol("xmldecl"); + service.doctype = runtime.newSymbol("doctype"); + service.procins = runtime.newSymbol("procins"); + service.stag = runtime.newSymbol("stag"); + service.etag = runtime.newSymbol("etag"); + service.emptytag = runtime.newSymbol("emptytag"); + service.comment = runtime.newSymbol("comment"); + service.cdata = runtime.newSymbol("cdata"); + service.sym_text = runtime.newSymbol("text"); + service.block = block; + return service.hpricot_scan(recv, port); +} + + +public boolean basicLoad(final Ruby runtime) throws IOException { + Init_hpricot_scan(runtime); + return true; +} + +public static void Init_hpricot_scan(Ruby runtime) { + RubyModule mHpricot = runtime.defineModule("Hpricot"); + mHpricot.getMetaClass().attr_accessor(new IRubyObject[]{runtime.newSymbol("buffer_size")}); + CallbackFactory fact = runtime.callbackFactory(HpricotScanService.class); + mHpricot.getMetaClass().defineMethod("scan",fact.getSingletonMethod("__hpricot_scan",IRubyObject.class)); + mHpricot.defineClassUnder("ParseError",runtime.getClass("Exception"),runtime.getClass("Exception").getAllocator()); +} +} diff --git a/vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.rl b/vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.rl new file mode 100644 index 0000000..df6d114 --- /dev/null +++ b/vendor/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.rl @@ -0,0 +1,273 @@ +/* + * hpricot_scan.rl + * + * $Author: why $ + * $Date: 2006-05-08 22:03:50 -0600 (Mon, 08 May 2006) $ + * + * Copyright (C) 2006 why the lucky stiff + */ +#include + +#define NO_WAY_SERIOUSLY "*** This should not happen, please send a bug report with the HTML you're parsing to why@whytheluckystiff.net. So sorry!" + +static VALUE sym_xmldecl, sym_doctype, sym_procins, sym_stag, sym_etag, sym_emptytag, sym_comment, + sym_cdata, sym_text; +static VALUE rb_eHpricotParseError; +static ID s_read, s_to_str; + +#define ELE(N) \ + if (tokend > tokstart || text == 1) { \ + VALUE raw_string = Qnil; \ + ele_open = 0; text = 0; \ + if (tokstart != 0 && sym_##N != sym_cdata && sym_##N != sym_text && sym_##N != sym_procins && sym_##N != sym_comment) { \ + raw_string = rb_str_new(tokstart, tokend-tokstart); \ + } \ + rb_yield_tokens(sym_##N, tag, attr, raw_string, taint); \ + } + +#define SET(N, E) \ + if (mark_##N == NULL || E == mark_##N) \ + N = rb_str_new2(""); \ + else if (E > mark_##N) \ + N = rb_str_new(mark_##N, E - mark_##N); + +#define CAT(N, E) if (NIL_P(N)) { SET(N, E); } else { rb_str_cat(N, mark_##N, E - mark_##N); } + +#define SLIDE(N) if ( mark_##N > tokstart ) mark_##N = buf + (mark_##N - tokstart); + +#define ATTR(K, V) \ + if (!NIL_P(K)) { \ + if (NIL_P(attr)) attr = rb_hash_new(); \ + rb_hash_aset(attr, K, V); \ + } + +#define TEXT_PASS() \ + if (text == 0) \ + { \ + if (ele_open == 1) { \ + ele_open = 0; \ + if (tokstart > 0) { \ + mark_tag = tokstart; \ + } \ + } else { \ + mark_tag = p; \ + } \ + attr = Qnil; \ + tag = Qnil; \ + text = 1; \ + } + +#define EBLK(N, T) CAT(tag, p - T + 1); ELE(N); + +%%{ + machine hpricot_scan; + + action newEle { + if (text == 1) { + CAT(tag, p); + ELE(text); + text = 0; + } + attr = Qnil; + tag = Qnil; + mark_tag = NULL; + ele_open = 1; + } + + action _tag { mark_tag = p; } + action _aval { mark_aval = p; } + action _akey { mark_akey = p; } + action tag { SET(tag, p); } + action tagc { SET(tag, p-1); } + action aval { SET(aval, p); } + action aunq { + if (*(p-1) == '"' || *(p-1) == '\'') { SET(aval, p-1); } + else { SET(aval, p); } + } + action akey { SET(akey, p); } + action xmlver { SET(aval, p); ATTR(rb_str_new2("version"), aval); } + action xmlenc { SET(aval, p); ATTR(rb_str_new2("encoding"), aval); } + action xmlsd { SET(aval, p); ATTR(rb_str_new2("standalone"), aval); } + action pubid { SET(aval, p); ATTR(rb_str_new2("public_id"), aval); } + action sysid { SET(aval, p); ATTR(rb_str_new2("system_id"), aval); } + + action new_attr { + akey = Qnil; + aval = Qnil; + mark_akey = NULL; + mark_aval = NULL; + } + + action save_attr { + ATTR(akey, aval); + } + + include hpricot_common "ext/hpricot_scan/hpricot_common.rl"; + +}%% + +%% write data nofinal; + +#define BUFSIZE 16384 + +void rb_yield_tokens(VALUE sym, VALUE tag, VALUE attr, VALUE raw, int taint) +{ + VALUE ary; + if (sym == sym_text) { + raw = tag; + } + ary = rb_ary_new3(4, sym, tag, attr, raw); + if (taint) { + OBJ_TAINT(ary); + OBJ_TAINT(tag); + OBJ_TAINT(attr); + OBJ_TAINT(raw); + } + rb_yield(ary); +} + +VALUE hpricot_scan(VALUE self, VALUE port) +{ + int cs, act, have = 0, nread = 0, curline = 1, text = 0; + char *tokstart = 0, *tokend = 0, *buf = NULL; + + VALUE attr = Qnil, tag = Qnil, akey = Qnil, aval = Qnil, bufsize = Qnil; + char *mark_tag = 0, *mark_akey = 0, *mark_aval = 0; + int done = 0, ele_open = 0, buffer_size = 0; + + int taint = OBJ_TAINTED( port ); + if ( !rb_respond_to( port, s_read ) ) + { + if ( rb_respond_to( port, s_to_str ) ) + { + port = rb_funcall( port, s_to_str, 0 ); + StringValue(port); + } + else + { + rb_raise( rb_eArgError, "bad Hpricot argument, String or IO only please." ); + } + } + + buffer_size = BUFSIZE; + if (rb_ivar_defined(self, rb_intern("@buffer_size")) == Qtrue) { + bufsize = rb_ivar_get(self, rb_intern("@buffer_size")); + if (!NIL_P(bufsize)) { + buffer_size = NUM2INT(bufsize); + } + } + buf = ALLOC_N(char, buffer_size); + + %% write init; + + while ( !done ) { + VALUE str; + char *p = buf + have, *pe; + int len, space = buffer_size - have; + + if ( space == 0 ) { + /* We've used up the entire buffer storing an already-parsed token + * prefix that must be preserved. Likely caused by super-long attributes. + * See ticket #13. */ + rb_raise(rb_eHpricotParseError, "ran out of buffer space on element <%s>, starting on line %d.", RSTRING(tag)->ptr, curline); + } + + if ( rb_respond_to( port, s_read ) ) + { + str = rb_funcall( port, s_read, 1, INT2FIX(space) ); + } + else + { + str = rb_str_substr( port, nread, space ); + } + + StringValue(str); + memcpy( p, RSTRING(str)->ptr, RSTRING(str)->len ); + len = RSTRING(str)->len; + nread += len; + + /* If this is the last buffer, tack on an EOF. */ + if ( len < space ) { + p[len++] = 0; + done = 1; + } + + pe = p + len; + %% write exec; + + if ( cs == hpricot_scan_error ) { + free(buf); + if ( !NIL_P(tag) ) + { + rb_raise(rb_eHpricotParseError, "parse error on element <%s>, starting on line %d.\n" NO_WAY_SERIOUSLY, RSTRING(tag)->ptr, curline); + } + else + { + rb_raise(rb_eHpricotParseError, "parse error on line %d.\n" NO_WAY_SERIOUSLY, curline); + } + } + + if ( done && ele_open ) + { + ele_open = 0; + if (tokstart > 0) { + mark_tag = tokstart; + tokstart = 0; + text = 1; + } + } + + if ( tokstart == 0 ) + { + have = 0; + /* text nodes have no tokstart because each byte is parsed alone */ + if ( mark_tag != NULL && text == 1 ) + { + if (done) + { + if (mark_tag < p-1) + { + CAT(tag, p-1); + ELE(text); + } + } + else + { + CAT(tag, p); + } + } + mark_tag = buf; + } + else + { + have = pe - tokstart; + memmove( buf, tokstart, have ); + SLIDE(tag); + SLIDE(akey); + SLIDE(aval); + tokend = buf + (tokend - tokstart); + tokstart = buf; + } + } + free(buf); +} + +void Init_hpricot_scan() +{ + VALUE mHpricot = rb_define_module("Hpricot"); + rb_define_attr(rb_singleton_class(mHpricot), "buffer_size", 1, 1); + rb_define_singleton_method(mHpricot, "scan", hpricot_scan, 1); + rb_eHpricotParseError = rb_define_class_under(mHpricot, "ParseError", rb_eException); + + s_read = rb_intern("read"); + s_to_str = rb_intern("to_str"); + sym_xmldecl = ID2SYM(rb_intern("xmldecl")); + sym_doctype = ID2SYM(rb_intern("doctype")); + sym_procins = ID2SYM(rb_intern("procins")); + sym_stag = ID2SYM(rb_intern("stag")); + sym_etag = ID2SYM(rb_intern("etag")); + sym_emptytag = ID2SYM(rb_intern("emptytag")); + sym_comment = ID2SYM(rb_intern("comment")); + sym_cdata = ID2SYM(rb_intern("cdata")); + sym_text = ID2SYM(rb_intern("text")); +} diff --git a/vendor/gems/hpricot-0.6/extras/mingw-rbconfig.rb b/vendor/gems/hpricot-0.6/extras/mingw-rbconfig.rb new file mode 100644 index 0000000..25dec44 --- /dev/null +++ b/vendor/gems/hpricot-0.6/extras/mingw-rbconfig.rb @@ -0,0 +1,176 @@ + +# This rbconfig.rb corresponds to a Ruby installation for win32 cross-compiled +# with mingw under i686-linux. It can be used to cross-compile extensions for +# win32 using said toolchain. +# +# This file assumes that a cross-compiled mingw32 build (compatible with the +# mswin32 builds) is installed under $HOME/ruby-mingw32. + +module Config + #RUBY_VERSION == "1.8.5" or + # raise "ruby lib version (1.8.5) doesn't match executable version (#{RUBY_VERSION})" + + mingw32 = ENV['MINGW32_RUBY'] || "#{ENV["HOME"]}/ruby-mingw32" + mingwpre = ENV['MINGW32_PREFIX'] + TOPDIR = File.dirname(__FILE__).chomp!("/lib/ruby/1.8/i386-mingw32") + DESTDIR = '' unless defined? DESTDIR + CONFIG = {} + CONFIG["DESTDIR"] = DESTDIR + CONFIG["INSTALL"] = "/usr/bin/install -c" + CONFIG["prefix"] = (TOPDIR || DESTDIR + mingw32) + CONFIG["EXEEXT"] = ".exe" + CONFIG["ruby_install_name"] = "ruby" + CONFIG["RUBY_INSTALL_NAME"] = "ruby" + CONFIG["RUBY_SO_NAME"] = "msvcrt-ruby18" + CONFIG["SHELL"] = "/bin/sh" + CONFIG["PATH_SEPARATOR"] = ":" + CONFIG["PACKAGE_NAME"] = "" + CONFIG["PACKAGE_TARNAME"] = "" + CONFIG["PACKAGE_VERSION"] = "" + CONFIG["PACKAGE_STRING"] = "" + CONFIG["PACKAGE_BUGREPORT"] = "" + CONFIG["exec_prefix"] = "$(prefix)" + CONFIG["bindir"] = "$(exec_prefix)/bin" + CONFIG["sbindir"] = "$(exec_prefix)/sbin" + CONFIG["libexecdir"] = "$(exec_prefix)/libexec" + CONFIG["datadir"] = "$(prefix)/share" + CONFIG["sysconfdir"] = "$(prefix)/etc" + CONFIG["sharedstatedir"] = "$(prefix)/com" + CONFIG["localstatedir"] = "$(prefix)/var" + CONFIG["libdir"] = "$(exec_prefix)/lib" + CONFIG["includedir"] = "$(prefix)/include" + CONFIG["oldincludedir"] = "/usr/include" + CONFIG["infodir"] = "$(prefix)/info" + CONFIG["mandir"] = "$(prefix)/man" + CONFIG["build_alias"] = "i686-linux" + CONFIG["host_alias"] = "#{mingwpre}" + CONFIG["target_alias"] = "i386-mingw32" + CONFIG["ECHO_C"] = "" + CONFIG["ECHO_N"] = "-n" + CONFIG["ECHO_T"] = "" + CONFIG["LIBS"] = "-lwsock32 " + CONFIG["MAJOR"] = "1" + CONFIG["MINOR"] = "8" + CONFIG["TEENY"] = "4" + CONFIG["build"] = "i686-pc-linux" + CONFIG["build_cpu"] = "i686" + CONFIG["build_vendor"] = "pc" + CONFIG["build_os"] = "linux" + CONFIG["host"] = "i586-pc-mingw32msvc" + CONFIG["host_cpu"] = "i586" + CONFIG["host_vendor"] = "pc" + CONFIG["host_os"] = "mingw32msvc" + CONFIG["target"] = "i386-pc-mingw32" + CONFIG["target_cpu"] = "i386" + CONFIG["target_vendor"] = "pc" + CONFIG["target_os"] = "mingw32" + CONFIG["CC"] = "#{mingwpre}-gcc" + CONFIG["CFLAGS"] = "-g -O2 " + CONFIG["LDFLAGS"] = "" + CONFIG["CPPFLAGS"] = "" + CONFIG["OBJEXT"] = "o" + CONFIG["CPP"] = "#{mingwpre}-gcc -E" + CONFIG["EGREP"] = "grep -E" + CONFIG["GNU_LD"] = "yes" + CONFIG["CPPOUTFILE"] = "-o conftest.i" + CONFIG["OUTFLAG"] = "-o " + CONFIG["YACC"] = "bison -y" + CONFIG["RANLIB"] = "#{mingwpre}-ranlib" + CONFIG["AR"] = "#{mingwpre}-ar" + CONFIG["NM"] = "#{mingwpre}-nm" + CONFIG["WINDRES"] = "#{mingwpre}-windres" + CONFIG["DLLWRAP"] = "#{mingwpre}-dllwrap" + CONFIG["OBJDUMP"] = "#{mingwpre}-objdump" + CONFIG["LN_S"] = "ln -s" + CONFIG["SET_MAKE"] = "" + CONFIG["INSTALL_PROGRAM"] = "$(INSTALL)" + CONFIG["INSTALL_SCRIPT"] = "$(INSTALL)" + CONFIG["INSTALL_DATA"] = "$(INSTALL) -m 644" + CONFIG["RM"] = "rm -f" + CONFIG["CP"] = "cp" + CONFIG["MAKEDIRS"] = "mkdir -p" + CONFIG["LIBOBJS"] = " fileblocks$(U).o crypt$(U).o flock$(U).o acosh$(U).o win32$(U).o" + CONFIG["ALLOCA"] = "" + CONFIG["DLDFLAGS"] = " -Wl,--enable-auto-import,--export-all" + CONFIG["ARCH_FLAG"] = "" + CONFIG["STATIC"] = "" + CONFIG["CCDLFLAGS"] = "" + CONFIG["LDSHARED"] = "#{mingwpre}-gcc -shared -s" + CONFIG["DLEXT"] = "so" + CONFIG["DLEXT2"] = "dll" + CONFIG["LIBEXT"] = "a" + CONFIG["LINK_SO"] = "" + CONFIG["LIBPATHFLAG"] = " -L\"%s\"" + CONFIG["RPATHFLAG"] = "" + CONFIG["LIBPATHENV"] = "" + CONFIG["TRY_LINK"] = "" + CONFIG["STRIP"] = "strip" + CONFIG["EXTSTATIC"] = "" + CONFIG["setup"] = "Setup" + CONFIG["MINIRUBY"] = "ruby -rfake" + CONFIG["PREP"] = "fake.rb" + CONFIG["RUNRUBY"] = "$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`" + CONFIG["EXTOUT"] = ".ext" + CONFIG["ARCHFILE"] = "" + CONFIG["RDOCTARGET"] = "" + CONFIG["XCFLAGS"] = " -DRUBY_EXPORT" + CONFIG["XLDFLAGS"] = " -Wl,--stack,0x02000000 -L." + CONFIG["LIBRUBY_LDSHARED"] = "#{mingwpre}-gcc -shared -s" + CONFIG["LIBRUBY_DLDFLAGS"] = " -Wl,--enable-auto-import,--export-all -Wl,--out-implib=$(LIBRUBY)" + CONFIG["rubyw_install_name"] = "rubyw" + CONFIG["RUBYW_INSTALL_NAME"] = "rubyw" + CONFIG["LIBRUBY_A"] = "lib$(RUBY_SO_NAME)-static.a" + CONFIG["LIBRUBY_SO"] = "$(RUBY_SO_NAME).dll" + CONFIG["LIBRUBY_ALIASES"] = "" + CONFIG["LIBRUBY"] = "lib$(LIBRUBY_SO).a" + CONFIG["LIBRUBYARG"] = "$(LIBRUBYARG_SHARED)" + CONFIG["LIBRUBYARG_STATIC"] = "-l$(RUBY_SO_NAME)-static" + CONFIG["LIBRUBYARG_SHARED"] = "-l$(RUBY_SO_NAME)" + CONFIG["SOLIBS"] = "$(LIBS)" + CONFIG["DLDLIBS"] = "" + CONFIG["ENABLE_SHARED"] = "yes" + CONFIG["MAINLIBS"] = "" + CONFIG["COMMON_LIBS"] = "m" + CONFIG["COMMON_MACROS"] = "" + CONFIG["COMMON_HEADERS"] = "windows.h winsock.h" + CONFIG["EXPORT_PREFIX"] = "" + CONFIG["MINIOBJS"] = "dmydln.o" + CONFIG["MAKEFILES"] = "Makefile GNUmakefile" + CONFIG["arch"] = "i386-mingw32" + CONFIG["sitearch"] = "i386-msvcrt" + CONFIG["sitedir"] = "$(prefix)/lib/ruby/site_ruby" + CONFIG["configure_args"] = "'--host=#{mingwpre}' '--target=i386-mingw32' '--build=i686-linux' '--prefix=#{mingw32}' 'build_alias=i686-linux' 'host_alias=#{mingwpre}' 'target_alias=i386-mingw32'" + CONFIG["NROFF"] = "/usr/bin/nroff" + CONFIG["MANTYPE"] = "doc" + CONFIG["LTLIBOBJS"] = " fileblocks$(U).lo crypt$(U).lo flock$(U).lo acosh$(U).lo win32$(U).lo" + CONFIG["ruby_version"] = "$(MAJOR).$(MINOR)" + CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)" + CONFIG["archdir"] = "$(rubylibdir)/$(arch)" + CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)" + CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)" + CONFIG["topdir"] = File.dirname(__FILE__) + MAKEFILE_CONFIG = {} + CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup} + def Config::expand(val, config = CONFIG) + val.gsub!(/\$\$|\$\(([^()]+)\)|\$\{([^{}]+)\}/) do |var| + if !(v = $1 || $2) + '$' + elsif key = config[v = v[/\A[^:]+(?=(?::(.*?)=(.*))?\z)/]] + pat, sub = $1, $2 + config[v] = false + Config::expand(key, config) + config[v] = key + key = key.gsub(/#{Regexp.quote(pat)}(?=\s|\z)/n) {sub} if pat + key + else + var + end + end + val + end + CONFIG.each_value do |val| + Config::expand(val) + end +end +RbConfig = Config # compatibility for ruby-1.9 +CROSS_COMPILING = nil unless defined? CROSS_COMPILING diff --git a/vendor/gems/hpricot-0.6/init.rb b/vendor/gems/hpricot-0.6/init.rb new file mode 100644 index 0000000..e8b352b --- /dev/null +++ b/vendor/gems/hpricot-0.6/init.rb @@ -0,0 +1,3 @@ + + require File.join(File.dirname(__FILE__), 'lib', 'hpricot') + diff --git a/vendor/gems/hpricot-0.6/lib/hpricot.rb b/vendor/gems/hpricot-0.6/lib/hpricot.rb new file mode 100644 index 0000000..3032f63 --- /dev/null +++ b/vendor/gems/hpricot-0.6/lib/hpricot.rb @@ -0,0 +1,26 @@ +# == About hpricot.rb +# +# All of Hpricot's various part are loaded when you use require 'hpricot'. +# +# * hpricot_scan: the scanner (a C extension for Ruby) which turns an HTML stream into tokens. +# * hpricot/parse.rb: uses the scanner to sort through tokens and give you back a complete document object. +# * hpricot/tag.rb: sets up objects for the various types of elements in an HTML document. +# * hpricot/modules.rb: categorizes the various elements using mixins. +# * hpricot/traverse.rb: methods for searching documents. +# * hpricot/elements.rb: methods for dealing with a group of elements as an Hpricot::Elements list. +# * hpricot/inspect.rb: methods for displaying documents in a readable form. + +# If available, Nikolai's UTF-8 library will ease use of utf-8 documents. +# See http://git.bitwi.se/ruby-character-encodings.git/. +begin + require 'encoding/character/utf-8' +rescue LoadError +end + +require 'hpricot_scan' +require 'hpricot/tag' +require 'hpricot/modules' +require 'hpricot/traverse' +require 'hpricot/inspect' +require 'hpricot/parse' +require 'hpricot/builder' diff --git a/vendor/gems/hpricot-0.6/lib/hpricot/blankslate.rb b/vendor/gems/hpricot-0.6/lib/hpricot/blankslate.rb new file mode 100644 index 0000000..c247d46 --- /dev/null +++ b/vendor/gems/hpricot-0.6/lib/hpricot/blankslate.rb @@ -0,0 +1,63 @@ +#!/usr/bin/env ruby +#-- +# Copyright 2004 by Jim Weirich (jim@weirichhouse.org). +# All rights reserved. + +# Permission is granted for use, copying, modification, distribution, +# and distribution of modified versions of this work as long as the +# above copyright notice is included. +#++ + +module Hpricot + + # BlankSlate provides an abstract base class with no predefined + # methods (except for \_\_send__ and \_\_id__). + # BlankSlate is useful as a base class when writing classes that + # depend upon method_missing (e.g. dynamic proxies). + class BlankSlate + class << self + + # Hide the method named +name+ in the BlankSlate class. Don't + # hide +instance_eval+ or any method beginning with "__". + def hide(name) + undef_method name if + instance_methods.include?(name.to_s) and + name !~ /^(__|instance_eval)/ + end + end + + instance_methods.each { |m| hide(m) } + end +end + +# Since Ruby is very dynamic, methods added to the ancestors of +# BlankSlate after BlankSlate is defined will show up in the +# list of available BlankSlate methods. We handle this by defining a +# hook in the Object and Kernel classes that will hide any defined +module Kernel + class << self + alias_method :hpricot_slate_method_added, :method_added + + # Detect method additions to Kernel and remove them in the + # BlankSlate class. + def method_added(name) + hpricot_slate_method_added(name) + return if self != Kernel + Hpricot::BlankSlate.hide(name) + end + end +end + +class Object + class << self + alias_method :hpricot_slate_method_added, :method_added + + # Detect method additions to Object and remove them in the + # BlankSlate class. + def method_added(name) + hpricot_slate_method_added(name) + return if self != Object + Hpricot::BlankSlate.hide(name) + end + end +end diff --git a/vendor/gems/hpricot-0.6/lib/hpricot/builder.rb b/vendor/gems/hpricot-0.6/lib/hpricot/builder.rb new file mode 100644 index 0000000..37c31e0 --- /dev/null +++ b/vendor/gems/hpricot-0.6/lib/hpricot/builder.rb @@ -0,0 +1,200 @@ +require 'hpricot/tags' +require 'hpricot/xchar' +require 'hpricot/blankslate' + +module Hpricot + def self.build(ele = Doc.new, assigns = {}, &blk) + ele.extend Builder + assigns.each do |k, v| + ele.instance_variable_set("@#{k}", v) + end + ele.instance_eval &blk + ele + end + + module Builder + + @@default = { + :indent => 0, + :output_helpers => true, + :output_xml_instruction => true, + :output_meta_tag => true, + :auto_validation => true, + :tagset => Hpricot::XHTMLTransitional, + :root_attributes => { + :xmlns => 'http://www.w3.org/1999/xhtml', :'xml:lang' => 'en', :lang => 'en' + } + } + + def self.set(option, value) + @@default[option] = value + end + + # Write a +string+ to the HTML stream, making sure to escape it. + def text!(string) + @children << Text.new(Hpricot.xs(string)) + end + + # Write a +string+ to the HTML stream without escaping it. + def text(string) + @children << Text.new(string) + nil + end + alias_method :<<, :text + alias_method :concat, :text + + # Create a tag named +tag+. Other than the first argument which is the tag name, + # the arguments are the same as the tags implemented via method_missing. + def tag!(tag, *args, &block) + ele_id = nil + if @auto_validation and @tagset + if !@tagset.tagset.has_key?(tag) + raise InvalidXhtmlError, "no element `#{tag}' for #{tagset.doctype}" + elsif args.last.respond_to?(:to_hash) + attrs = args.last.to_hash + + if @tagset.forms.include?(tag) and attrs[:id] + attrs[:name] ||= attrs[:id] + end + + attrs.each do |k, v| + atname = k.to_s.downcase.intern + unless k =~ /:/ or @tagset.tagset[tag].include? atname + raise InvalidXhtmlError, "no attribute `#{k}' on #{tag} elements" + end + if atname == :id + ele_id = v.to_s + if @elements.has_key? ele_id + raise InvalidXhtmlError, "id `#{ele_id}' already used (id's must be unique)." + end + end + end + end + end + + # turn arguments into children or attributes + childs = [] + attrs = args.grep(Hash) + childs.concat((args - attrs).map do |x| + if x.respond_to? :to_html + Hpricot.make(x.to_html) + elsif x + Text.new(Hpricot.xs(x)) + end + end.flatten) + attrs = attrs.inject({}) do |hsh, ath| + ath.each do |k, v| + hsh[k] = Hpricot.xs(v.to_s) if v + end + hsh + end + + # create the element itself + f = Elem.new(STag.new(tag, attrs), childs, ETag.new(tag)) + + # build children from the block + if block + build(f, &block) + end + + @children << f + f + end + + def build(*a, &b) + Hpricot.build(*a, &b) + end + + # Every HTML tag method goes through an html_tag call. So, calling div is equivalent + # to calling html_tag(:div). All HTML tags in Hpricot's list are given generated wrappers + # for this method. + # + # If the @auto_validation setting is on, this method will check for many common mistakes which + # could lead to invalid XHTML. + def html_tag(sym, *args, &block) + if @auto_validation and @tagset.self_closing.include?(sym) and block + raise InvalidXhtmlError, "the `#{sym}' element is self-closing, please remove the block" + elsif args.empty? and block.nil? + CssProxy.new(self, sym) + else + tag!(sym, *args, &block) + end + end + + XHTMLTransitional.tags.each do |k| + class_eval %{ + def #{k}(*args, &block) + html_tag(#{k.inspect}, *args, &block) + end + } + end + + def doctype(target, pub, sys) + @children << DocType.new(target, pub, sys) + end + + remove_method :head + + # Builds a head tag. Adds a meta tag inside with Content-Type + # set to text/html; charset=utf-8. + def head(*args, &block) + tag!(:head, *args) do + tag!(:meta, "http-equiv" => "Content-Type", "content" => "text/html; charset=utf-8") if @output_meta_tag + instance_eval(&block) + end + end + + # Builds an html tag. An XML 1.0 instruction and an XHTML 1.0 Transitional doctype + # are prepended. Also assumes :xmlns => "http://www.w3.org/1999/xhtml", + # :lang => "en". + def xhtml_transitional(attrs = {}, &block) + # self.tagset = Hpricot::XHTMLTransitional + xhtml_html(attrs, &block) + end + + # Builds an html tag with XHTML 1.0 Strict doctype instead. + def xhtml_strict(attrs = {}, &block) + # self.tagset = Hpricot::XHTMLStrict + xhtml_html(attrs, &block) + end + + private + + def xhtml_html(attrs = {}, &block) + instruct! if @output_xml_instruction + doctype(:html, *@@default[:tagset].doctype) + tag!(:html, @@default[:root_attributes].merge(attrs), &block) + end + + end + + # Class used by Markaby::Builder to store element options. Methods called + # against the CssProxy object are added as element classes or IDs. + # + # See the README for examples. + class CssProxy < BlankSlate + + # Creates a CssProxy object. + def initialize(builder, sym) + @builder, @sym, @attrs = builder, sym, {} + end + + # Adds attributes to an element. Bang methods set the :id attribute. + # Other methods add to the :class attribute. + def method_missing(id_or_class, *args, &block) + if (idc = id_or_class.to_s) =~ /!$/ + @attrs[:id] = $` + else + @attrs[:class] = @attrs[:class].nil? ? idc : "#{@attrs[:class]} #{idc}".strip + end + + if block or args.any? + args.push(@attrs) + return @builder.tag!(@sym, *args, &block) + end + + return self + end + + end +end diff --git a/vendor/gems/hpricot-0.6/lib/hpricot/elements.rb b/vendor/gems/hpricot-0.6/lib/hpricot/elements.rb new file mode 100644 index 0000000..26c0636 --- /dev/null +++ b/vendor/gems/hpricot-0.6/lib/hpricot/elements.rb @@ -0,0 +1,510 @@ +module Hpricot +# Once you've matched a list of elements, you will often need to handle them as +# a group. Or you may want to perform the same action on each of them. +# Hpricot::Elements is an extension of Ruby's array class, with some methods +# added for altering elements contained in the array. +# +# If you need to create an element array from regular elements: +# +# Hpricot::Elements[ele1, ele2, ele3] +# +# Assuming that ele1, ele2 and ele3 contain element objects (Hpricot::Elem, +# Hpricot::Doc, etc.) +# +# == Continuing Searches +# +# Usually the Hpricot::Elements you're working on comes from a search you've +# done. Well, you can continue searching the list by using the same at +# and search methods you can use on plain elements. +# +# elements = doc.search("/div/p") +# elements = elements.search("/a[@href='http://hoodwink.d/']") +# elements = elements.at("img") +# +# == Altering Elements +# +# When you're altering elements in the list, your changes will be reflected in +# the document you started searching from. +# +# doc = Hpricot("That's my spoon, Tyler.") +# doc.at("b").swap("fork") +# doc.to_html +# #=> "That's my fork, Tyler." +# +# == Getting More Detailed +# +# If you can't find a method here that does what you need, you may need to +# loop through the elements and find a method in Hpricot::Container::Trav +# which can do what you need. +# +# For example, you may want to search for all the H3 header tags in a document +# and grab all the tags underneath the header, but not inside the header. +# A good method for this is next_sibling: +# +# doc.search("h3").each do |h3| +# while ele = h3.next_sibling +# ary << ele # stuff away all the elements under the h3 +# end +# end +# +# Most of the useful element methods are in the mixins Hpricot::Traverse +# and Hpricot::Container::Trav. + class Elements < Array + + # Searches this list for any elements (or children of these elements) matching + # the CSS or XPath expression +expr+. Root is assumed to be the element scanned. + # + # See Hpricot::Container::Trav.search for more. + def search(*expr,&blk) + Elements[*map { |x| x.search(*expr,&blk) }.flatten.uniq] + end + alias_method :/, :search + + # Searches this list for the first element (or child of these elements) matching + # the CSS or XPath expression +expr+. Root is assumed to be the element scanned. + # + # See Hpricot::Container::Trav.at for more. + def at(expr, &blk) + search(expr, &blk).first + end + alias_method :%, :at + + # Convert this group of elements into a complete HTML fragment, returned as a + # string. + def to_html + map { |x| x.output("") }.join + end + alias_method :to_s, :to_html + + # Returns an HTML fragment built of the contents of each element in this list. + # + # If a HTML +string+ is supplied, this method acts like inner_html=. + def inner_html(*string) + if string.empty? + map { |x| x.inner_html }.join + else + x = self.inner_html = string.pop || x + end + end + alias_method :html, :inner_html + alias_method :innerHTML, :inner_html + + # Replaces the contents of each element in this list. Supply an HTML +string+, + # which is loaded into Hpricot objects and inserted into every element in this + # list. + def inner_html=(string) + each { |x| x.inner_html = string } + end + alias_method :html=, :inner_html= + alias_method :innerHTML=, :inner_html= + + # Returns an string containing the text contents of each element in this list. + # All HTML tags are removed. + def inner_text + map { |x| x.inner_text }.join + end + alias_method :text, :inner_text + + # Remove all elements in this list from the document which contains them. + # + # doc = Hpricot("Remove this: here") + # doc.search("b").remove + # doc.to_html + # => "Remove this: " + # + def remove + each { |x| x.parent.children.delete(x) } + end + + # Empty the elements in this list, by removing their insides. + # + # doc = Hpricot("

We have so much to say.

") + # doc.search("i").empty + # doc.to_html + # => "

We have to say.

" + # + def empty + each { |x| x.inner_html = nil } + end + + # Add to the end of the contents inside each element in this list. + # Pass in an HTML +str+, which is turned into Hpricot elements. + def append(str = nil, &blk) + each { |x| x.html(x.children + Hpricot.make(str, &blk)) } + end + + # Add to the start of the contents inside each element in this list. + # Pass in an HTML +str+, which is turned into Hpricot elements. + def prepend(str = nil, &blk) + each { |x| x.html(Hpricot.make(str, &blk) + x.children) } + end + + # Add some HTML just previous to each element in this list. + # Pass in an HTML +str+, which is turned into Hpricot elements. + def before(str = nil, &blk) + each { |x| x.parent.insert_before Hpricot.make(str, &blk), x } + end + + # Just after each element in this list, add some HTML. + # Pass in an HTML +str+, which is turned into Hpricot elements. + def after(str = nil, &blk) + each { |x| x.parent.insert_after Hpricot.make(str, &blk), x } + end + + # Wraps each element in the list inside the element created by HTML +str+. + # If more than one element is found in the string, Hpricot locates the + # deepest spot inside the first element. + # + # doc.search("a[@href]"). + # wrap(%{}) + # + # This code wraps every link on the page inside a +div.link+ and a +div.link_inner+ nest. + def wrap(str = nil, &blk) + each do |x| + wrap = Hpricot.make(str, &blk) + nest = wrap.detect { |w| w.respond_to? :children } + unless nest + raise Exception, "No wrapping element found." + end + x.parent.replace_child(x, wrap) + nest = nest.children.first until nest.empty? + nest.html(nest.children + [x]) + end + end + + # Gets and sets attributes on all matched elements. + # + # Pass in a +key+ on its own and this method will return the string value + # assigned to that attribute for the first elements. Or +nil+ if the + # attribute isn't found. + # + # doc.search("a").attr("href") + # #=> "http://hacketyhack.net/" + # + # Or, pass in a +key+ and +value+. This will set an attribute for all + # matched elements. + # + # doc.search("p").attr("class", "basic") + # + # You may also use a Hash to set a series of attributes: + # + # (doc/"a").attr(:class => "basic", :href => "http://hackety.org/") + # + # Lastly, a block can be used to rewrite an attribute based on the element + # it belongs to. The block will pass in an element. Return from the block + # the new value of the attribute. + # + # records.attr("href") { |e| e['href'] + "#top" } + # + # This example adds a #top anchor to each link. + # + def attr key, value = nil, &blk + if value or blk + each do |el| + el.set_attribute(key, value || blk[el]) + end + return self + end + if key.is_a? Hash + key.each { |k,v| self.attr(k,v) } + return self + else + return self[0].get_attribute(key) + end + end + alias_method :set, :attr + + # Adds the class to all matched elements. + # + # (doc/"p").add_class("bacon") + # + # Now all paragraphs will have class="bacon". + def add_class class_name + each do |el| + next unless el.respond_to? :get_attribute + classes = el.get_attribute('class').to_s.split(" ") + el.set_attribute('class', classes.push(class_name).uniq.join(" ")) + end + self + end + + # Remove an attribute from each of the matched elements. + # + # (doc/"input").remove_attr("disabled") + # + def remove_attr name + each do |el| + next unless el.respond_to? :remove_attribute + el.remove_attribute(name) + end + self + end + + # Removes a class from all matched elements. + # + # (doc/"span").remove_class("lightgrey") + # + # Or, to remove all classes: + # + # (doc/"span").remove_class + # + def remove_class name = nil + each do |el| + next unless el.respond_to? :get_attribute + if name + classes = el.get_attribute('class').to_s.split(" ") + el.set_attribute('class', (classes - [name]).uniq.join(" ")) + else + el.remove_attribute("class") + end + end + self + end + + ATTR_RE = %r!\[ *(?:(@)([\w\(\)-]+)|([\w\(\)-]+\(\))) *([~\!\|\*$\^=]*) *'?"?([^\]'"]*)'?"? *\]!i + BRACK_RE = %r!(\[) *([^\]]*) *\]+!i + FUNC_RE = %r!(:)?([a-zA-Z0-9\*_-]*)\( *[\"']?([^ \)]*?)['\"]? *\)! + CUST_RE = %r!(:)([a-zA-Z0-9\*_-]*)()! + CATCH_RE = %r!([:\.#]*)([a-zA-Z0-9\*_-]+)! + + def self.filter(nodes, expr, truth = true) + until expr.empty? + _, *m = *expr.match(/^(?:#{ATTR_RE}|#{BRACK_RE}|#{FUNC_RE}|#{CUST_RE}|#{CATCH_RE})/) + break unless _ + + expr = $' + m.compact! + if m[0] == '@' + m[0] = "@#{m.slice!(2,1)}" + end + + if m[0] == '[' && m[1] =~ /^\d+$/ + m = [":", "nth", m[1].to_i-1] + end + + if m[0] == ":" && m[1] == "not" + nodes, = Elements.filter(nodes, m[2], false) + elsif "#{m[0]}#{m[1]}" =~ /^(:even|:odd)$/ + new_nodes = [] + nodes.each_with_index {|n,i| new_nodes.push(n) if (i % 2 == (m[1] == "even" ? 0 : 1)) } + nodes = new_nodes + elsif "#{m[0]}#{m[1]}" =~ /^(:first|:last)$/ + nodes = [nodes.send(m[1])] + else + meth = "filter[#{m[0]}#{m[1]}]" unless m[0].empty? + if meth and Traverse.method_defined? meth + args = m[2..-1] + else + meth = "filter[#{m[0]}]" + if Traverse.method_defined? meth + args = m[1..-1] + end + end + i = -1 + nodes = Elements[*nodes.find_all do |x| + i += 1 + x.send(meth, *([*args] + [i])) ? truth : !truth + end] + end + end + [nodes, expr] + end + + # Given two elements, attempt to gather an Elements array of everything between + # (and including) those two elements. + def self.expand(ele1, ele2, excl=false) + ary = [] + offset = excl ? -1 : 0 + + if ele1 and ele2 + # let's quickly take care of siblings + if ele1.parent == ele2.parent + ary = ele1.parent.children[ele1.node_position..(ele2.node_position+offset)] + else + # find common parent + p, ele1_p = ele1, [ele1] + ele1_p.unshift p while p.respond_to?(:parent) and p = p.parent + p, ele2_p = ele2, [ele2] + ele2_p.unshift p while p.respond_to?(:parent) and p = p.parent + common_parent = ele1_p.zip(ele2_p).select { |p1, p2| p1 == p2 }.flatten.last + + child = nil + if ele1 == common_parent + child = ele2 + elsif ele2 == common_parent + child = ele1 + end + + if child + ary = common_parent.children[0..(child.node_position+offset)] + end + end + end + + return Elements[*ary] + end + + def filter(expr) + nodes, = Elements.filter(self, expr) + nodes + end + + def not(expr) + if expr.is_a? Traverse + nodes = self - [expr] + else + nodes, = Elements.filter(self, expr, false) + end + nodes + end + + private + def copy_node(node, l) + l.instance_variables.each do |iv| + node.instance_variable_set(iv, l.instance_variable_get(iv)) + end + end + + end + + module Traverse + def self.filter(tok, &blk) + define_method("filter[#{tok.is_a?(String) ? tok : tok.inspect}]", &blk) + end + + filter '' do |name,i| + name == '*' || (self.respond_to?(:name) && self.name.downcase == name.downcase) + end + + filter '#' do |id,i| + self.elem? and get_attribute('id').to_s == id + end + + filter '.' do |name,i| + self.elem? and classes.include? name + end + + filter :lt do |num,i| + self.position < num.to_i + end + + filter :gt do |num,i| + self.position > num.to_i + end + + nth = proc { |num,i| self.position == num.to_i } + nth_first = proc { |*a| self.position == 0 } + nth_last = proc { |*a| self == parent.children_of_type(self.name).last } + + filter :nth, &nth + filter :eq, &nth + filter ":nth-of-type", &nth + + filter :first, &nth_first + filter ":first-of-type", &nth_first + + filter :last, &nth_last + filter ":last-of-type", &nth_last + + filter :even do |num,i| + self.position % 2 == 0 + end + + filter :odd do |num,i| + self.position % 2 == 1 + end + + filter ':first-child' do |i| + self == parent.containers.first + end + + filter ':nth-child' do |arg,i| + case arg + when 'even'; (parent.containers.index(self) + 1) % 2 == 0 + when 'odd'; (parent.containers.index(self) + 1) % 2 == 1 + else self == (parent.containers[arg.to_i + 1]) + end + end + + filter ":last-child" do |i| + self == parent.containers.last + end + + filter ":nth-last-child" do |arg,i| + self == parent.containers[-1-arg.to_i] + end + + filter ":nth-last-of-type" do |arg,i| + self == parent.children_of_type(self.name)[-1-arg.to_i] + end + + filter ":only-of-type" do |arg,i| + parent.children_of_type(self.name).length == 1 + end + + filter ":only-child" do |arg,i| + parent.containers.length == 1 + end + + filter :parent do + containers.length > 0 + end + + filter :empty do + containers.length == 0 + end + + filter :root do + self.is_a? Hpricot::Doc + end + + filter 'text' do + self.text? + end + + filter 'comment' do + self.comment? + end + + filter :contains do |arg, ignore| + html.include? arg + end + + + + pred_procs = + {'text()' => proc { |ele, *_| ele.inner_text.strip }, + '@' => proc { |ele, attr, *_| ele.get_attribute(attr).to_s if ele.elem? }} + + oper_procs = + {'=' => proc { |a,b| a == b }, + '!=' => proc { |a,b| a != b }, + '~=' => proc { |a,b| a.split(/\s+/).include?(b) }, + '|=' => proc { |a,b| a =~ /^#{Regexp::quote b}(-|$)/ }, + '^=' => proc { |a,b| a.index(b) == 0 }, + '$=' => proc { |a,b| a =~ /#{Regexp::quote b}$/ }, + '*=' => proc { |a,b| idx = a.index(b) }} + + pred_procs.each do |pred_n, pred_f| + oper_procs.each do |oper_n, oper_f| + filter "#{pred_n}#{oper_n}" do |*a| + qual = pred_f[self, *a] + oper_f[qual, a[-2]] if qual + end + end + end + + filter 'text()' do |val,i| + !self.inner_text.strip.empty? + end + + filter '@' do |attr,val,i| + self.elem? and has_attribute? attr + end + + filter '[' do |val,i| + self.elem? and search(val).length > 0 + end + + end +end diff --git a/vendor/gems/hpricot-0.6/lib/hpricot/htmlinfo.rb b/vendor/gems/hpricot-0.6/lib/hpricot/htmlinfo.rb new file mode 100644 index 0000000..951ce17 --- /dev/null +++ b/vendor/gems/hpricot-0.6/lib/hpricot/htmlinfo.rb @@ -0,0 +1,672 @@ +module Hpricot +# The code below is auto-generated. Don't edit manually. + # :stopdoc: + NamedCharacters = +{"AElig"=>198, "Aacute"=>193, "Acirc"=>194, "Agrave"=>192, "Alpha"=>913, + "Aring"=>197, "Atilde"=>195, "Auml"=>196, "Beta"=>914, "Ccedil"=>199, + "Chi"=>935, "Dagger"=>8225, "Delta"=>916, "ETH"=>208, "Eacute"=>201, + "Ecirc"=>202, "Egrave"=>200, "Epsilon"=>917, "Eta"=>919, "Euml"=>203, + "Gamma"=>915, "Iacute"=>205, "Icirc"=>206, "Igrave"=>204, "Iota"=>921, + "Iuml"=>207, "Kappa"=>922, "Lambda"=>923, "Mu"=>924, "Ntilde"=>209, "Nu"=>925, + "OElig"=>338, "Oacute"=>211, "Ocirc"=>212, "Ograve"=>210, "Omega"=>937, + "Omicron"=>927, "Oslash"=>216, "Otilde"=>213, "Ouml"=>214, "Phi"=>934, + "Pi"=>928, "Prime"=>8243, "Psi"=>936, "Rho"=>929, "Scaron"=>352, "Sigma"=>931, + "THORN"=>222, "Tau"=>932, "Theta"=>920, "Uacute"=>218, "Ucirc"=>219, + "Ugrave"=>217, "Upsilon"=>933, "Uuml"=>220, "Xi"=>926, "Yacute"=>221, + "Yuml"=>376, "Zeta"=>918, "aacute"=>225, "acirc"=>226, "acute"=>180, + "aelig"=>230, "agrave"=>224, "alefsym"=>8501, "alpha"=>945, "amp"=>38, + "and"=>8743, "ang"=>8736, "apos"=>39, "aring"=>229, "asymp"=>8776, + "atilde"=>227, "auml"=>228, "bdquo"=>8222, "beta"=>946, "brvbar"=>166, + "bull"=>8226, "cap"=>8745, "ccedil"=>231, "cedil"=>184, "cent"=>162, + "chi"=>967, "circ"=>710, "clubs"=>9827, "cong"=>8773, "copy"=>169, + "crarr"=>8629, "cup"=>8746, "curren"=>164, "dArr"=>8659, "dagger"=>8224, + "darr"=>8595, "deg"=>176, "delta"=>948, "diams"=>9830, "divide"=>247, + "eacute"=>233, "ecirc"=>234, "egrave"=>232, "empty"=>8709, "emsp"=>8195, + "ensp"=>8194, "epsilon"=>949, "equiv"=>8801, "eta"=>951, "eth"=>240, + "euml"=>235, "euro"=>8364, "exist"=>8707, "fnof"=>402, "forall"=>8704, + "frac12"=>189, "frac14"=>188, "frac34"=>190, "frasl"=>8260, "gamma"=>947, + "ge"=>8805, "gt"=>62, "hArr"=>8660, "harr"=>8596, "hearts"=>9829, + "hellip"=>8230, "iacute"=>237, "icirc"=>238, "iexcl"=>161, "igrave"=>236, + "image"=>8465, "infin"=>8734, "int"=>8747, "iota"=>953, "iquest"=>191, + "isin"=>8712, "iuml"=>239, "kappa"=>954, "lArr"=>8656, "lambda"=>955, + "lang"=>9001, "laquo"=>171, "larr"=>8592, "lceil"=>8968, "ldquo"=>8220, + "le"=>8804, "lfloor"=>8970, "lowast"=>8727, "loz"=>9674, "lrm"=>8206, + "lsaquo"=>8249, "lsquo"=>8216, "lt"=>60, "macr"=>175, "mdash"=>8212, + "micro"=>181, "middot"=>183, "minus"=>8722, "mu"=>956, "nabla"=>8711, + "nbsp"=>160, "ndash"=>8211, "ne"=>8800, "ni"=>8715, "not"=>172, "notin"=>8713, + "nsub"=>8836, "ntilde"=>241, "nu"=>957, "oacute"=>243, "ocirc"=>244, + "oelig"=>339, "ograve"=>242, "oline"=>8254, "omega"=>969, "omicron"=>959, + "oplus"=>8853, "or"=>8744, "ordf"=>170, "ordm"=>186, "oslash"=>248, + "otilde"=>245, "otimes"=>8855, "ouml"=>246, "para"=>182, "part"=>8706, + "permil"=>8240, "perp"=>8869, "phi"=>966, "pi"=>960, "piv"=>982, + "plusmn"=>177, "pound"=>163, "prime"=>8242, "prod"=>8719, "prop"=>8733, + "psi"=>968, "quot"=>34, "rArr"=>8658, "radic"=>8730, "rang"=>9002, + "raquo"=>187, "rarr"=>8594, "rceil"=>8969, "rdquo"=>8221, "real"=>8476, + "reg"=>174, "rfloor"=>8971, "rho"=>961, "rlm"=>8207, "rsaquo"=>8250, + "rsquo"=>8217, "sbquo"=>8218, "scaron"=>353, "sdot"=>8901, "sect"=>167, + "shy"=>173, "sigma"=>963, "sigmaf"=>962, "sim"=>8764, "spades"=>9824, + "sub"=>8834, "sube"=>8838, "sum"=>8721, "sup"=>8835, "sup1"=>185, "sup2"=>178, + "sup3"=>179, "supe"=>8839, "szlig"=>223, "tau"=>964, "there4"=>8756, + "theta"=>952, "thetasym"=>977, "thinsp"=>8201, "thorn"=>254, "tilde"=>732, + "times"=>215, "trade"=>8482, "uArr"=>8657, "uacute"=>250, "uarr"=>8593, + "ucirc"=>251, "ugrave"=>249, "uml"=>168, "upsih"=>978, "upsilon"=>965, + "uuml"=>252, "weierp"=>8472, "xi"=>958, "yacute"=>253, "yen"=>165, + "yuml"=>255, "zeta"=>950, "zwj"=>8205, "zwnj"=>8204} + + + NamedCharactersPattern = /\A(?-mix:AElig|Aacute|Acirc|Agrave|Alpha|Aring|Atilde|Auml|Beta|Ccedil|Chi|Dagger|Delta|ETH|Eacute|Ecirc|Egrave|Epsilon|Eta|Euml|Gamma|Iacute|Icirc|Igrave|Iota|Iuml|Kappa|Lambda|Mu|Ntilde|Nu|OElig|Oacute|Ocirc|Ograve|Omega|Omicron|Oslash|Otilde|Ouml|Phi|Pi|Prime|Psi|Rho|Scaron|Sigma|THORN|Tau|Theta|Uacute|Ucirc|Ugrave|Upsilon|Uuml|Xi|Yacute|Yuml|Zeta|aacute|acirc|acute|aelig|agrave|alefsym|alpha|amp|and|ang|apos|aring|asymp|atilde|auml|bdquo|beta|brvbar|bull|cap|ccedil|cedil|cent|chi|circ|clubs|cong|copy|crarr|cup|curren|dArr|dagger|darr|deg|delta|diams|divide|eacute|ecirc|egrave|empty|emsp|ensp|epsilon|equiv|eta|eth|euml|euro|exist|fnof|forall|frac12|frac14|frac34|frasl|gamma|ge|gt|hArr|harr|hearts|hellip|iacute|icirc|iexcl|igrave|image|infin|int|iota|iquest|isin|iuml|kappa|lArr|lambda|lang|laquo|larr|lceil|ldquo|le|lfloor|lowast|loz|lrm|lsaquo|lsquo|lt|macr|mdash|micro|middot|minus|mu|nabla|nbsp|ndash|ne|ni|not|notin|nsub|ntilde|nu|oacute|ocirc|oelig|ograve|oline|omega|omicron|oplus|or|ordf|ordm|oslash|otilde|otimes|ouml|para|part|permil|perp|phi|pi|piv|plusmn|pound|prime|prod|prop|psi|quot|rArr|radic|rang|raquo|rarr|rceil|rdquo|real|reg|rfloor|rho|rlm|rsaquo|rsquo|sbquo|scaron|sdot|sect|shy|sigma|sigmaf|sim|spades|sub|sube|sum|sup|sup1|sup2|sup3|supe|szlig|tau|there4|theta|thetasym|thinsp|thorn|tilde|times|trade|uArr|uacute|uarr|ucirc|ugrave|uml|upsih|upsilon|uuml|weierp|xi|yacute|yen|yuml|zeta|zwj|zwnj)\z/ + + ElementContent = +{"h6"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "object"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "map", + "menu", "noframes", "noscript", "object", "ol", "p", "param", "pre", "q", + "s", "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"], + "dl"=>["dd", "dt"], + "p"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "acronym"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "code"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "ul"=>["li"], + "tt"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "label"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "form"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "map", + "menu", "noframes", "noscript", "object", "ol", "p", "pre", "q", "s", + "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"], + "q"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "thead"=>["tr"], + "area"=>:EMPTY, + "td"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "map", + "menu", "noframes", "noscript", "object", "ol", "p", "pre", "q", "s", + "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"], + "title"=>[], + "dir"=>["li"], + "s"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "ol"=>["li"], + "hr"=>:EMPTY, + "applet"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "map", + "menu", "noframes", "noscript", "object", "ol", "p", "param", "pre", "q", + "s", "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"], + "table"=>["caption", "col", "colgroup", "tbody", "tfoot", "thead", "tr"], + "legend"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "cite"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "a"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "html"=> + ["a", "abbr", "acronym", "address", "applet", "b", "base", "basefont", "bdo", + "big", "blockquote", "body", "br", "button", "center", "cite", "code", + "dfn", "dir", "div", "dl", "em", "fieldset", "font", "form", "h1", "h2", + "h3", "h4", "h5", "h6", "head", "hr", "i", "iframe", "img", "input", + "isindex", "kbd", "label", "map", "menu", "noframes", "noscript", "object", + "ol", "p", "pre", "q", "s", "samp", "script", "select", "small", "span", + "strike", "strong", "sub", "sup", "table", "textarea", "title", "tt", "u", + "ul", "var"], + "u"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "blockquote"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "map", + "menu", "noframes", "noscript", "object", "ol", "p", "pre", "q", "s", + "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"], + "center"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "map", + "menu", "noframes", "noscript", "object", "ol", "p", "pre", "q", "s", + "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"], + "b"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "base"=>:EMPTY, + "th"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "map", + "menu", "noframes", "noscript", "object", "ol", "p", "pre", "q", "s", + "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"], + "link"=>:EMPTY, + "var"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "samp"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "div"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "map", + "menu", "noframes", "noscript", "object", "ol", "p", "pre", "q", "s", + "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"], + "textarea"=>[], + "pre"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "head"=>["base", "isindex", "title"], + "span"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "br"=>:EMPTY, + "script"=>:CDATA, + "noframes"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "map", + "menu", "noframes", "noscript", "object", "ol", "p", "pre", "q", "s", + "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"], + "style"=>:CDATA, + "meta"=>:EMPTY, + "dt"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "option"=>[], + "kbd"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "big"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "tfoot"=>["tr"], + "sup"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "bdo"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "isindex"=>:EMPTY, + "dfn"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "fieldset"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "legend", + "map", "menu", "noframes", "noscript", "object", "ol", "p", "pre", "q", "s", + "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"], + "em"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "font"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "tbody"=>["tr"], + "noscript"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "map", + "menu", "noframes", "noscript", "object", "ol", "p", "pre", "q", "s", + "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"], + "li"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "map", + "menu", "noframes", "noscript", "object", "ol", "p", "pre", "q", "s", + "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"], + "col"=>:EMPTY, + "small"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "dd"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "map", + "menu", "noframes", "noscript", "object", "ol", "p", "pre", "q", "s", + "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"], + "i"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "menu"=>["li"], + "strong"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "basefont"=>:EMPTY, + "img"=>:EMPTY, + "optgroup"=>["option"], + "map"=> + ["address", "area", "blockquote", "center", "dir", "div", "dl", "fieldset", + "form", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "isindex", "menu", + "noframes", "noscript", "ol", "p", "pre", "table", "ul"], + "h1"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "address"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "p", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "sub"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "param"=>:EMPTY, + "input"=>:EMPTY, + "h2"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "abbr"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "h3"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "strike"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "body"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "map", + "menu", "noframes", "noscript", "object", "ol", "p", "pre", "q", "s", + "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"], + "ins"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "map", + "menu", "noframes", "noscript", "object", "ol", "p", "pre", "q", "s", + "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"], + "button"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "map", + "menu", "noframes", "noscript", "object", "ol", "p", "pre", "q", "s", + "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"], + "h4"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "select"=>["optgroup", "option"], + "caption"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "colgroup"=>["col"], + "tr"=>["td", "th"], + "del"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "map", + "menu", "noframes", "noscript", "object", "ol", "p", "pre", "q", "s", + "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"], + "h5"=> + ["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", + "button", "cite", "code", "dfn", "em", "font", "i", "iframe", "img", + "input", "kbd", "label", "map", "object", "q", "s", "samp", "script", + "select", "small", "span", "strike", "strong", "sub", "sup", "textarea", + "tt", "u", "var"], + "iframe"=> + ["a", "abbr", "acronym", "address", "applet", "b", "basefont", "bdo", "big", + "blockquote", "br", "button", "center", "cite", "code", "dfn", "dir", "div", + "dl", "em", "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", + "hr", "i", "iframe", "img", "input", "isindex", "kbd", "label", "map", + "menu", "noframes", "noscript", "object", "ol", "p", "pre", "q", "s", + "samp", "script", "select", "small", "span", "strike", "strong", "sub", + "sup", "table", "textarea", "tt", "u", "ul", "var"]} + + ElementInclusions = +{"head"=>["link", "meta", "object", "script", "style"], "body"=>["del", "ins"]} + + ElementExclusions = +{"button"=> + ["a", "button", "fieldset", "form", "iframe", "input", "isindex", "label", + "select", "textarea"], + "a"=>["a"], + "dir"=> + ["address", "blockquote", "center", "dir", "div", "dl", "fieldset", "form", + "h1", "h2", "h3", "h4", "h5", "h6", "hr", "isindex", "menu", "noframes", + "noscript", "ol", "p", "pre", "table", "ul"], + "title"=>["link", "meta", "object", "script", "style"], + "pre"=> + ["applet", "basefont", "big", "font", "img", "object", "small", "sub", + "sup"], + "form"=>["form"], + "menu"=> + ["address", "blockquote", "center", "dir", "div", "dl", "fieldset", "form", + "h1", "h2", "h3", "h4", "h5", "h6", "hr", "isindex", "menu", "noframes", + "noscript", "ol", "p", "pre", "table", "ul"], + "label"=>["label"]} + + OmittedAttrName = +{"h6"=> + {"center"=>"align", "justify"=>"align", "left"=>"align", "ltr"=>"dir", + "right"=>"align", "rtl"=>"dir"}, + "object"=> + {"bottom"=>"align", "declare"=>"declare", "left"=>"align", "ltr"=>"dir", + "middle"=>"align", "right"=>"align", "rtl"=>"dir", "top"=>"align"}, + "dl"=>{"compact"=>"compact", "ltr"=>"dir", "rtl"=>"dir"}, + "p"=> + {"center"=>"align", "justify"=>"align", "left"=>"align", "ltr"=>"dir", + "right"=>"align", "rtl"=>"dir"}, + "acronym"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "code"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "ul"=> + {"circle"=>"type", "compact"=>"compact", "disc"=>"type", "ltr"=>"dir", + "rtl"=>"dir", "square"=>"type"}, + "tt"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "label"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "form"=>{"get"=>"method", "ltr"=>"dir", "post"=>"method", "rtl"=>"dir"}, + "q"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "thead"=> + {"baseline"=>"valign", "bottom"=>"valign", "center"=>"align", + "char"=>"align", "justify"=>"align", "left"=>"align", "ltr"=>"dir", + "middle"=>"valign", "right"=>"align", "rtl"=>"dir", "top"=>"valign"}, + "area"=> + {"circle"=>"shape", "default"=>"shape", "ltr"=>"dir", "nohref"=>"nohref", + "poly"=>"shape", "rect"=>"shape", "rtl"=>"dir"}, + "td"=> + {"baseline"=>"valign", "bottom"=>"valign", "center"=>"align", + "char"=>"align", "col"=>"scope", "colgroup"=>"scope", "justify"=>"align", + "left"=>"align", "ltr"=>"dir", "middle"=>"valign", "nowrap"=>"nowrap", + "right"=>"align", "row"=>"scope", "rowgroup"=>"scope", "rtl"=>"dir", + "top"=>"valign"}, + "title"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "dir"=>{"compact"=>"compact", "ltr"=>"dir", "rtl"=>"dir"}, + "s"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "ol"=>{"compact"=>"compact", "ltr"=>"dir", "rtl"=>"dir"}, + "hr"=> + {"center"=>"align", "left"=>"align", "ltr"=>"dir", "noshade"=>"noshade", + "right"=>"align", "rtl"=>"dir"}, + "applet"=> + {"bottom"=>"align", "left"=>"align", "middle"=>"align", "right"=>"align", + "top"=>"align"}, + "table"=> + {"above"=>"frame", "all"=>"rules", "below"=>"frame", "border"=>"frame", + "box"=>"frame", "center"=>"align", "cols"=>"rules", "groups"=>"rules", + "hsides"=>"frame", "left"=>"align", "lhs"=>"frame", "ltr"=>"dir", + "none"=>"rules", "rhs"=>"frame", "right"=>"align", "rows"=>"rules", + "rtl"=>"dir", "void"=>"frame", "vsides"=>"frame"}, + "legend"=> + {"bottom"=>"align", "left"=>"align", "ltr"=>"dir", "right"=>"align", + "rtl"=>"dir", "top"=>"align"}, + "cite"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "a"=> + {"circle"=>"shape", "default"=>"shape", "ltr"=>"dir", "poly"=>"shape", + "rect"=>"shape", "rtl"=>"dir"}, + "html"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "u"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "blockquote"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "center"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "b"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "th"=> + {"baseline"=>"valign", "bottom"=>"valign", "center"=>"align", + "char"=>"align", "col"=>"scope", "colgroup"=>"scope", "justify"=>"align", + "left"=>"align", "ltr"=>"dir", "middle"=>"valign", "nowrap"=>"nowrap", + "right"=>"align", "row"=>"scope", "rowgroup"=>"scope", "rtl"=>"dir", + "top"=>"valign"}, + "link"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "var"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "samp"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "div"=> + {"center"=>"align", "justify"=>"align", "left"=>"align", "ltr"=>"dir", + "right"=>"align", "rtl"=>"dir"}, + "textarea"=> + {"disabled"=>"disabled", "ltr"=>"dir", "readonly"=>"readonly", "rtl"=>"dir"}, + "pre"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "head"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "span"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "br"=>{"all"=>"clear", "left"=>"clear", "none"=>"clear", "right"=>"clear"}, + "script"=>{"defer"=>"defer"}, + "noframes"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "style"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "meta"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "dt"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "option"=> + {"disabled"=>"disabled", "ltr"=>"dir", "rtl"=>"dir", "selected"=>"selected"}, + "kbd"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "big"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "tfoot"=> + {"baseline"=>"valign", "bottom"=>"valign", "center"=>"align", + "char"=>"align", "justify"=>"align", "left"=>"align", "ltr"=>"dir", + "middle"=>"valign", "right"=>"align", "rtl"=>"dir", "top"=>"valign"}, + "sup"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "bdo"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "isindex"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "dfn"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "fieldset"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "em"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "font"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "tbody"=> + {"baseline"=>"valign", "bottom"=>"valign", "center"=>"align", + "char"=>"align", "justify"=>"align", "left"=>"align", "ltr"=>"dir", + "middle"=>"valign", "right"=>"align", "rtl"=>"dir", "top"=>"valign"}, + "noscript"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "li"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "col"=> + {"baseline"=>"valign", "bottom"=>"valign", "center"=>"align", + "char"=>"align", "justify"=>"align", "left"=>"align", "ltr"=>"dir", + "middle"=>"valign", "right"=>"align", "rtl"=>"dir", "top"=>"valign"}, + "small"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "dd"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "i"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "menu"=>{"compact"=>"compact", "ltr"=>"dir", "rtl"=>"dir"}, + "strong"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "img"=> + {"bottom"=>"align", "ismap"=>"ismap", "left"=>"align", "ltr"=>"dir", + "middle"=>"align", "right"=>"align", "rtl"=>"dir", "top"=>"align"}, + "optgroup"=>{"disabled"=>"disabled", "ltr"=>"dir", "rtl"=>"dir"}, + "map"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "address"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "h1"=> + {"center"=>"align", "justify"=>"align", "left"=>"align", "ltr"=>"dir", + "right"=>"align", "rtl"=>"dir"}, + "sub"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "param"=>{"data"=>"valuetype", "object"=>"valuetype", "ref"=>"valuetype"}, + "input"=> + {"bottom"=>"align", "button"=>"type", "checkbox"=>"type", + "checked"=>"checked", "disabled"=>"disabled", "file"=>"type", + "hidden"=>"type", "image"=>"type", "ismap"=>"ismap", "left"=>"align", + "ltr"=>"dir", "middle"=>"align", "password"=>"type", "radio"=>"type", + "readonly"=>"readonly", "reset"=>"type", "right"=>"align", "rtl"=>"dir", + "submit"=>"type", "text"=>"type", "top"=>"align"}, + "h2"=> + {"center"=>"align", "justify"=>"align", "left"=>"align", "ltr"=>"dir", + "right"=>"align", "rtl"=>"dir"}, + "abbr"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "h3"=> + {"center"=>"align", "justify"=>"align", "left"=>"align", "ltr"=>"dir", + "right"=>"align", "rtl"=>"dir"}, + "strike"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "body"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "ins"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "button"=> + {"button"=>"type", "disabled"=>"disabled", "ltr"=>"dir", "reset"=>"type", + "rtl"=>"dir", "submit"=>"type"}, + "h4"=> + {"center"=>"align", "justify"=>"align", "left"=>"align", "ltr"=>"dir", + "right"=>"align", "rtl"=>"dir"}, + "select"=> + {"disabled"=>"disabled", "ltr"=>"dir", "multiple"=>"multiple", "rtl"=>"dir"}, + "caption"=> + {"bottom"=>"align", "left"=>"align", "ltr"=>"dir", "right"=>"align", + "rtl"=>"dir", "top"=>"align"}, + "colgroup"=> + {"baseline"=>"valign", "bottom"=>"valign", "center"=>"align", + "char"=>"align", "justify"=>"align", "left"=>"align", "ltr"=>"dir", + "middle"=>"valign", "right"=>"align", "rtl"=>"dir", "top"=>"valign"}, + "tr"=> + {"baseline"=>"valign", "bottom"=>"valign", "center"=>"align", + "char"=>"align", "justify"=>"align", "left"=>"align", "ltr"=>"dir", + "middle"=>"valign", "right"=>"align", "rtl"=>"dir", "top"=>"valign"}, + "del"=>{"ltr"=>"dir", "rtl"=>"dir"}, + "h5"=> + {"center"=>"align", "justify"=>"align", "left"=>"align", "ltr"=>"dir", + "right"=>"align", "rtl"=>"dir"}, + "iframe"=> + {"0"=>"frameborder", "1"=>"frameborder", "auto"=>"scrolling", + "bottom"=>"align", "left"=>"align", "middle"=>"align", "no"=>"scrolling", + "right"=>"align", "top"=>"align", "yes"=>"scrolling"}} + + # :startdoc: +# The code above is auto-generated. Don't edit manually. +end diff --git a/vendor/gems/hpricot-0.6/lib/hpricot/inspect.rb b/vendor/gems/hpricot-0.6/lib/hpricot/inspect.rb new file mode 100644 index 0000000..0af4d35 --- /dev/null +++ b/vendor/gems/hpricot-0.6/lib/hpricot/inspect.rb @@ -0,0 +1,107 @@ +require 'pp' + +module Hpricot + # :stopdoc: + class Elements + def pretty_print(q) + q.object_group(self) { super } + end + alias inspect pretty_print_inspect + end + + class Doc + def pretty_print(q) + q.object_group(self) { @children.each {|elt| q.breakable; q.pp elt } } + end + alias inspect pretty_print_inspect + end + + class Elem + def pretty_print(q) + if empty? + q.group(1, '{emptyelem', '}') { + q.breakable; q.pp @stag + } + else + q.group(1, "{elem", "}") { + q.breakable; q.pp @stag + if @children + @children.each {|elt| q.breakable; q.pp elt } + end + if @etag + q.breakable; q.pp @etag + end + } + end + end + alias inspect pretty_print_inspect + end + + module Leaf + def pretty_print(q) + q.group(1, '{', '}') { + q.text self.class.name.sub(/.*::/,'').downcase + if rs = @raw_string + rs.scan(/[^\r\n]*(?:\r\n?|\n|[^\r\n]\z)/) {|line| + q.breakable + q.pp line + } + elsif self.respond_to? :to_s + q.breakable + q.text self.to_s + end + } + end + alias inspect pretty_print_inspect + end + + class STag + def pretty_print(q) + q.group(1, '<', '>') { + q.text @name + + if @raw_attributes + @raw_attributes.each {|n, t| + q.breakable + if t + q.text "#{n}=\"#{Hpricot.uxs(t)}\"" + else + q.text n + end + } + end + } + end + alias inspect pretty_print_inspect + end + + class ETag + def pretty_print(q) + q.group(1, '') { + q.text @name + } + end + alias inspect pretty_print_inspect + end + + class Text + def pretty_print(q) + q.text @content.dump + end + end + + class BogusETag + def pretty_print(q) + q.group(1, '{', '}') { + q.text self.class.name.sub(/.*::/,'').downcase + if rs = @raw_string + q.breakable + q.text rs + else + q.text "" + end + } + end + end + # :startdoc: +end diff --git a/vendor/gems/hpricot-0.6/lib/hpricot/modules.rb b/vendor/gems/hpricot-0.6/lib/hpricot/modules.rb new file mode 100644 index 0000000..e96b922 --- /dev/null +++ b/vendor/gems/hpricot-0.6/lib/hpricot/modules.rb @@ -0,0 +1,37 @@ +module Hpricot + class Name; include Hpricot end + class Context; include Hpricot end + + # :stopdoc: + module Tag; include Hpricot end + class STag; include Tag end + class ETag; include Tag end + # :startdoc: + + module Node; include Hpricot end + module Container; include Node end + class Doc; include Container end + class Elem; include Container end + module Leaf; include Node end + class Text; include Leaf end + class XMLDecl; include Leaf end + class DocType; include Leaf end + class ProcIns; include Leaf end + class Comment; include Leaf end + class BogusETag; include Leaf end + + module Traverse end + module Container::Trav; include Traverse end + module Leaf::Trav; include Traverse end + class Doc; module Trav; include Container::Trav end; include Trav end + class Elem; module Trav; include Container::Trav end; include Trav end + class Text; module Trav; include Leaf::Trav end; include Trav end + class XMLDecl; module Trav; include Leaf::Trav end; include Trav end + class DocType; module Trav; include Leaf::Trav end; include Trav end + class ProcIns; module Trav; include Leaf::Trav end; include Trav end + class Comment; module Trav; include Leaf::Trav end; include Trav end + class BogusETag; module Trav; include Leaf::Trav end; include Trav end + + class Error < StandardError; end +end + diff --git a/vendor/gems/hpricot-0.6/lib/hpricot/parse.rb b/vendor/gems/hpricot-0.6/lib/hpricot/parse.rb new file mode 100644 index 0000000..47ed217 --- /dev/null +++ b/vendor/gems/hpricot-0.6/lib/hpricot/parse.rb @@ -0,0 +1,297 @@ +require 'hpricot/htmlinfo' + +def Hpricot(input = nil, opts = {}, &blk) + Hpricot.parse(input, opts, &blk) +end + +module Hpricot + # Exception class used for any errors related to deficiencies in the system when + # handling the character encodings of a document. + class EncodingError < StandardError; end + + # Hpricot.parse parses input and return a document tree. + # represented by Hpricot::Doc. + def Hpricot.parse(input = nil, opts = {}, &blk) + Doc.new(make(input, opts, &blk)) + end + + # Hpricot::XML parses input, disregarding all the HTML rules + # and returning a document tree. + def Hpricot.XML(input, opts = {}) + Doc.new(make(input, opts.merge(:xml => true))) + end + + # :stopdoc: + + def Hpricot.make(input = nil, opts = {}, &blk) + opts = {:fixup_tags => false}.merge(opts) + unless input or blk + raise ArgumentError, "An Hpricot document must be built from an input source (a String) or a block." + end + + conv = opts[:xml] ? :to_s : :downcase + + fragment = + if input + case opts[:encoding] + when nil + when 'utf-8' + unless defined? Encoding::Character::UTF8 + raise EncodingError, "The ruby-character-encodings library could not be found for utf-8 mode." + end + else + raise EncodingError, "No encoding option `#{opts[:encoding]}' is available." + end + + if opts[:xhtml_strict] + opts[:fixup_tags] = true + end + + stack = [[nil, nil, [], [], [], []]] + Hpricot.scan(input) do |token| + if stack.last[5] == :CDATA and ![:procins, :comment, :cdata].include?(token[0]) and + !(token[0] == :etag and token[1].casecmp(stack.last[0]).zero?) + token[0] = :text + token[1] = token[3] if token[3] + end + + if !opts[:xml] and token[0] == :emptytag + token[1] = token[1].send(conv) + if ElementContent[token[1].downcase] != :EMPTY + token[0] = :stag + end + end + + # TODO: downcase instead when parsing attributes? + if !opts[:xml] and token[2].is_a?(Hash) + token[2] = token[2].inject({}) { |hsh,(k,v)| hsh[k.downcase] = v; hsh } + end + + case token[0] + when :stag + case opts[:encoding] when 'utf-8' + token.map! { |str| u(str) if str.is_a? String } + end + + stagname = token[0] = token[1] = token[1].send(conv) + if ElementContent[stagname] == :EMPTY and !opts[:xml] + token[0] = :emptytag + stack.last[2] << token + else + unless opts[:xml] + if opts[:fixup_tags] + # obey the tag rules set up by the current element + if ElementContent.has_key? stagname + trans = nil + (stack.length-1).downto(0) do |i| + untags = stack[i][5] + break unless untags.include? stagname + # puts "** ILLEGAL #{stagname} IN #{stack[i][0]}" + trans = i + end + if trans.to_i > 1 + eles = stack.slice!(trans..-1) + stack.last[2] += eles + # puts "** TRANSPLANTED #{stagname} TO #{stack.last[0]}" + end + elsif opts[:xhtml_strict] + token[2] = {'class' => stagname} + stagname = token[0] = "div" + end + end + + # setup tag rules for inside this element + if ElementContent[stagname] == :CDATA + uncontainable_tags = :CDATA + elsif opts[:fixup_tags] + possible_tags = ElementContent[stagname] + excluded_tags, included_tags = stack.last[3..4] + if possible_tags + excluded_tags = excluded_tags | (ElementExclusions[stagname] || []) + included_tags = included_tags | (ElementInclusions[stagname] || []) + containable_tags = (possible_tags | included_tags) - excluded_tags + uncontainable_tags = ElementContent.keys - containable_tags + else + # If the tagname is unknown, it is assumed that any element + # except excluded can be contained. + uncontainable_tags = excluded_tags + end + end + end + unless opts[:xml] + case token[2] when Hash + token[2] = token[2].inject({}) { |hsh,(k,v)| hsh[k.downcase] = v; hsh } + end + end + stack << [stagname, token, [], excluded_tags, included_tags, uncontainable_tags] + end + when :etag + etagname = token[0] = token[1].send(conv) + if opts[:xhtml_strict] and not ElementContent.has_key? etagname + etagname = token[0] = "div" + end + matched_elem = nil + (stack.length-1).downto(0) do |i| + stagname, = stack[i] + if stagname == etagname + matched_elem = stack[i] + stack[i][1] += token + eles = stack.slice!((i+1)..-1) + stack.last[2] += eles + break + end + end + unless matched_elem + stack.last[2] << [:bogus_etag, token.first, token.last] + else + ele = stack.pop + stack.last[2] << ele + end + when :text + l = stack.last[2].last + if l and l[0] == :text + l[1] += token[1] + else + stack.last[2] << token + end + else + stack.last[2] << token + end + end + + while 1 < stack.length + ele = stack.pop + stack.last[2] << ele + end + + structure_list = stack[0][2] + structure_list.map {|s| build_node(s, opts) } + elsif blk + Hpricot.build(&blk).children + end + end + + def Hpricot.build_node(structure, opts = {}) + case structure[0] + when String + tagname, _, attrs, sraw, _, _, _, eraw = structure[1] + children = structure[2] + etag = eraw && ETag.parse(tagname, eraw) + stag = STag.parse(tagname, attrs, sraw, true) + if !children.empty? || etag + Elem.new(stag, + children.map {|c| build_node(c, opts) }, + etag) + else + Elem.new(stag) + end + when :text + Text.parse_pcdata(structure[1]) + when :emptytag + Elem.new(STag.parse(structure[1], structure[2], structure[3], false)) + when :bogus_etag + BogusETag.parse(structure[1], structure[2]) + when :xmldecl + XMLDecl.parse(structure[2], structure[3]) + when :doctype + if opts[:xhtml_strict] + structure[2]['system_id'] = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" + structure[2]['public_id'] = "-//W3C//DTD XHTML 1.0 Strict//EN" + end + DocType.parse(structure[1], structure[2], structure[3]) + when :procins + ProcIns.parse(structure[1]) + when :comment + Comment.parse(structure[1]) + when :cdata_content + Text.parse_cdata_content(structure[1]) + when :cdata + Text.parse_cdata_section(structure[1]) + else + raise Exception, "[bug] unknown structure: #{structure.inspect}" + end + end + + def STag.parse(qname, attrs, raw_string, is_stag) + result = STag.new(qname, attrs) + result.raw_string = raw_string + result + end + + def ETag.parse(qname, raw_string) + result = self.new(qname) + result.raw_string = raw_string + result + end + + def BogusETag.parse(qname, raw_string) + result = self.new(qname) + result.raw_string = raw_string + result + end + + def Text.parse_pcdata(raw_string) + result = Text.new(raw_string) + result + end + + def Text.parse_cdata_content(raw_string) + result = CData.new(raw_string) + result + end + + def Text.parse_cdata_section(content) + result = CData.new(content) + result + end + + def XMLDecl.parse(attrs, raw_string) + attrs ||= {} + version = attrs['version'] + encoding = attrs['encoding'] + case attrs['standalone'] + when 'yes' + standalone = true + when 'no' + standalone = false + else + standalone = nil + end + + result = XMLDecl.new(version, encoding, standalone) + result.raw_string = raw_string + result + end + + def DocType.parse(root_element_name, attrs, raw_string) + if attrs + public_identifier = attrs['public_id'] + system_identifier = attrs['system_id'] + end + + root_element_name = root_element_name.downcase + + result = DocType.new(root_element_name, public_identifier, system_identifier) + result.raw_string = raw_string + result + end + + def ProcIns.parse(raw_string) + _, target, content = *raw_string.match(/\A<\?(\S+)\s+(.+)/m) + result = ProcIns.new(target, content) + result + end + + def Comment.parse(content) + result = Comment.new(content) + result + end + + module Pat + NameChar = /[-A-Za-z0-9._:]/ + Name = /[A-Za-z_:]#{NameChar}*/ + Nmtoken = /#{NameChar}+/ + end + + # :startdoc: +end diff --git a/vendor/gems/hpricot-0.6/lib/hpricot/tag.rb b/vendor/gems/hpricot-0.6/lib/hpricot/tag.rb new file mode 100644 index 0000000..7fe5479 --- /dev/null +++ b/vendor/gems/hpricot-0.6/lib/hpricot/tag.rb @@ -0,0 +1,228 @@ +module Hpricot + # :stopdoc: + + class Doc + attr_accessor :children + def initialize(children = []) + @children = children ? children.each { |c| c.parent = self } : [] + end + def output(out, opts = {}) + @children.each do |n| + n.output(out, opts) + end + out + end + def altered!; end + end + + class BaseEle + attr_accessor :raw_string, :parent + def html_quote(str) + "\"" + str.gsub('"', '\\"') + "\"" + end + def if_output(opts) + if opts[:preserve] and not @raw_string.nil? + @raw_string + else + yield opts + end + end + def pathname; self.name end + def altered! + @raw_string = nil + end + def self.alterable(*fields) + attr_accessor(*fields) + fields.each do |f| + define_method("#{f}=") do |v| + altered! + instance_variable_set("@#{f}", v) + end + end + end + end + + class Elem + attr_accessor :stag, :etag, :children + def initialize(stag, children=nil, etag=nil) + @stag, @etag = stag, etag + @children = children ? children.each { |c| c.parent = self } : [] + end + def empty?; @children.empty? end + [:name, :raw_attributes, :parent, :altered!].each do |m| + [m, "#{m}="].each { |m2| define_method(m2) { |*a| [@etag, @stag].inject { |_,t| t.send(m2, *a) if t and t.respond_to?(m2) } } } + end + def attributes + if raw_attributes + raw_attributes.inject({}) do |hsh, (k, v)| + hsh[k] = Hpricot.uxs(v) + hsh + end + end + end + def to_plain_text + if self.name == 'br' + "\n" + elsif self.name == 'p' + "\n\n" + super + "\n\n" + elsif self.name == 'a' and self.has_attribute?('href') + "#{super} [#{self['href']}]" + elsif self.name == 'img' and self.has_attribute?('src') + "[img:#{self['src']}]" + else + super + end + end + def pathname; self.name end + def output(out, opts = {}) + if empty? and ElementContent[@stag.name] == :EMPTY + @stag.output(out, opts.merge(:style => :empty)) + else + @stag.output(out, opts) + @children.each { |n| n.output(out, opts) } + if @etag + @etag.output(out, opts) + elsif !opts[:preserve] + ETag.new(@stag.name).output(out, opts) + end + end + out + end + end + + class STag < BaseEle + def initialize(name, attributes=nil) + @name = name.to_s + @raw_attributes = attributes || {} + end + alterable :name, :raw_attributes + def attributes_as_html + if @raw_attributes + @raw_attributes.map do |aname, aval| + " #{aname}" + + (aval ? "=\"#{aval}\"" : "") + end.join + end + end + def output(out, opts = {}) + out << + if_output(opts) do + "<#{@name}#{attributes_as_html}" + + (opts[:style] == :empty ? " /" : "") + + ">" + end + end + end + + class ETag < BaseEle + def initialize(qualified_name) + @name = qualified_name.to_s + end + alterable :name + def output(out, opts = {}) + out << + if_output(opts) do + "" + end + end + end + + class BogusETag < ETag + def output(out, opts = {}); out << if_output(opts) { '' }; end + end + + class Text < BaseEle + def initialize(text) + @content = text + end + alterable :content + def pathname; "text()" end + def to_s + Hpricot.uxs(@content) + end + alias_method :inner_text, :to_s + alias_method :to_plain_text, :to_s + def output(out, opts = {}) + out << + if_output(opts) do + @content + end + end + end + + class CData < Text + alias_method :to_s, :content + alias_method :to_plain_text, :content + def output(out, opts = {}) + out << + if_output(opts) do + "" + end + end + end + + class XMLDecl < BaseEle + def initialize(version, encoding, standalone) + @version, @encoding, @standalone = version, encoding, standalone + end + alterable :version, :encoding, :standalone + def pathname; "xmldecl()" end + def output(out, opts = {}) + out << + if_output(opts) do + "" + end + end + end + + class DocType < BaseEle + def initialize(target, pubid, sysid) + @target, @public_id, @system_id = target, pubid, sysid + end + alterable :target, :public_id, :system_id + def pathname; "doctype()" end + def output(out, opts = {}) + out << + if_output(opts) do + "" + end + end + end + + class ProcIns < BaseEle + def initialize(target, content) + @target, @content = target, content + end + def pathname; "procins()" end + alterable :target, :content + def output(out, opts = {}) + out << + if_output(opts) do + "" + end + end + end + + class Comment < BaseEle + def initialize(content) + @content = content + end + def pathname; "comment()" end + alterable :content + def output(out, opts = {}) + out << + if_output(opts) do + "" + end + end + end + + # :startdoc: +end diff --git a/vendor/gems/hpricot-0.6/lib/hpricot/tags.rb b/vendor/gems/hpricot-0.6/lib/hpricot/tags.rb new file mode 100644 index 0000000..6c2db5f --- /dev/null +++ b/vendor/gems/hpricot-0.6/lib/hpricot/tags.rb @@ -0,0 +1,164 @@ +module Hpricot + + FORM_TAGS = [ :form, :input, :select, :textarea ] + SELF_CLOSING_TAGS = [ :base, :meta, :link, :hr, :br, :param, :img, :area, :input, :col ] + + # Common sets of attributes. + AttrCore = [:id, :class, :style, :title] + AttrI18n = [:lang, 'xml:lang'.intern, :dir] + AttrEvents = [:onclick, :ondblclick, :onmousedown, :onmouseup, :onmouseover, :onmousemove, + :onmouseout, :onkeypress, :onkeydown, :onkeyup] + AttrFocus = [:accesskey, :tabindex, :onfocus, :onblur] + AttrHAlign = [:align, :char, :charoff] + AttrVAlign = [:valign] + Attrs = AttrCore + AttrI18n + AttrEvents + + # All the tags and attributes from XHTML 1.0 Strict + class XHTMLStrict + class << self + attr_accessor :tags, :tagset, :forms, :self_closing, :doctype + end + @doctype = ["-//W3C//DTD XHTML 1.0 Strict//EN", "DTD/xhtml1-strict.dtd"] + @tagset = { + :html => AttrI18n + [:id, :xmlns], + :head => AttrI18n + [:id, :profile], + :title => AttrI18n + [:id], + :base => [:href, :id], + :meta => AttrI18n + [:id, :http, :name, :content, :scheme, 'http-equiv'.intern], + :link => Attrs + [:charset, :href, :hreflang, :type, :rel, :rev, :media], + :style => AttrI18n + [:id, :type, :media, :title, 'xml:space'.intern], + :script => [:id, :charset, :type, :src, :defer, 'xml:space'.intern], + :noscript => Attrs, + :body => Attrs + [:onload, :onunload], + :div => Attrs, + :p => Attrs, + :ul => Attrs, + :ol => Attrs, + :li => Attrs, + :dl => Attrs, + :dt => Attrs, + :dd => Attrs, + :address => Attrs, + :hr => Attrs, + :pre => Attrs + ['xml:space'.intern], + :blockquote => Attrs + [:cite], + :ins => Attrs + [:cite, :datetime], + :del => Attrs + [:cite, :datetime], + :a => Attrs + AttrFocus + [:charset, :type, :name, :href, :hreflang, :rel, :rev, :shape, :coords], + :span => Attrs, + :bdo => AttrCore + AttrEvents + [:lang, 'xml:lang'.intern, :dir], + :br => AttrCore, + :em => Attrs, + :strong => Attrs, + :dfn => Attrs, + :code => Attrs, + :samp => Attrs, + :kbd => Attrs, + :var => Attrs, + :cite => Attrs, + :abbr => Attrs, + :acronym => Attrs, + :q => Attrs + [:cite], + :sub => Attrs, + :sup => Attrs, + :tt => Attrs, + :i => Attrs, + :b => Attrs, + :big => Attrs, + :small => Attrs, + :object => Attrs + [:declare, :classid, :codebase, :data, :type, :codetype, :archive, :standby, :height, :width, :usemap, :name, :tabindex], + :param => [:id, :name, :value, :valuetype, :type], + :img => Attrs + [:src, :alt, :longdesc, :height, :width, :usemap, :ismap], + :map => AttrI18n + AttrEvents + [:id, :class, :style, :title, :name], + :area => Attrs + AttrFocus + [:shape, :coords, :href, :nohref, :alt], + :form => Attrs + [:action, :method, :enctype, :onsubmit, :onreset, :accept, :accept], + :label => Attrs + [:for, :accesskey, :onfocus, :onblur], + :input => Attrs + AttrFocus + [:type, :name, :value, :checked, :disabled, :readonly, :size, :maxlength, :src, :alt, :usemap, :onselect, :onchange, :accept], + :select => Attrs + [:name, :size, :multiple, :disabled, :tabindex, :onfocus, :onblur, :onchange], + :optgroup => Attrs + [:disabled, :label], + :option => Attrs + [:selected, :disabled, :label, :value], + :textarea => Attrs + AttrFocus + [:name, :rows, :cols, :disabled, :readonly, :onselect, :onchange], + :fieldset => Attrs, + :legend => Attrs + [:accesskey], + :button => Attrs + AttrFocus + [:name, :value, :type, :disabled], + :table => Attrs + [:summary, :width, :border, :frame, :rules, :cellspacing, :cellpadding], + :caption => Attrs, + :colgroup => Attrs + AttrHAlign + AttrVAlign + [:span, :width], + :col => Attrs + AttrHAlign + AttrVAlign + [:span, :width], + :thead => Attrs + AttrHAlign + AttrVAlign, + :tfoot => Attrs + AttrHAlign + AttrVAlign, + :tbody => Attrs + AttrHAlign + AttrVAlign, + :tr => Attrs + AttrHAlign + AttrVAlign, + :th => Attrs + AttrHAlign + AttrVAlign + [:abbr, :axis, :headers, :scope, :rowspan, :colspan], + :td => Attrs + AttrHAlign + AttrVAlign + [:abbr, :axis, :headers, :scope, :rowspan, :colspan], + :h1 => Attrs, + :h2 => Attrs, + :h3 => Attrs, + :h4 => Attrs, + :h5 => Attrs, + :h6 => Attrs + } + + @tags = @tagset.keys + @forms = @tags & FORM_TAGS + @self_closing = @tags & SELF_CLOSING_TAGS + end + + # Additional tags found in XHTML 1.0 Transitional + class XHTMLTransitional + class << self + attr_accessor :tags, :tagset, :forms, :self_closing, :doctype + end + @doctype = ["-//W3C//DTD XHTML 1.0 Transitional//EN", "DTD/xhtml1-transitional.dtd"] + @tagset = XHTMLStrict.tagset.merge \ + :strike => Attrs, + :center => Attrs, + :dir => Attrs + [:compact], + :noframes => Attrs, + :basefont => [:id, :size, :color, :face], + :u => Attrs, + :menu => Attrs + [:compact], + :iframe => AttrCore + [:longdesc, :name, :src, :frameborder, :marginwidth, :marginheight, :scrolling, :align, :height, :width], + :font => AttrCore + AttrI18n + [:size, :color, :face], + :s => Attrs, + :applet => AttrCore + [:codebase, :archive, :code, :object, :alt, :name, :width, :height, :align, :hspace, :vspace], + :isindex => AttrCore + AttrI18n + [:prompt] + + # Additional attributes found in XHTML 1.0 Transitional + { :script => [:language], + :a => [:target], + :td => [:bgcolor, :nowrap, :width, :height], + :p => [:align], + :h5 => [:align], + :h3 => [:align], + :li => [:type, :value], + :div => [:align], + :pre => [:width], + :body => [:background, :bgcolor, :text, :link, :vlink, :alink], + :ol => [:type, :compact, :start], + :h4 => [:align], + :h2 => [:align], + :object => [:align, :border, :hspace, :vspace], + :img => [:name, :align, :border, :hspace, :vspace], + :link => [:target], + :legend => [:align], + :dl => [:compact], + :input => [:align], + :h6 => [:align], + :hr => [:align, :noshade, :size, :width], + :base => [:target], + :ul => [:type, :compact], + :br => [:clear], + :form => [:name, :target], + :area => [:target], + :h1 => [:align] + }.each do |k, v| + @tagset[k] += v + end + + @tags = @tagset.keys + @forms = @tags & FORM_TAGS + @self_closing = @tags & SELF_CLOSING_TAGS + end + +end diff --git a/vendor/gems/hpricot-0.6/lib/hpricot/traverse.rb b/vendor/gems/hpricot-0.6/lib/hpricot/traverse.rb new file mode 100644 index 0000000..4ccb853 --- /dev/null +++ b/vendor/gems/hpricot-0.6/lib/hpricot/traverse.rb @@ -0,0 +1,821 @@ +require 'hpricot/elements' +require 'uri' + +module Hpricot + module Traverse + # Is this object the enclosing HTML or XML document? + def doc?() Doc::Trav === self end + # Is this object an HTML or XML element? + def elem?() Elem::Trav === self end + # Is this object an HTML text node? + def text?() Text::Trav === self end + # Is this object an XML declaration? + def xmldecl?() XMLDecl::Trav === self end + # Is this object a doctype tag? + def doctype?() DocType::Trav === self end + # Is this object an XML processing instruction? + def procins?() ProcIns::Trav === self end + # Is this object a comment? + def comment?() Comment::Trav === self end + # Is this object a stranded end tag? + def bogusetag?() BogusETag::Trav === self end + + # Builds an HTML string from this node and its contents. + # If you need to write to a stream, try calling output(io) + # as a method on this object. + def to_html + output("") + end + alias_method :to_s, :to_html + + # Attempts to preserve the original HTML of the document, only + # outputing new tags for elements which have changed. + def to_original_html + output("", :preserve => true) + end + + def index(name) + i = 0 + return i if name == "*" + children.each do |x| + return i if (x.respond_to?(:name) and name == x.name) or + (x.text? and name == "text()") + i += 1 + end + -1 + end + + # Puts together an array of neighboring nodes based on their proximity + # to this node. So, for example, to get the next node, you could use + # nodes_at(1). Or, to get the previous node, use nodes_at(1). + # + # This method also accepts ranges and sets of numbers. + # + # ele.nodes_at(-3..-1, 1..3) # gets three nodes before and three after + # ele.nodes_at(1, 5, 7) # gets three nodes at offsets below the current node + # ele.nodes_at(0, 5..6) # the current node and two others + def nodes_at(*pos) + sib = parent.children + i, si = 0, sib.index(self) + pos.map! do |r| + if r.is_a?(Range) and r.begin.is_a?(String) + r = Range.new(parent.index(r.begin)-si, parent.index(r.end)-si, r.exclude_end?) + end + r + end + p pos + Elements[* + sib.select do |x| + sel = + case i - si when *pos + true + end + i += 1 + sel + end + ] + end + + # Returns the node neighboring this node to the south: just below it. + # This method includes text nodes and comments and such. + def next + sib = parent.children + sib[sib.index(self) + 1] if parent + end + alias_method :next_node, :next + + # Returns to node neighboring this node to the north: just above it. + # This method includes text nodes and comments and such. + def previous + sib = parent.children + x = sib.index(self) - 1 + sib[x] if sib and x >= 0 + end + alias_method :previous_node, :previous + + # Find all preceding nodes. + def preceding + sibs = parent.children + si = sibs.index(self) + return Elements[*sibs[0...si]] + end + + # Find all nodes which follow the current one. + def following + sibs = parent.children + si = sibs.index(self) + 1 + return Elements[*sibs[si...sibs.length]] + end + + # Adds elements immediately after this element, contained in the +html+ string. + def after(html = nil, &blk) + parent.insert_after(Hpricot.make(html, &blk), self) + end + + # Adds elements immediately before this element, contained in the +html+ string. + def before(html = nil, &blk) + parent.insert_before(Hpricot.make(html, &blk), self) + end + + + # Replace this element and its contents with the nodes contained + # in the +html+ string. + def swap(html = nil, &blk) + parent.altered! + parent.replace_child(self, Hpricot.make(html, &blk)) + end + + def get_subnode(*indexes) + n = self + indexes.each {|index| + n = n.get_subnode_internal(index) + } + n + end + + # Builds a string from the text contained in this node. All + # HTML elements are removed. + def to_plain_text + if respond_to? :children + children.map { |x| x.to_plain_text }.join.strip.gsub(/\n{2,}/, "\n\n") + end + end + + # Builds a string from the text contained in this node. All + # HTML elements are removed. + def inner_text + if respond_to? :children + children.map { |x| x.inner_text }.join + end + end + alias_method :innerText, :inner_text + + # Builds an HTML string from the contents of this node. + def html(inner = nil, &blk) + if inner or blk + altered! + case inner + when Array + self.children = inner + else + self.children = Hpricot.make(inner, &blk) + end + reparent self.children + else + if respond_to? :children + children.map { |x| x.output("") }.join + end + end + end + alias_method :inner_html, :html + alias_method :innerHTML, :inner_html + + # Inserts new contents into the current node, based on + # the HTML contained in string +inner+. + def inner_html=(inner) + html(inner || []) + end + alias_method :innerHTML=, :inner_html= + + def reparent(nodes) + altered! + [*nodes].each { |e| e.parent = self } + end + private :reparent + + def clean_path(path) + path.gsub(/^\s+|\s+$/, '') + end + + # Builds a unique XPath string for this node, from the + # root of the document containing it. + def xpath + if elem? and has_attribute? 'id' + "//#{self.name}[@id='#{get_attribute('id')}']" + else + sim, id = 0, 0, 0 + parent.children.each do |e| + id = sim if e == self + sim += 1 if e.pathname == self.pathname + end + p = File.join(parent.xpath, self.pathname) + p += "[#{id+1}]" if sim >= 2 + p + end + end + + # Builds a unique CSS string for this node, from the + # root of the document containing it. + def css_path + if elem? and has_attribute? 'id' + "##{get_attribute('id')}" + else + sim, i, id = 0, 0, 0 + parent.children.each do |e| + id = sim if e == self + sim += 1 if e.pathname == self.pathname + end + p = parent.css_path + p = p ? "#{p} > #{self.pathname}" : self.pathname + p += ":nth(#{id})" if sim >= 2 + p + end + end + + def node_position + parent.children.index(self) + end + + def position + parent.children_of_type(self.pathname).index(self) + end + + # Searches this node for all elements matching + # the CSS or XPath +expr+. Returns an Elements array + # containing the matching nodes. If +blk+ is given, it + # is used to iterate through the matching set. + def search(expr, &blk) + if Range === expr + return Elements.expand(at(expr.begin), at(expr.end), expr.exclude_end?) + end + last = nil + nodes = [self] + done = [] + expr = expr.to_s + hist = [] + until expr.empty? + expr = clean_path(expr) + expr.gsub!(%r!^//!, '') + + case expr + when %r!^/?\.\.! + last = expr = $' + nodes.map! { |node| node.parent } + when %r!^[>/]\s*! + last = expr = $' + nodes = Elements[*nodes.map { |node| node.children if node.respond_to? :children }.flatten.compact] + when %r!^\+! + last = expr = $' + nodes.map! do |node| + siblings = node.parent.children + siblings[siblings.index(node)+1] + end + nodes.compact! + when %r!^~! + last = expr = $' + nodes.map! do |node| + siblings = node.parent.children + siblings[(siblings.index(node)+1)..-1] + end + nodes.flatten! + when %r!^[|,]! + last = expr = " #$'" + nodes.shift if nodes.first == self + done += nodes + nodes = [self] + else + m = expr.match(%r!^([#.]?)([a-z0-9\\*_-]*)!i).to_a + after = $' + mt = after[%r!:[a-z0-9\\*_-]+!i, 0] + oop = false + if mt and not (mt == ":not" or Traverse.method_defined? "filter[#{mt}]") + after = $' + m[2] += mt + expr = after + end + if m[1] == '#' + oid = get_element_by_id(m[2]) + nodes = oid ? [oid] : [] + expr = after + else + m[2] = "*" if after =~ /^\(\)/ || m[2] == "" || m[1] == "." + ret = [] + nodes.each do |node| + case m[2] + when '*' + node.traverse_element { |n| ret << n } + else + if node.respond_to? :get_elements_by_tag_name + ret += [*node.get_elements_by_tag_name(m[2])] - [*(node unless last)] + end + end + end + nodes = ret + end + last = nil + end + + hist << expr + break if hist[-1] == hist[-2] + nodes, expr = Elements.filter(nodes, expr) + end + nodes = done + nodes.flatten.uniq + if blk + nodes.each(&blk) + self + else + Elements[*nodes] + end + end + alias_method :/, :search + + # Find the first matching node for the CSS or XPath + # +expr+ string. + def at(expr) + search(expr).first + end + alias_method :%, :at + + # +traverse_element+ traverses elements in the tree. + # It yields elements in depth first order. + # + # If _names_ are empty, it yields all elements. + # If non-empty _names_ are given, it should be list of universal names. + # + # A nested element is yielded in depth first order as follows. + # + # t = Hpricot('') + # t.traverse_element("a", "c") {|e| p e} + # # => + # {elem {elem {emptyelem } } {emptyelem } } + # {emptyelem } + # {emptyelem } + # + # Universal names are specified as follows. + # + # t = Hpricot(<<'End') + # + # + # + # + # End + # t.traverse_element("{http://www.w3.org/1999/xhtml}meta") {|e| p e} + # # => + # {emptyelem <{http://www.w3.org/1999/xhtml}meta name="robots" content="index,nofollow">} + # {emptyelem <{http://www.w3.org/1999/xhtml}meta name="author" content="Who am I?">} + # + def traverse_element(*names, &block) # :yields: element + if names.empty? + traverse_all_element(&block) + else + name_set = {} + names.each {|n| name_set[n] = true } + traverse_some_element(name_set, &block) + end + nil + end + + # Find children of a given +tag_name+. + # + # ele.children_of_type('p') + # #=> [...array of paragraphs...] + # + def children_of_type(tag_name) + if respond_to? :children + children.find_all do |x| + x.respond_to?(:pathname) && x.pathname == tag_name + end + end + end + + end + + module Container::Trav + # Return all children of this node which can contain other + # nodes. This is a good way to get all HTML elements which + # aren't text, comment, doctype or processing instruction nodes. + def containers + children.grep(Container::Trav) + end + + # Returns the container node neighboring this node to the south: just below it. + # By "container" node, I mean: this method does not find text nodes or comments or cdata or any of that. + # See Hpricot::Traverse#next_node if you need to hunt out all kinds of nodes. + def next_sibling + sib = parent.containers + sib[sib.index(self) + 1] if parent + end + + # Returns the container node neighboring this node to the north: just above it. + # By "container" node, I mean: this method does not find text nodes or comments or cdata or any of that. + # See Hpricot::Traverse#previous_node if you need to hunt out all kinds of nodes. + def previous_sibling + sib = parent.containers + x = sib.index(self) - 1 + sib[x] if sib and x >= 0 + end + + # Find all preceding sibling elements. Like the other "sibling" methods, this weeds + # out text and comment nodes. + def preceding_siblings() + sibs = parent.containers + si = sibs.index(self) + return Elements[*sibs[0...si]] + end + + # Find sibling elements which follow the current one. Like the other "sibling" methods, this weeds + # out text and comment nodes. + def following_siblings() + sibs = parent.containers + si = sibs.index(self) + 1 + return Elements[*sibs[si...sibs.length]] + end + + # Puts together an array of neighboring sibling elements based on their proximity + # to this element. + # + # This method accepts ranges and sets of numbers. + # + # ele.siblings_at(-3..-1, 1..3) # gets three elements before and three after + # ele.siblings_at(1, 5, 7) # gets three elements at offsets below the current element + # ele.siblings_at(0, 5..6) # the current element and two others + # + # Like the other "sibling" methods, this doesn't find text and comment nodes. + # Use nodes_at to include those nodes. + def siblings_at(*pos) + sib = parent.containers + i, si = 0, sib.index(self) + Elements[* + sib.select do |x| + sel = case i - si when *pos + true + end + i += 1 + sel + end + ] + end + + # Replace +old+, a child of the current node, with +new+ node. + def replace_child(old, new) + reparent new + children[children.index(old), 1] = [*new] + end + + # Insert +nodes+, an array of HTML elements or a single element, + # before the node +ele+, a child of the current node. + def insert_before(nodes, ele) + case nodes + when Array + nodes.each { |n| insert_before(n, ele) } + else + reparent nodes + children[children.index(ele) || 0, 0] = nodes + end + end + + # Insert +nodes+, an array of HTML elements or a single element, + # after the node +ele+, a child of the current node. + def insert_after(nodes, ele) + case nodes + when Array + nodes.reverse_each { |n| insert_after(n, ele) } + else + reparent nodes + idx = children.index(ele) + children[idx ? idx + 1 : children.length, 0] = nodes + end + end + + # +each_child+ iterates over each child. + def each_child(&block) # :yields: child_node + children.each(&block) + nil + end + + # +each_child_with_index+ iterates over each child. + def each_child_with_index(&block) # :yields: child_node, index + children.each_with_index(&block) + nil + end + + # +find_element+ searches an element which universal name is specified by + # the arguments. + # It returns nil if not found. + def find_element(*names) + traverse_element(*names) {|e| return e } + nil + end + + # Returns a list of CSS classes to which this element belongs. + def classes + get_attribute('class').to_s.strip.split(/\s+/) + end + + def get_element_by_id(id) + traverse_all_element do |ele| + if ele.elem? and eid = ele.get_attribute('id') + return ele if eid.to_s == id + end + end + nil + end + + def get_elements_by_tag_name(*a) + list = Elements[] + traverse_element(*a.map { |tag| [tag, "{http://www.w3.org/1999/xhtml}#{tag}"] }.flatten) do |e| + list << e + end + list + end + + def each_hyperlink_attribute + traverse_element( + '{http://www.w3.org/1999/xhtml}a', + '{http://www.w3.org/1999/xhtml}area', + '{http://www.w3.org/1999/xhtml}link', + '{http://www.w3.org/1999/xhtml}img', + '{http://www.w3.org/1999/xhtml}object', + '{http://www.w3.org/1999/xhtml}q', + '{http://www.w3.org/1999/xhtml}blockquote', + '{http://www.w3.org/1999/xhtml}ins', + '{http://www.w3.org/1999/xhtml}del', + '{http://www.w3.org/1999/xhtml}form', + '{http://www.w3.org/1999/xhtml}input', + '{http://www.w3.org/1999/xhtml}head', + '{http://www.w3.org/1999/xhtml}base', + '{http://www.w3.org/1999/xhtml}script') {|elem| + case elem.name + when %r{\{http://www.w3.org/1999/xhtml\}(?:base|a|area|link)\z}i + attrs = ['href'] + when %r{\{http://www.w3.org/1999/xhtml\}(?:img)\z}i + attrs = ['src', 'longdesc', 'usemap'] + when %r{\{http://www.w3.org/1999/xhtml\}(?:object)\z}i + attrs = ['classid', 'codebase', 'data', 'usemap'] + when %r{\{http://www.w3.org/1999/xhtml\}(?:q|blockquote|ins|del)\z}i + attrs = ['cite'] + when %r{\{http://www.w3.org/1999/xhtml\}(?:form)\z}i + attrs = ['action'] + when %r{\{http://www.w3.org/1999/xhtml\}(?:input)\z}i + attrs = ['src', 'usemap'] + when %r{\{http://www.w3.org/1999/xhtml\}(?:head)\z}i + attrs = ['profile'] + when %r{\{http://www.w3.org/1999/xhtml\}(?:script)\z}i + attrs = ['src', 'for'] + end + attrs.each {|attr| + if hyperlink = elem.get_attribute(attr) + yield elem, attr, hyperlink + end + } + } + end + private :each_hyperlink_attribute + + # +each_hyperlink_uri+ traverses hyperlinks such as HTML href attribute + # of A element. + # + # It yields Hpricot::Text and URI for each hyperlink. + # + # The URI objects are created with a base URI which is given by + # HTML BASE element or the argument ((|base_uri|)). + # +each_hyperlink_uri+ doesn't yields href of the BASE element. + def each_hyperlink_uri(base_uri=nil) # :yields: hyperlink, uri + base_uri = URI.parse(base_uri) if String === base_uri + links = [] + each_hyperlink_attribute {|elem, attr, hyperlink| + if %r{\{http://www.w3.org/1999/xhtml\}(?:base)\z}i =~ elem.name + base_uri = URI.parse(hyperlink.to_s) + else + links << hyperlink + end + } + if base_uri + links.each {|hyperlink| yield hyperlink, base_uri + hyperlink.to_s } + else + links.each {|hyperlink| yield hyperlink, URI.parse(hyperlink.to_s) } + end + end + + # +each_hyperlink+ traverses hyperlinks such as HTML href attribute + # of A element. + # + # It yields Hpricot::Text. + # + # Note that +each_hyperlink+ yields HTML href attribute of BASE element. + def each_hyperlink # :yields: text + links = [] + each_hyperlink_attribute {|elem, attr, hyperlink| + yield hyperlink + } + end + + # +each_uri+ traverses hyperlinks such as HTML href attribute + # of A element. + # + # It yields URI for each hyperlink. + # + # The URI objects are created with a base URI which is given by + # HTML BASE element or the argument ((|base_uri|)). + def each_uri(base_uri=nil) # :yields: URI + each_hyperlink_uri(base_uri) {|hyperlink, uri| yield uri } + end + end + + # :stopdoc: + module Doc::Trav + def traverse_all_element(&block) + children.each {|c| c.traverse_all_element(&block) } + end + def xpath + "/" + end + def css_path + nil + end + end + + module Elem::Trav + def traverse_all_element(&block) + yield self + children.each {|c| c.traverse_all_element(&block) } + end + end + + module Leaf::Trav + def traverse_all_element + yield self + end + end + + module Doc::Trav + def traverse_some_element(name_set, &block) + children.each {|c| c.traverse_some_element(name_set, &block) } + end + end + + module Elem::Trav + def traverse_some_element(name_set, &block) + yield self if name_set.include? self.name + children.each {|c| c.traverse_some_element(name_set, &block) } + end + end + + module Leaf::Trav + def traverse_some_element(name_set) + end + end + # :startdoc: + + module Traverse + # +traverse_text+ traverses texts in the tree + def traverse_text(&block) # :yields: text + traverse_text_internal(&block) + nil + end + end + + # :stopdoc: + module Container::Trav + def traverse_text_internal(&block) + each_child {|c| c.traverse_text_internal(&block) } + end + end + + module Leaf::Trav + def traverse_text_internal + end + end + + module Text::Trav + def traverse_text_internal + yield self + end + end + # :startdoc: + + module Container::Trav + # +filter+ rebuilds the tree without some components. + # + # node.filter {|descendant_node| predicate } -> node + # loc.filter {|descendant_loc| predicate } -> node + # + # +filter+ yields each node except top node. + # If given block returns false, corresponding node is dropped. + # If given block returns true, corresponding node is retained and + # inner nodes are examined. + # + # +filter+ returns an node. + # It doesn't return location object even if self is location object. + # + def filter(&block) + subst = {} + each_child_with_index {|descendant, i| + if yield descendant + if descendant.elem? + subst[i] = descendant.filter(&block) + else + subst[i] = descendant + end + else + subst[i] = nil + end + } + to_node.subst_subnode(subst) + end + end + + module Doc::Trav + # +title+ searches title and return it as a text. + # It returns nil if not found. + # + # +title+ searchs following information. + # + # - ... in HTML + # - ... in RSS + def title + e = find_element('title', + '{http://www.w3.org/1999/xhtml}title', + '{http://purl.org/rss/1.0/}title', + '{http://my.netscape.com/rdf/simple/0.9/}title') + e && e.extract_text + end + + # +author+ searches author and return it as a text. + # It returns nil if not found. + # + # +author+ searchs following information. + # + # - in HTML + # - in HTML + # - author-name in RSS + # - author-name in RSS + def author + traverse_element('meta', + '{http://www.w3.org/1999/xhtml}meta') {|e| + begin + next unless e.fetch_attr('name').downcase == 'author' + author = e.fetch_attribute('content').strip + return author if !author.empty? + rescue IndexError + end + } + + traverse_element('link', + '{http://www.w3.org/1999/xhtml}link') {|e| + begin + next unless e.fetch_attr('rev').downcase == 'made' + author = e.fetch_attribute('title').strip + return author if !author.empty? + rescue IndexError + end + } + + if channel = find_element('{http://purl.org/rss/1.0/}channel') + channel.traverse_element('{http://purl.org/dc/elements/1.1/}creator') {|e| + begin + author = e.extract_text.strip + return author if !author.empty? + rescue IndexError + end + } + channel.traverse_element('{http://purl.org/dc/elements/1.1/}publisher') {|e| + begin + author = e.extract_text.strip + return author if !author.empty? + rescue IndexError + end + } + end + + nil + end + + end + + module Doc::Trav + def root + es = [] + children.each {|c| es << c if c.elem? } + raise Hpricot::Error, "no element" if es.empty? + raise Hpricot::Error, "multiple top elements" if 1 < es.length + es[0] + end + end + + module Elem::Trav + def has_attribute?(name) + self.raw_attributes && self.raw_attributes.has_key?(name.to_s) + end + def get_attribute(name) + a = self.raw_attributes && self.raw_attributes[name.to_s] + a = Hpricot.uxs(a) if a + a + end + alias_method :[], :get_attribute + def set_attribute(name, val) + altered! + self.raw_attributes ||= {} + self.raw_attributes[name.to_s] = Hpricot.xs(val) + end + alias_method :[]=, :set_attribute + def remove_attribute(name) + name = name.to_s + if has_attribute? name + altered! + self.raw_attributes.delete(name) + end + end + end + +end diff --git a/vendor/gems/hpricot-0.6/lib/hpricot/xchar.rb b/vendor/gems/hpricot-0.6/lib/hpricot/xchar.rb new file mode 100644 index 0000000..6a5aa4b --- /dev/null +++ b/vendor/gems/hpricot-0.6/lib/hpricot/xchar.rb @@ -0,0 +1,94 @@ +#!/usr/bin/env ruby + +# The XChar library is provided courtesy of Sam Ruby (See +# http://intertwingly.net/stories/2005/09/28/xchar.rb) + +# -------------------------------------------------------------------- + +###################################################################### +module Hpricot + + #################################################################### + # XML Character converter, from Sam Ruby: + # (see http://intertwingly.net/stories/2005/09/28/xchar.rb). + # + module XChar # :nodoc: + + # See + # http://intertwingly.net/stories/2004/04/14/i18n.html#CleaningWindows + # for details. + CP1252 = { # :nodoc: + 128 => 8364, # euro sign + 130 => 8218, # single low-9 quotation mark + 131 => 402, # latin small letter f with hook + 132 => 8222, # double low-9 quotation mark + 133 => 8230, # horizontal ellipsis + 134 => 8224, # dagger + 135 => 8225, # double dagger + 136 => 710, # modifier letter circumflex accent + 137 => 8240, # per mille sign + 138 => 352, # latin capital letter s with caron + 139 => 8249, # single left-pointing angle quotation mark + 140 => 338, # latin capital ligature oe + 142 => 381, # latin capital letter z with caron + 145 => 8216, # left single quotation mark + 146 => 8217, # right single quotation mark + 147 => 8220, # left double quotation mark + 148 => 8221, # right double quotation mark + 149 => 8226, # bullet + 150 => 8211, # en dash + 151 => 8212, # em dash + 152 => 732, # small tilde + 153 => 8482, # trade mark sign + 154 => 353, # latin small letter s with caron + 155 => 8250, # single right-pointing angle quotation mark + 156 => 339, # latin small ligature oe + 158 => 382, # latin small letter z with caron + 159 => 376, # latin capital letter y with diaeresis + } + + # See http://www.w3.org/TR/REC-xml/#dt-chardata for details. + PREDEFINED = { + 34 => '"', # quotation mark + 38 => '&', # ampersand + 60 => '<', # left angle bracket + 62 => '>' # right angle bracket + } + PREDEFINED_U = PREDEFINED.inject({}) { |hsh, (k, v)| hsh[v] = k; hsh } + + # See http://www.w3.org/TR/REC-xml/#charsets for details. + VALID = [ + 0x9, 0xA, 0xD, + (0x20..0xD7FF), + (0xE000..0xFFFD), + (0x10000..0x10FFFF) + ] + end + + class << self + # XML escaped version of chr + def xchr(str) + n = XChar::CP1252[str] || str + case n when *XChar::VALID + XChar::PREDEFINED[n] or (n<128 ? n.chr : "&##{n};") + else + '*' + end + end + + # XML escaped version of to_s + def xs(str) + str.to_s.unpack('U*').map {|n| xchr(n)}.join # ASCII, UTF-8 + rescue + str.to_s.unpack('C*').map {|n| xchr(n)}.join # ISO-8859-1, WIN-1252 + end + + # XML unescape + def uxs(str) + str.to_s. + gsub(/\&\w+;/) { |x| (XChar::PREDEFINED_U[x] || ??).chr }. + gsub(/\&\#(\d+);/) { [$1.to_i].pack("U*") } + end + end +end + diff --git a/vendor/gems/hpricot-0.6/test/files/basic.xhtml b/vendor/gems/hpricot-0.6/test/files/basic.xhtml new file mode 100644 index 0000000..898f0ea --- /dev/null +++ b/vendor/gems/hpricot-0.6/test/files/basic.xhtml @@ -0,0 +1,17 @@ + + + + + Sample XHTML + + + + + +

Sample XHTML for MouseHole 2.

+

Please filter me!

+

The third paragraph

+

THE FINAL PARAGRAPH

+ + + diff --git a/vendor/gems/hpricot-0.6/test/files/boingboing.html b/vendor/gems/hpricot-0.6/test/files/boingboing.html new file mode 100644 index 0000000..082a0a8 --- /dev/null +++ b/vendor/gems/hpricot-0.6/test/files/boingboing.html @@ -0,0 +1,2266 @@ + + + + + + + + + + + Boing Boing: A Directory of Wonderful Things + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Boing Boing
+ + + + + + + +
+
+ + + + +
+ +

+ Wednesday, June 14, 2006 +

+ + + +

+ Slipstream Science Fiction anthology defies genre conventions +

+ James Patrick Kelly and John Kessel gave a great interview to Sci Fi Weekly about their new anthology, Feeling Very Strange: The Slipstream Anthology. The book has a top-notch table-of-contents, stories that defy genre conventions and make your head spin in a good way. + +
+ +We make the point in our introduction that slipstream isn't really a genre at the moment and may never be one. What it is, in our opinion, is a literary effect--in the same way that horror or comedy are literary effects achieved by many different kinds of dissimilar stories. What is that effect? We borrowed the term cognitive dissonance from the psychologists. When we are presented with two contradictory cognitions--impressions, feelings, beliefs--we experience cognitive dissonance, a kind of psychic discomfort that we normally try to ease by discounting one of the cognitions as false or illusory and promoting the other to reality. But in some cases we aren't well served by this convenient sorting out. +

+We think that what slipstream stories do is to embrace cognitive dissonance. F. Scott Fitzgerald once said that "The test of a first-rate intelligence is the ability to hold two opposing ideas in mind at the same time and still retain the ability to function." We believe that such an ability is necessary to cope with life in the 21st century and that stories that ask us to exercise that ability are an expression of the zeitgeist. Do you really need a definitive answer as to whether an electron is a wave or a particle? Why? Maybe it's time to make room for uncertainty in contemporary fiction, even if the stories do make you feel very strange. Slipstream may use metafictional techniques to estrange us from consensus reality, they may rewrite history, they may mash up different styles or genres. But that's the point, as we see it. Slipstream has no rules, it has only results. + +
+

+ +Link + +(via Beyond the Beyond) + +
+

posted by + Cory Doctorow at + 03:43:28 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ College kids reportedly taking more smart drugs +

+ High-achieving college kids are reportedly dipping into "brain-steroids" -- drugs like Ritalin and Provigil, which focus attention. No one really knows how widespread this practice is, since it's uncommon for anyone to get busted for peddling smart drugs, and the side-effects of "abuse" are minimal. +

+This strikes me as the canonical cognitive liberty fight: why shouldn't you be allowed to make an informed decision about what state of mind you'd like to be in? Why will the law allow people to kill brain and liver cells with stupefying booze, but not smart drugs? + +

+"What was a surprise, though, was the alarming rate of senior business majors who have used" the drugs, he writes. Almost 90 percent reported at least occasional use of "smart pills" at crunch times such as final exams, including Adderall, Ritalin, Strattera and others. Of those, three-quarters did not have a legitimate prescription, obtaining the pills from friends. "We were shocked," Salantrie writes. He says that in his report, he was "attempting to bring to light the secondary market for Adderall" specifically because "most of the university is not aware" of its extent, he says. +
+ +Link + +(via Futurismic) + +
+

posted by + Cory Doctorow at + 03:33:51 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ UFO sighting picture photoshopping contest +

+ + +The next Worth1000 photoshopping contest challenges artists to fake UFO-sightings photos. The quality of entries here is a little uneven, but the best of the lot are real gems. + +Link + +
+ +
+

posted by + Cory Doctorow at + 03:26:59 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Rube Goldberg machine built out of sticks and stones +

+ + +There's a feature on today's Make video podcast about a giant, elaborate Rube Goldberg machine assembled out of sticks and stones in a forest. The video features some jaw-dropping, Mousetrap-style action, and the use of found forest-floor materials makes it all the more Wile E Coyote. The video features tips on setting up your own woodsy contraption. + + +Link + +
+ +
+

posted by + Cory Doctorow at + 02:59:42 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Lampooning the American dismissal of Gitmo suicides +

+ Fafblog today features a scathing, brilliant satirical look at the US characterization of the Guantanamo Bay suicides as an attack on America. Fafblog is consistently the best political satire/commentary on the net, the Web equivalent of Jon Stewart and Stephen Colbert, and they're finally back after a too-long hiatus. The characterization of the Gitmo suicides as an act of terrorism is so ugly and disingenuous that it begged to be punctured. I'm thankful that Fafblog is back to perform that service. + +
+ +Run for your lives - America is under attack! Just days ago three prisoners at Guantanamo Bay committed suicide in a savage assault on America's freedom to not care about prisoner suicides! Oh sure, the "Blame Atrocities First" crowd will tell you these prisoners were "driven to despair," that they "had no rights," that they were "held and tortured without due process or judicial oversight in a nightmarish mockery of justice." But what they won't tell you is that they only committed suicide as part of a diabolical ruse to trick the world into thinking our secret torture camp is the kind of secret torture camp that drives its prisoners to commit suicide! This fiendish attempt to slander the great American institution of the gulag is nothing less than an act of asymmetrical warfare against the United States - a noose is just a suicide bomb with a very small blast radius, people! - and when faced with a terrorist attack, America must respond. Giblets demands immediate retaliatory airstrikes on depressed Muslim torture victims throughout the mideast! +

+"Oh but Giblets there are dozens of innocent prisoners in Guantanamo" you say because you are a namby-pamby appeasenik who suckles at the teat of terror. Well if these Guantanamo prisoners are so innocent then what are they doing in Guantanamo? Sneaking into our secret military prisons as part of an elaborate plot to make it look like we're holding them in our secret military prisons, that's what! And once they get there they can chain themselves to the floor, break their bones on helpless guards' fists, and waterboard themselves to their heart's content to further their sinister Salafi scheme to sully the reputation of secret American torture facilities everywhere! + +

+ +Link + +
+

posted by + Cory Doctorow at + 02:55:02 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Neil Gaiman tribute CD sneak-peek +

+ A new Neil Gaiman tribute CD is coming out in July. One of the tracks is already available -- "Mr Punch" by Future Bible Heroes, and it's a delight. Apparently, Stephin Merritt (from Future Bible Heroes) is also doing a Lemony Snickett-inspired CD in October. + +
+ +Track Listing:
+1 Rasputina - Coraline
+2 ThouShaltNot - When Everyone Forgets
+3 Tapping The Vein - Trader Boy
+4 Lunascape - Raven Star
+5 Deine Lakaien - A Fish Called Prince
+6 Thea Gilmore - Even Gods Do
+7 Rose Berlin (feat. Curve) - Coraline
+8 Schandmaul - Magda Treadgolds Märchen
+9 Hungry Lucy - We Won't Go
+10 Voltaire w/The Oddz - Come Sweet Death
+11 Future Bible Heroes - Mr. Punch
+12 Razed in Black - The Endless
+13 The Cruxshadows - Wake the White Queen
+14 Ego Likeness - You Better Leave the Stars Alone
+15 Azam Ali - The Cold Black Key
+16 Joachim Witt - Vandemar
+17 Tori Amos - Sister Named Desire (New Master) +
+
+ +Link + +(Thanks, Gary!) + +
+

posted by + Cory Doctorow at + 02:50:59 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Block DRM license plate +

+ + +Tom spotted this DC license plate, reading BLK DRM. He thinks it's an anti-DRM lobbyist's plate, which is plausible, though with the acronym soup in Washington, it could stand for just about anything. + +Link + +(Thanks, Tom) + +
+ +
+

posted by + Cory Doctorow at + 02:43:40 AM + permalink + | blogs' comments + +
+

+

+ + +

+ Tuesday, June 13, 2006 +

+ + + +

+ Chairs upholstered with lush photos +

+ + +ClothUK makes easy chairs and other soft furnishings upholstered with fabric that's printed with the lush, oversized photo of your choice. Not cheap, tho! + +Link + +(via Wonderland) + +
+ +
+

posted by + Cory Doctorow at + 06:21:37 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Corruptibles: Copyright's tech-fighting supervillains +

+ + +EFF has just launched a new video: The Corruptibles -- the story of Copyright Supervillains who patrol the Broadcast Flag future, blowing up our free and open devices. It's a great, funny viral short, and well worth a watch. + + + +Link + +
+ +
+

posted by + Cory Doctorow at + 06:14:53 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ WIPO meets to screw up podcasting, Barcelona, June 21 +

+ The United Nations' World Intellectual Property Organization has called a last-minute meeting on June 21 in Barcelona, out of the normal diplomatic venues to try to ram through the Broadcasting Treaty. This treaty gives broadcasters (not creators or copyright holders) the right to tie up the use of audiovisual material for 50 years after broadcasting it, even if the programs are in the public domain, Creative Commons licensed, or not copyrightable. +

+The Barcelona meeting brings together lots of latinamerican broadcasters -- who no doubt love the idea of a new monopoly right that they get for free merely for broadcasting a work. Bringing these casters in is a way of undermining the effective opposition to the treaty that's come from countries like Brazil and Chile. +

+No public interest groups are on the bill to give a counterpoint (of course not -- WIPO is the kind of place where public interest groups' handouts are thrown in the toilets' trashcans). +

+This meeting is especially deadly, because it looks like they're trying to sneak podcasting back into the treaty, after agreeing to take it out at the last big meeting in Geneva. +

+The good news is, it's open to the public. If you're a digital rights activist in Barcelona -- or just someone who cares about how big corporations are taking away your rights to use works freely -- then you need to be at this meeting. + +

+Webcasting will clearly be part of next week's discussions. That much is clear from the title of next week's event: "From the Rome Convention to Podcasting". One of the invited speakers is from Yahoo! Europe, one of the proponents of new rights for webcasters. This, despite the fact that webcasting and simulcasting were taken out of the "traditional" Broadcasting Treaty and put on the slow track last month in response to concerns expressed by the majority of WIPO member states. +

+The good news: unlike earlier meetings, this one is open to the public, with prior registration requested. So if you care about the proposed treaties and can get to the Barcelona meeting, this is your opportunity to stand up and be counted for the public interest. +

+If you’re in the U.S., please tell your Congressional representatives to hold hearings on the proposed treaties before it’s too late. And if you need a reminder about the harm that these treaties could wreak on access to knowledge and technological innovation, read Jamie Boyle’s piece in today’s Financial Times. + +

+ +Link +

+Update: Jamie Boyle has an excellent column that explains how this treaty (which the US is fighting for) would be unconstitutional in the USA. + +
+

posted by + Cory Doctorow at + 06:09:34 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ From the Boing Boing archives, circa 1999 +

+ I came across this funny list of "Things to Do," written by "fifth Boing Boinger" Stefan Jones, which was published on the pre-blog version of boingboing.net. + +
1. Get $25 worth of paper currency from one of those countries where $25 worth of currency fills up two wheel barrows. Divide it into five lots and send them, along with an incomprehensible letter, to the addresses listed in an email chain letter. + +

2. Build some gigantic rat traps, with wooden bases at least 2' x 3' and baited with an entire blocks of government cheese. Plant the traps, in sprung state, near a local chemical company. Wear giant rat foot shoes while doing this. + +

3. Get a supply of those little plastic ties used to seal hotel minibars after they are loaded with a full complement of overpriced goodies. Bring them and a supply of useful things (socks, condoms, aspirin) and strange things (McGruff the Crime Dog coloring books, bottles of Moxie, a can of Hormel Calf Brains in Milk Gravy) while travelling. Put the things in the minibar before sealing it up.

+ +Link + +
+

posted by + Mark Frauenfelder at + 04:57:07 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Surreal English lessons video from Japan +

+ +Picture 3-10 +Very odd video of Japanese dancing girls and salarymen uttering defensive rebuttals in English. Link (via Sharpeworld) + +
+

posted by + Mark Frauenfelder at + 01:44:02 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Sexed robots video +

+ +Here's a video of two adorable, autonomous "sexed robots." + +
 Zlab Zlabpics Sexedmaleandfemale +The sexed robots are autonomous wheeled platforms fitted with nylon genital organs, respectively male and female. They are programmed to explore their environment, occasionally entering a "in heat" mode, where they will try and locate a partner in the same state. If a partner is located, the robots will attempt to mate.
+ + Link NSFW? (via Sharpeworld) + +
+

posted by + Mark Frauenfelder at + 01:38:27 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Burroughs' Encyclopaedia of Astounding Facts and Useful Information, 1889 +

+ Manybooks.net, which converts Project Gutenberg titles into useful formats for reading on Palm devics, iPods, and ebook readers, recently made available a fantastic compendium called Burroughs' Encyclopaedia of Astounding Facts and Useful Information, 1889: Universal Assistant and Treasure-House of Information to be Consulted on Every Question That Arises in Everyday Life by Young and Old Alike!. + +

It's an amazing combination of a proto-Ripley's, a cookbook, etiquette guide, and almanac. + +

200606131251 + + +WONDERS OF MINUTE WORKMANSHIP. + +

In the twentieth year of Queen Elizabeth, a blacksmith named Mark Scaliot, made a lock consisting of eleven pieces of iron, steel and brass, all which, together with a key to it, weighed but one grain of gold. He also made a chain of gold, consisting of forty-three links, and, having fastened this to the before-mentioned lock and key, he put the chain about the neck of a flea, which drew them all with ease. All these together, lock and key, chain and flea, weighed only one grain and a half. + +

Oswaldus Norhingerus, who was more famous even than Scaliot for his minute contrivances, is said to have made 1,600 dishes of turned ivory, all perfect and complete in every part, yet so small, thin and slender, that all of them were included at once in a cup turned out of a pepper-corn of the common size. Johannes Shad, of Mitelbrach, carried this wonderful work with him to Rome, and showed it to Pope Paul V., who saw and counted them all by the help of a pair of spectacles. They were so little as to be almost invisible to the eye. + +

Johannes Ferrarius, a Jesuit, had in his posession cannons of wood, with their carriages, wheels, and all other military furniture, all of which were also contained in a pepper-corn of the ordinary size.

+ +Link + +
+

posted by + Mark Frauenfelder at + 12:57:03 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Door looks like you walk through it +

+ +200606131240 + + +Fukuda’s Automatic Door opens around your body as you pass through it. The idea is to save energy and keep the room clean. Link + +
+

posted by + Mark Frauenfelder at + 12:39:56 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ AOL's efforts to keep you from quitting your account +

+ Listen to this recording of a guy who called AOL to try to cancel his account and the AOL jerk who tries to keep him from canceling. Just disgusting. Link (via Digg) + +
+

posted by + Mark Frauenfelder at + 12:27:01 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ LA's South Central Farm under police siege right now +

+ The police have closed on South Central Farm, the largest community garden in the USA. The farms were planted after the Rodney King uprising, when the land was given to the neighborhood, and it has been reclaimed and cultivated by 350 families. The city reneged on its promise and sold the land to a developer, who has now moved on it with bulldozers and a riot squad. + +
+The South Central Farm is currently under attack. An early morning raid began this 5-hour long eviction that is still in process. Trees are being cut down, bulldozers are leveling the families’ food, hundreds of protesters are on site rallying with tears in their eyes as the nation’s largest urban farm is destroyed before them. The L.A.P.D. is on tactical alert as fire ladders and cherry pickers are being brought in to remove the tree-sitters. The 350 families created this oasis 14 years ago in the wake of the 1992 uprising when this land was offered to the community by the then Mayor as a form of mitigation. +
+ + + +Link, Flickr's southcentralfarm tag + +(Thanks to everyone who wrote in with this link) +

+Update: Elan sez, "the land for the farm was originally taken from Ralph Horowitz through eminent domain with the intension of using it for a trash incinerator. When the incinerator fell through, the city was required to sell it back to the Horowitz (after a ten year period of first refusal)." + +
+

posted by + Cory Doctorow at + 11:48:42 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Stephen Hawking writing a kids' book +

+ Stephen Hawking and his daughter are collaborating on a kids' novel that is "a bit like Harry Potter, but without the magic." + +
+His daughter Lucy said their forthcoming project would be aimed at people like her own eight-year-old son. +

+"It is a story for children, which explains the wonders of the universe," she said. + + +

+ +Link + +(via Fark) + +
+

posted by + Cory Doctorow at + 11:42:15 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ ScienceMatters@Berkeley, June issue +

+ +My new issue of ScienceMatters@Berkeley is online. In this issue: +
 Archives Volume3 Issue21 Images Oster3
+* Start Your Protein Engines

+* The New New Math of String Theory

+* Molecular Rules of Engagement
+Link + +
+

posted by + David Pescovitz at + 11:42:06 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ iPod dock/speakers built into bumwad dispenser +

+ + +This iPod dock and speakers built into a bumwad dispenser isn't as weird as it seems at first blush -- lots of us have a radio in the bathroom; this is a way of listening to your iPod without sacrificing your limited counterspace to an electronics footprint. + +Link + +(via Popgadget) + +
+ +
+

posted by + Cory Doctorow at + 11:38:34 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Cory's Someone to Town shortlisted for Canada's sf book award +

+ +I'm pleased as punch to say that my novel, Someone Comes to Town, Someone Leave Town has been shortlisted for the Sunburst, Canada's national science fiction award. The Sunburst jury honored me with the award in 2004 for my short story collection A Place So Foreign and Eight More and this is a double-helping of delight. +

+Someone Comes to Town... comes out in a new trade paperback edition this week, too! + +Link + +
+ + +
+

posted by + Cory Doctorow at + 10:59:36 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ People are happier when they're older? +

+ A new study suggests that people may think that the happiest days of their lives are when they're young, but that belief doesn't jibe with reality. University of Michigan and VA Ann Arbor healthcare Systems researchers polled 540 adults in the 21-40 age group and 60+ age group. They rated their own happiness right now, predicted how happy they'd be in the future, and also how happy they think others are in those age groups. The results were published in the Journal of Happiness Studies, which is a delightful name for a scientific publication. From the University of Michigan Health System: +
"Overall, people got it wrong, believing that most people become less happy as they age, when in fact this study and others have shown that people tend to become happier over time," says lead author Heather Lacey, Ph.D., a VA postdoctoral fellow and member of the U-M Medical School's Center for Behavioral and Decision Sciences in Medicine. "Not only do younger people believe that older people are less happy, but older people believe they and others must have been happier 'back then'. Neither belief is accurate..."

+ +"People often believe that happiness is a matter of circumstance, that if something good happens, they will experience long-lasting happiness, or if something bad happens, they will experience long-term misery," (says co-author Peter Ubel). "But instead, people's happiness results more from their underlying emotional resources -- resources that appear to grow with age. People get better at managing life's ups and downs, and the result is that as they age, they become happier -- even though their objective circumstances, such as their health, decline."
+Link + +
+

posted by + David Pescovitz at + 10:58:28 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ The incredible sound-mimicking lyrebird +

+ +Lyrebird +Here's a video clip of a male Australian lyrebird, which sings complex songs to attract mates. Lyrebirds' songs are composed of sounds they hear, including sounds from machines, such as a camera's shutter mechanism and film drive, a car alarm, and logging equipment. This bird is like a tape recorder. Link (thanks, Coop!) + +
+

posted by + Mark Frauenfelder at + 10:53:26 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Aymara people's "reversed" concept of time +

+ The Aymara, an indigenous group in the Andes highlands, have a concept of time that's opposite our own spatial metaphor. A new study by cognitive scientists explains how the Aymara consider the past to be ahead and the future behind them. According to the study, this is the first documented culture that seems not to have mapped time with the properties of space "as if (the future) were in front of ego and the past in back." From UCSD: +
The linguistic evidence seems, on the surface, clear: The Aymara language recruits “nayra,†the basic word for “eye,†“front†or “sight,†to mean “past†and recruits “qhipa,†the basic word for “back†or “behind,†to mean “future.†So, for example, the expression “nayra mara†– which translates in meaning to “last year†– can be literally glossed as “front year..."

The Aymara, especially the elderly who didn’t command a grammatically correct Spanish, indicated space behind themselves when speaking of the future – by thumbing or waving over their shoulders – and indicated space in front of themselves when speaking of the past – by sweeping forward with their hands and arms, close to their bodies for now or the near past and farther out, to the full extent of the arm, for ancient times. In other words, they used gestures identical to the familiar ones – only exactly in reverse. +

+“These findings suggest that cognition of such everyday abstractions as time is at least partly a cultural phenomenon,†(University of California, San Diego professor Rafael) Nunez said. “That we construe time on a front-back axis, treating future and past as though they were locations ahead and behind, is strongly influenced by the way we move, by our dorsoventral morphology, by our frontal binocular vision, etc. Ultimately, had we been blob-ish amoeba-like creatures, we wouldn’t have had the means to create and bring forth these concepts. +

+“But the Aymara counter-example makes plain that there is room for cultural variation. With the same bodies – the same neuroanatomy, neurotransmitters and all – here we have a basic concept that is utterly different,†he said. +
Link + +
+

posted by + David Pescovitz at + 10:05:40 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Webby Awards last night, with Prince +

+
+Prince
+
Prince performed an acoustic number at last night's Webby Awards in NYC. Prince won a Lifetime Achievement Award. His five word acceptance speech: "Everything you think is true." Also in attendance were Robert Kahn, Gorillaz, Arianna Huffington, and dozens of other interesting folks. Rob Corddry hosted. Congrats to all the winners and our friends at the Webby Awards for what sounds like an amazing ceremony! Check Rocketboom for the edit of the evening.
Link + +
+

posted by + David Pescovitz at + 09:19:33 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Electrical substations disguised as houses +

+ Toronto Hydro, the electrical authority in Toronto, has spent decades building electrical substations that are disguised as typical family houses: + +
+ +In 1987, Canadian photographer Robin Collyer began documenting houses that aren't houses at all – they're architecturally-disguised electrical substations, complete with windows, blinds, and bourgeois landscaping. +

+"During the 1950s and 1960s," Collyer explains in a recent issue of Cabinet Magazine, "the Hydro-Electric public utilities in the metropolitan region of Toronto built structures known as 'Bungalow-Style Substations.' These stations, which have transforming and switching functions, were constructed in a manner that mimics the style and character of the different neighborhoods." +
+

+ +Link + +
+

posted by + Cory Doctorow at + 04:53:31 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Candyland board made from 100k beads +

+ + +Peggy Dembicer cloned a 1978 Candyland game-board using over 100,000 novelty beads. She's documented the finished project on Flickr, with details of some of the finer work. + +Link + +(via Make Blog) + +
+ +
+

posted by + Cory Doctorow at + 12:10:49 AM + permalink + | blogs' comments + +
+

+

+ + +

+ Monday, June 12, 2006 +

+ + + +

+ Stanford prof sues James Joyce estate for right to study Joyce +

+ A prof at Stanford University is suing the estate of James Joyce over the estate's long practice of destroying documents vital to Joyce scholarship, and of intimidating academics and creators who want to study and extend the works of Joyce. Carol Shloss, a Joyce scholar, has worked for 15 years on a book about the ways in which the book Finnegans Wake was inspired by Joyce's mentally ill daughter. Joyce's grandson, Stephen Joyce, have allegedly destroyed documents relating to this to undermine her book. +

+This isn't the first time that Stephen Joyce has hurt the cause of scholarship about his grandfather. He threatened to sue the Irish Museum over its exhibition of Joyce's papers. He threatened to sue pubs in Ireland for allowing people to read aloud from Joyce's novels on Bloomsday, the celebration of Ulysses. He told symphonic composers that they couldn't put Joyce quotations in their symphonies. +

+Most tragically, there was a brief moment when Stephen Joyce was irrelevant. The works of James Joyce were in the public domain until the EU copyright directive extended copyright by 20 years, putting Joyce's books back into the care of his capricious grandson for decades. +

+There's a whole body of scholarship devoted to tracking the ways in which Stephen Joyce has made himself the enemy of academics and Joyce lovers. The best work to start with is Matthew Rimmer's Bloomsday: Copyright Estates and Cultural Festivals. + +

+Before the book was published, publisher Farrar, Straus and Giroux removed several supporting citations from Shloss' tome to avoid a lawsuit, according to Olson. Shloss wants to post that information as an electronic appendix to answer several critics who charged that "To Dance in the Wake" was interesting, but thin on documentary evidence, Olson said. +

+"It's painful once you've written something ... that you think is complete and good, to have it hacked up," Olson said. "There is a desire to bring it forth in the way she originally intended." +

+Shloss prepared the Web site last year but never made it public because she worried about being sued, Olson said. Among the items excised from the book are quotations from "Finnegans Wake" she thinks support her thesis, as well as letters between James Joyce and his daughter, according to Olson. +

+Shloss wants the court to declare she's entitled to use information the estate controls under laws that allow authors to quote copyrighted works if they do it in "a scholarly transformative manner." +

+ +Link + +(Thanks, Vidiot!)

+Update: This New Yorker article on the case is full of great color and background, and includes the fact that Larry Lessig, founder of the Creative Commons project, is arguing the case. + +
+

posted by + Cory Doctorow at + 10:52:01 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ HOWTO turn a NES controller into a cell-phone +

+
+ +Diyhappy took apart a Nokia 3200 -- which had interchangeable faceplates and was thus readily uncased -- and rebuilt it inside an old Nintendo Entertainment System controller. He dremelled out holes for the buttons and the screen and voila, the NES mobile phone. + + +Link + +(Thanks, Sam!) + +
+

posted by + Cory Doctorow at + 10:39:04 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ HOWTO make cufflinks out of Ethernet connectors +

+ + +Mark got invited to a fancy party and couldn't find his cufflinks, so he hacked a pair out of some Ethernet connectors and bits of wire; and thus the crimp-your-own cufflink was born. He's written up his mod in detail for others who want to follow suit. + +Link + +(Thanks, Mark!) + +
+ +
+

posted by + Cory Doctorow at + 10:32:58 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Inside China's iPod sweat-shops +

+ A British paper sent a reporter to "iPod City," the plant in Longhua, China, where iPods are assembled by women who earn $50/month for working 15 hour days. +

+My guess is that this is no worse than the conditions in which Powerbooks, Thinkpads, Zens, Linksys routers, etc are manufactured, but Christ, this is depressing. + +

+ The Mail visited some of these factories and spoke with staff there. It reports that Foxconn's Longhua plant houses 200,000 workers, remarking: "This iPod City has a population bigger than Newcastle's." +

+The report claims Longhua's workers live in dormitories that house 100 people, and that visitors from the outside world are not permitted. Workers toil for 15-hours a day to make the iconic music player, the report claims. They earn £27 per month. The report reveals that the iPod nano is made in a five-storey factory (E3) that is secured by police officers. +

+Another factory in Suzhou, Shanghai, makes iPod shuffles. The workers are housed outside the plant, and earn £54 per month - but they must pay for their accommodation and food, "which takes up half their salaries", the report observes. + + +

+ +Link + +(Thanks, Tony!) +

+Update: A former Nokia employee adds, "Add Nokia phones to your list. The type label may say 'Made in Finland' (top-notch models) or 'Made in Hungary' (mid-range ones), but Nokia cellphone engines (ie. the actual hardware) are manufactured by Foxconn in Longhua, China... unless they've found a cheaper supplier. Yes, I actually worked at the plant for a few months between real jobs." + +

+Update 2: Apple has promised to investigate the labor conditions in its iPod factories. + +
+

posted by + Cory Doctorow at + 10:29:26 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Dave Alvin profile +

+ +200606122126 +Colin Berry's Dave Alvin piece, which ran on KQED's "California Report" a couple weeks ago, is now available online. + +

Colin says: "Dave's new album [West of the West] is a tribute to California songwriters, including Tom Waits, Kate Wolf, Merle Haggard, Los Lobos, and others. I hung with him in the studio and talked to him (and some of the original songwriters) during the making of it." + +Link + +
+

posted by + Mark Frauenfelder at + 09:26:09 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Tim Biskup's tiny sculpture +

+ +Iki-Happy O +Iki-Sad O +
Tim Biskup has created a tiny bronze sculpture to sell at his Laguna Art Museum retrospective (along with Gary Baseman). + +
Iki stands 2.25" tall, has dual faces, is limited to 44 signed and numbered pieces,  and comes in a letterpressed packaging. Iki will be available at the Saturday opening (6.17.06, 8 - 10 PM)  of Tim's joint retrospective Pervasion show with Gary Baseman at the Laguna Art Museum.
Link (Thanks, Scott!) + + +
+

posted by + Mark Frauenfelder at + 09:21:26 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Covers from '60s French satirical magazine: Hara Kiri +

+ +Hara Kiri +Here are a bunch of cover scans of a magazine I didn't know about until today. According to Wikipedia, Hara Kiri was created in 1960 and "in 1961 and 1966 they were temporarily banned by the French Government." Link + + + +
+

posted by + Mark Frauenfelder at + 06:57:48 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Negativland performing in LA tonight +

+ Mark from Negativland says: + +
This is very late notice, but we (Negativland) want to let you and all +Boingboingers know that we are playing live in LA. this Monday night, +June 12th, at the Silent Movie Theater! Yes. We are. It's at 611 +North Fairfax Ave. Hollywood Box office- 323-655-2520. Tickets are +$22. The doors are at 9pm and the show starts at 10pm sharp! + +

This is a very rare appearance for us in L.A, and at a really cool and +intimate venue. The show is we are performing is called "It's All In +Your Head FM", and we hope you can attend! It's about monotheism, but +in stereo. With blindfolds handed out at the door. Really.

+Link + +
+

posted by + Mark Frauenfelder at + 06:24:05 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Meme Therapy interviews Rudy Rucker +

+ Meme Therapy has a long and interesting review with one of my very favorite authors, Rudy Rucker. + +
MT: What aspects of writing do you enjoy the most? + +

+200606121734 +RR: I like leaving the daily world and going to another world, a world that I had a hand in designing. You’ll notice that in most of my novels, the main character in fact leaves the world where I start him out and goes to another world. Another planet, another dimension, another sheet of reality. It’s an objective correlative for what I’m doing when I leave this mundane world and go into the world of my novel. + +

Writing is so much work. Every part of writing a novel is hard. The planning, the sitting down and creating, the revising. I guess the most fun part is when it seems to pour out and I’m having a good day. When I’m doing that, I stop worrying for a while, I forget myself and I’m happy and proud and even exalted and amazed to see what’s coming down or going up. + +

More precisely, that fun part is “the narcotic moment of creative bliss.” I just heard John Malkovich deliver that phrase, playing the role of an artist/art prof in Art School Confidential. That’s very right on; the operative word is “narcotic,” it’s definitely something you get addicted to over the years. Really I go to all this trouble writing a novel day after day month after month because, in a way, I’m trying to get high. Or see God. Or make love to the Muse. Waiting for the narcotic moment of creative bliss.

+ +Link + +
+

posted by + Mark Frauenfelder at + 05:35:13 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Transparent street signs +

+ + City Of Chicago Images Images Image04 +Two years ago, artist Cayetano Ferrer took photos of the scene behind several Chicago street signs and then pasted the prints on top of the signs to achieve an amazing transparency effect. (As the Wooster Collective blog points out, Amnesty International's recent ad campaign employs a similar technique. And it's also the idea behind the "Transparent Screen" trick for your computer display.)
+Link to Ferrer's "City of Chicago" image gallery, Link to Amnesty International campaign (via Neatorama) + +
+

posted by + David Pescovitz at + 03:41:34 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Illustrations from Rabelais's Gargantua and Pantagruel +

+ + +Bibliodyssey has posted two mind-blowing selections of surrealist characters from a 1565 publication called "Les Songes Drolatiques de Pantagruel, ou sont contenues plusieurs figures de l’invention de maistre François Rabelais : & derniere oeuvre d’iceluy, pour la recreation des bons esprits." While Rabelais is often credited with drawing the characters to accompany his text, they were apparently most likely drawn by François Desprez. The absurd monsters remind me of the wonderful phantasmagoric work of Jim Woodring.
 Blogger 1717 1584 1600 Rabelais-Pantegruel-By-Francois-Desprez-11-1 +
+From Bibliodyssey: + +
Franciscan friar, doctor, traveller, model for the Thelemic magickal writings of Aleister Crowley, humanist, Benedictine monk, alchemist, teacher, leader of the French renaissance, heretic, greek scholar and groundbreaking satirical writer, François Rabelais (?1483/1493-1553) issued his magnum opus 'The life of Gargantua and Pantagruel' as a five book series over 20 years up to 1564. +

+The books chart the humorous adventures of giants Gargantua and his son, Pantagruel in a scatalogical and often bawdy manner. Rabelais wrote in the epic tradition of Homer, and beyond the burlesque, there is an underlying serious examination of society, politics, education and philosophy whilst introducing 500 new words to the french lanugage.
Link and +Link + +
+

posted by + David Pescovitz at + 02:52:18 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Cartoonist Chris Ware on the piano +

+ +Chris Ware on piano +This isn't fair. Not only is Chris Ware a supremely gifted cartoonist, he can also play ragtime piano like nobody's business. Link (via Flog!) + +

Reader comment: + +Rob DeRose says: + +

Chris Ware shares his love of ragtime with MacArthur Genius Grant winner Reginald Robinson. In fact Chris heard Reginald playing in the winter garden of the Chicago Central Library one day and became fast friends. Here's a story from NPR on how the two of them found an entirely new song of Scott Joplin's. (its the fourth of four mini-segments.) + + +

I've been a fan of Reginald ever since I saw him accompany the Squirrel Nut Zippers (in-between their first & second album) here in Chicago. If you get a chance to see him, by all means go. A nice Trib article about him. His CD on Amazon. + +

The Chicago Library's winter garden, where he used to practice, and where he & Chris Ware met (it's the nicest part of the building.)

+ +
+

posted by + Mark Frauenfelder at + 02:22:04 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Walt Disney's 1956 time-capsule letter to the future +

+ The Disney company has unearthed a 1956 time-capsule containing a letter from Walt Disney to the future, on stationary bearing the legend "NO AGREEMENT WILL BE BINDING ON THIS CORPORATION UNLESS IN WRITING AND SIGNED BY AN OFFICER." Walt's letter to the future speculates about the future of entertainment and is at once profoundly wrong and profoundly right. +

+Walt predicts that the world will be overturned by technology, all the old order remade. At the same time, he assumes that what will come in on the tails of 1956's mass media will be...more mass media! Even though Walt himself predated truly national media, he can't conceive of the age of mass media waning and being replaced by a mass medium -- a channel like the net -- crowded with a never-ending confusion of micro-media. Walt, in other words, didn't predict the long tail. + +

+[...O]f one thing I'm sure. People will need and demand amusement, refreshment and pleasant relaxation from daily tasks as much in your day as they have in ours and in all the generations of mankind into the remote past. What the exact nature and implementation of these mass entertainments may be, doesn't make much difference, it seems to me. +

+Humanity, as history informs us, changes very slowly in character and basic interests. People need to play as much as they need toll. They never cease to be fascinated by they own powers and passions, their base or noble emotions, their faiths and struggles and triumphs against handicap -- all things that make them laugh and weep and comfort one another in love and sacrifice out of the depths of their being... +

+Mindful of the phenomenal discoveries and applications of science to all our activities and institutions, it seems no mere guess that public entertainment will have become machined and powered by atomic and solar energies long before you read this capsule. +

+The extension of radar and other as yet untapped sources of cosmic force may well have changed the entire technique of communication, in the theatre and television fields as well as in other areas of informational broadcast. +

+Millions of people in massive assemblies around the world may now be viewing the same staged or natural event, scanned by some incredibly potent scope, in the same amount of time. They may even be viewing presently obscured vistas on neighboring planets as one might look at neighbors across our Los Angeles Streets. +

+Omniscience will have drawn closer to finite senses and perceptions, for our entertainment as for our livelihood -- yours, I should say, who will read this in your 21st Century. +

+ +200K PDF Link + +(Thanks, Anonymous Source!) + +
+

posted by + Cory Doctorow at + 02:01:45 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Plans for Barney Fife statue toppled by Knotts' estate +

+ A couple of Barney Fife fans who put down $8,000 to erect a statue of Barney Fife (played by Mick Jagger lookalike Don Knotts) in downtown Mount Airy, NC (the model for Mayberry) received a letter from CBS attorneys telling them to halt the project. + +
+ Knottsstatue +[CBS attorney] Mallory Levitt explained to [would-be statue erector Tom] Hellebrand and the Mount Airy News that although Paramount/CBS owned the rights to the character of Barney Fife, the group didn't have the authority to give permission for a likeness of Don Knotts. + +

"That right belongs to the Knotts estate," she said. + +

Levitt told Hellebrand she contacted the actor's estate and business associates of Andy Griffith, and none wanted to go through with the project.

+ +The project website, donknottsstatue.com, has a note about the cancellation of the project: "The tears on our pillows bespeak the pain that is in our hearts." The project leaders will be selling a full-size replica of a Mayberry Squad car and a golf cart made to look like a squad car on eBay to recoup their expenses. + +Link (Thanks for the correct, url, Dru!) + +
+

posted by + Mark Frauenfelder at + 01:20:09 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Ol' Glory energy drink +

+ + 72 165796068 94C49E9C84 +At the Institute for the Future this morning, my colleague Mike Love is chugging this delicious and patriotic energy drink. Their tag line: "Makes you feel better all over than anywhere else." Ummm....
Link to Ol' Glory site, Link to Mike's photo on Flickr + +
+

posted by + David Pescovitz at + 11:41:56 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ theFLOWmarket sells consumer awareness +

+ +Flowmarket +Gmo +
+theFLOWmarket is a supermarket-as-artwork that sells consumer awareness in the form of imaginary products like "commercial free-space," "exploitation free produce," "symptom removers," "factory farming antibiotics," "renewable energy," and "a feeling of safety." The nicely-packaged products are available for sale at prices from $5 to $20. theFLOWmarket is open for business at the Danish Design Centre in Copenhagen. +Link to Flash site (Thanks, Lindsay Tiemeyer!) + +
+

posted by + David Pescovitz at + 11:34:06 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Pea-head smashes art gallery window, gets busted +

+ Roq La Rue gallery Kirsten Anderson has a funny story about an idiot that smashed a window at her new gallery in Seattle, called BLVD. He might just be the stupidest brick-wielder on in the known universe. Read on... + +
+BLVD broken window +[A]fter I left and Damion was closing up, some drunk mouth-breathing knuckle-dragger starts banging on the door demanding to be let in. After Damion tells him that the gallery was closed, the Moron says "I'm going to smash your door in with a brick!" Damion at the time was talking to a couple of bad asses who offered to kick the guy's ass for us and looks like we should have taken them up on it, as an hour later, the guy pulls up to the gallery in his car, double parks, pulls a brick out of his car, and smashes BLVD's door a couple times. Cool huh? No one was in the gallery -- but the guy who lives upstairs heard it and called Damion. Also -- there is a bar a few storefronts away from us and I guess the folks on the patio saw it all. But it gets better. Moron turns to go back to his car and finds he's locked himself out. Har har! So he tries to smash his own car window in with the brick, which doesn't work... so he goes into the Rendevous to use the payphone to call a locksmith which is where he got nabbed by the cops. What a maroon. So anyway. Today is happy fun door repair day.
+ +Link + +
+

posted by + Mark Frauenfelder at + 11:04:18 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Prescription stimulants on campus +

+ In yesterday's Washington Post, Joel Garreau, author of Radical Evolution, writes about the popularity of drugs like Adderall and Provigil to increase focus and wakefulness during academically stressful times. From the article: +
"I'm a varsity athlete in crew," says Katharine Malone, a George Washington University junior. "So we're pretty careful about what we put in our bodies. So among my personal friends, I'd say the use is only like 50 or 60 percent..."

+For a senior project this semester, Christopher Salantrie conducted a random survey of 150 University of Delaware students at the university's Morris Library and Trabant Student Center. +

+"With rising competition for admissions and classes becoming harder and harder by the day, a hypothesis was made that at least half of students at the university have at one point used/experienced such 'smart drugs,' " Salantrie writes in his report. He found his hunch easy to confirm. +

+"What was a surprise, though, was the alarming rate of senior business majors who have used" the drugs, he writes. Almost 90 percent reported at least occasional use of "smart pills" at crunch times such as final exams, including Adderall, Ritalin, Strattera and others. Of those, three-quarters did not have a legitimate prescription, obtaining the pills from friends."
+Link (Thanks, Jason Tester!) + +
+

posted by + David Pescovitz at + 09:51:50 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Vintage pulp covers for classic novels +

+ + +Slate commissioned designers to produce six vintage pulp-fiction covers for classic novels like Moby Dick ("Primitive Pirate Passions Were a Prelude to Death!"), The Iliad ("Gore! Greeks! Glory!") and Alice in Wonderland ("One girl's drug-induced descent into dreamland debauchery"). The results are lovely. + +Link + +(Thanks, Fipi Lele!) + +
+ +
+

posted by + Cory Doctorow at + 08:33:24 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ LotR video clip with voices replaced by foolish groans +

+ + +In this youtube, "CJ" has taken a clip from the Lord of the Rings trilogy in which Frodo awakens in the Elf stronghold and greets his comrades and replaced all the voices with idiotic groaning and moaning and squealing, apparently voiced by someone named Olaf. The net effect is surprisingly funny! + +Link + +(Thanks, Alice!) + +
+ +
+

posted by + Cory Doctorow at + 04:36:17 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ William Gibson blogging fiction excerpts +

+ Since June 1, William GIbson has been posting irregular chunks of prose to his blog, stuff that appears to be excerpts from a novel-in-progress. It's fascinating stuff, little vignettes that hint at a really exciting bigger picture. + +
+Vianca sat cross-legged on Tito’s floor, wearing a disposable hairnet and white knit cotton gloves, with his Sony plasma screen across her knees, going over it with an Armor All wipe. When she’d wiped it completely down, it would go back into its factory packaging, which in turn would be wiped down. Tito, in his own hairnet and gloves, sat opposite her, wiping the keys of his Casio. A carton of cleaning supplies had been waiting for them in the hall, beside a new and expensive-looking vacuum-cleaner Vianca said was German. Nothing came out of this vacuum but air, she said, so there would no stray hairs or other traces left behind. Tito had helped his cousin Eusebio with exactly this procedure, though Eusebio had mainly had books, each of which had needed, according to protocol, to be flipped through for forgotten insertions and then wiped. The reasons for Eusebio’s departure had never been made clear to him. That too was protocol. +
+ +Link 1, + +Link 2, + +Link 3 + +
+

posted by + Cory Doctorow at + 12:29:17 AM + permalink + | blogs' comments + +
+

+

+ + +

+ Sunday, June 11, 2006 +

+ + + +

+ Japanese anti-foreigner comic warns against human rights act +

+
+ +Coal sez, "I've just translated and posted a rather well rendered manga from an 'emergency publication' in Japan about the dangers of protecting human rights. Japan is a little behind in legal recognition of basic human rights (including but not limited to racial discrimination etc.), and it seems the emergence of a bill to make protection of rights enforceable has a few people worried. The level of alarmism I think is particularly amusing, if that's the right word. What's also noteworthy is the constant demonising of trouble-making foreigners, and the pity the writer tries to inspire for the poor landlord who can no longer refuse to rent his house to Chinese etc. You can't make this stuff up!" + + +Link + +(Thanks, Coal!) + +
+

posted by + Cory Doctorow at + 10:54:13 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ iPod Nano boombox built into flashlight casing +

+ + +Here's a monaural boombox built into the housing for a big Eveready flashlight. The speaker fits over the mouth, and it sits over a miniature amp scavegened from a set of desktop speakers and an iPod Nano with a wireless remote. + +Link to parts-list, Link to finished item + +
+ +
+

posted by + Cory Doctorow at + 10:12:36 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ New Barenaked Ladies single as free, remixable multitracks +

+ +The Canadian band Barenaked Ladies have pre-released a track from their upcoming album Barenaked Ladies Are Me, in a four-track mix that's ready for remixing, and free. They're planning to do more of the same with their future releases. +

+I used to see BNL play at my local shopping mall, the Scarborough Town Centre, when all they'd released was an indie cassette tape with an amazing cover of Public Enemy's "Fight the Power" on it, and I'm so amazingly glad to see them still making great music. What's more, the band's frontman, Steve Page, is also fronting a group of Canadian musicians who've spoken out against DRM and suing fans and other music label shenanigans. +

+Best of all -- they're releasing the next album as a 15-song digital version as well as a 13-song CD, so I can get their music without having to take another piece of slow-decaying, space-hogging media into my already overcrowded home. + +Link + +(Thanks, Frank!) + +
+ +
+

posted by + Cory Doctorow at + 11:27:33 AM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Images from anti-DRM protest at the San Fran Apple Store +

+ +Here are some photos and a video from yesterday's anti-DRM protest at the Apple Store in San Francisco. + +Video Link, Photos Link + +
+ +
+

posted by + Cory Doctorow at + 11:19:28 AM + permalink + | blogs' comments + +
+

+

+ + +

+ Saturday, June 10, 2006 +

+ + + +

+ Responses to Jaron Lanier's crit of online collectivism +

+ Two weeks ago, Edge.org published Jaron Lanier's essay "Digital Maoism: The Hazards of the New Online Collectivism," critiquing the importance people are now placing on Wikipedia and other examples of the "hive mind," as people called it in the cyberdelic early 1990s. It's an engaging essay to be sure, but much more thought-provoking to me are the responses from the likes of Clay Shirky, Dan Gillmor, Howard Rheingold, our own Cory Doctorow, Douglas Rushkoff, and, of course, Jimmy Wales.

From Douglas Rushkoff: + + +
I have a hard time fearing that the participants of Wikipedia or even the call-in voters of American Idol will be in a position to remake the social order anytime, soon. And I'm concerned that any argument against collaborative activity look fairly at the real reasons why some efforts turn out the way they do. Our fledgling collective intelligences are not emerging in a vacuum, but on media platforms with very specific biases. +

+First off, we can't go on pretending that even our favorite disintermediation efforts are revolutions in any real sense of the word. Projects like Wikipedia do not overthrow any elite at all, but merely replace one elite — in this case an academic one — with another: the interactive media elite...

+ +While it may be true that a large number of current websites and group projects contain more content aggregation (links) than original works (stuff), that may as well be a critique of the entirety of Western culture since post-modernism. I'm as tired as anyone of art and thought that exists entirely in the realm of context and reference — but you can't blame Wikipedia for architecture based on winks to earlier eras or a music culture obsessed with sampling old recordings instead of playing new compositions. +

+Honestly, the loudest outcry over our Internet culture's inclination towards re-framing and the "meta" tend to come from those with the most to lose in a society where "credit" is no longer a paramount concern. Most of us who work in or around science and technology understand that our greatest achievements are not personal accomplishments but lucky articulations of collective realizations. Something in the air... Claiming authorship is really just a matter of ego and royalties. +
+From Cory Doctorow: +
Wikipedia isn't great because it's like the Britannica. The Britannica is great at being authoritative, edited, expensive, and monolithic. Wikipedia is great at being free, brawling, universal, and instantaneous.
+ +From Jimmy Wales (italics indicate quotes from Jaron's original essay): + + +
"A core belief of the wiki world is that whatever problems exist in the wiki will be incrementally corrected as the process unfolds." +

+My response is quite simple: this alleged "core belief" is not one which is held by me, nor as far as I know, by any important or prominent Wikipedians. Nor do we have any particular faith in collectives or collectivism as a mode of writing. Authoring at Wikipedia, as everywhere, is done by individuals exercising the judgment of their own minds. +

+ "The best guiding principle is to always cherish individuals first." +

+Indeed.
+Link

+UPDATE: Jaron Lanier writes us that he's received a lot of negative feedback from people who he thinks may not have actually read his original essay: +
+In the essay i criticized the desire (that has only recently become influential) to create an "oracle effect" out of anonymity on the internet - that's the thing i identified as being a new type of collectivism, but i did not make that accusation against the wikipedia - or against social cooperation on the net, which is something i was an early true believer in- if i remember those weird days well, i think i even made up some of the rhetoric and terminology that is still associated with net advocacy today- anyway, i specifically exempted many internet gatherings from my criticism, including the wikipedia, boingboing, google, cool tools... and also the substance of the essay was not accusatory but constructive- the three rules i proposed for creating effective feedback links to the "hive mind" being one example.
+ +
+

posted by + David Pescovitz at + 10:07:03 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Spanish castle optical effect +

+ This has been going around for a couple of days, but I just found out about it. It's a neat optical effect -- you stare at a color negative of a photo for 30 seconds (or even just 15), then move the mouse over the photo, keeping your eyes on the black dot. The photo appears in color, until you move your eyes. Link + +
+

posted by + Mark Frauenfelder at + 08:38:10 AM + permalink + | blogs' comments + +
+

+

+ + +

+ Friday, June 9, 2006 +

+ + + +

+ EFF podcast: How we kept caching legal +

+ Danny sez, "Line Noise is the new EFF podcast (RSS or iTunes); this week's episode is a chat with EFF's IP attorney Fred von Lohmann on the background to the Section 115 Reform Act (previously on Boing Boing. He explains how a good bill was used to sneak in bad precedents - including the insane idea that all temporarily cached copies on the Net and in RAM should be copyrightable and subject to licensing. +

+"Good news on that, by the way -- thanks to your calls and comments, the committee have slowed the pace of this fast-track bill, and are now working to fix the bill's language. Everyone from the Copyright Office to Radio Shack and BellSouth have now commented on the problems, so there's an excellent chance of a clear resolution." + +Link + +
+

posted by + Cory Doctorow at + 11:55:41 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Why do these people have characters on their foreheads? +

+ Nick of Square America invites you to solve a mystery. + +
 Blogger 5842 2554 1600 F2 I got this lot of slides about three years ago and I've never been able to figure out just what is going on. There are about 50 slides in all- all dating from between 1959 and 1969 and all of young women. Some, like the ones here have letters written on their foreheads, others have press type with their names on it affixed to either their temples or foreheads. Were the slides taken by a dermatologist or plastic surgeon or were these young women part of some now forgotten experiment.
Link + + +
+

posted by + Mark Frauenfelder at + 03:28:19 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Trailer for 2007 Disney Pixar movie: Ratatouille +

+ +Picture 2-9 +Apple has the trailer for the next Disney Pixar movie coming out in 2007. It's called Ratatouille and it appears to be about a Parisian rat (without a phony French accent) who, unlike other rats in his family, insists on eating only the finest food served in Paris' best restaurants. + +

The quality of the video is really nice. Don't you wish YouTube looked half as nice as this? Link + +
+

posted by + Mark Frauenfelder at + 02:48:18 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ More great old illustrations from BilbiOdyssey +

+ + Blogger 1717 1584 1600 Begnino-Bossi-1771-Petitot + Blogger 1717 1584 1600 Heemskerck-.-Lyons
+ +Why are so many drawings from earlier centuries so deliciously weird? Here are a couple I came across on one of my favorite blogs, BibliOdyssey. Link + +
+

posted by + Mark Frauenfelder at + 02:28:39 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Play the World Cup with a stream of urine +

+ +200606091411Funny photo of a urinal with a small ball and goal in it. Link + +
+

posted by + Mark Frauenfelder at + 02:12:35 PM + permalink + | blogs' comments + +
+

+

+ + + + + +

+ Wired News tells how to watch FIFA World Cup for free online +

+ Worldcup-1 A while back, law firm Baker & McKenzie sent Boing Boing a snippy letter warning us not to do something we wouldn't do even if they begged us -- broadcast live streams of the FIFA World Cup. + +

I wonder if Baker & McKenzie will send Wired News a letter complaining that Wired News is facilitating piracy for explaining a variety of ways in which FIFA World Cup fans can enjoy live video streams of the tournament on their computers without paying the rightsholder, Infront Sports & Media? + + Link

(Image courtesy groovehouse of The Grooveblog.) + +
+

posted by + Mark Frauenfelder at + 02:01:40 PM + permalink + | blogs' comments + +
+

+

+ + + +Archives +
+ +
+ +
+
+ + \ No newline at end of file diff --git a/vendor/gems/hpricot-0.6/test/files/cy0.html b/vendor/gems/hpricot-0.6/test/files/cy0.html new file mode 100644 index 0000000..5f79961 --- /dev/null +++ b/vendor/gems/hpricot-0.6/test/files/cy0.html @@ -0,0 +1,3653 @@ + + + + #41: 1cy0.html on Hpricot + + + + + + +
+ + + + +
+ + + + + + +
+ + +

Ticket #41: 1cy0.html

+ + + + +
+ File 1cy0.html, 63.9 kB + (added by alexgutteridge, 1 month ago) +

+html +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Line 
1
2
3
4
5<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
6<html lang="en">
7        <head>
8<link rel="alternate" type="application/rss+xml" title="RCSB PDB - Latest Released Structures" href="/pdb/rss/LastLoad">       
9                <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
10                <title>RCSB PDB : Structure Explorer</title>
11                <link rel="shortcut icon" href="/pdbstatic/images/pdb.ico" type="image/x-icon">
12                <link rel="stylesheet" href="/pdb/skins/pastel/styles/pdbcomp.css" type="text/css">
13                 
14                <!-- please read /pdbstatic/common/lib/comp.js.README if you need to modify some javascript for the site -->
15                <script type="text/javascript" language="JavaScript" src="/pdbstatic/common/lib/comp.js"></script>
16                <script type="text/javascript" language="JavaScript" src="/pdbstatic/common/lib/expandable.js"></script>
17                <script type="text/javascript" language="JavaScript" src="/pdbstatic/common/lib/results.js"></script>
18                <script type="text/javascript" language="JavaScript" src="/pdbstatic/common/lib/pdbajax.js"></script>
19                <script type="text/javascript" language="JavaScript" src="/pdbstatic/common/lib/htmlhttprequest_commented.js"></script>
20                 
21                 
22               
23
24
25
26
27
28
29
30
31
32<script type="text/javascript" language="JavaScript">
33
34var resultSorts = new Array();
35
36function openWindow(url){
37      var w = window.open ("", "win", "height=600,width=800,location,menubar,resizable,scrollbars,status,toolbar");
38                w.location.href = url;
39                w.focus();
40}
41function openWindowToSize(url,width,height){
42      var w = window.open ("", "win", "height="+height+",width="+width+",left=80,top=100,location,menubar,resizable,scrollbars,status,toolbar");
43                w.location.href = url;
44                w.focus();
45}
46
47// due to the poor way that the treeview code generates the fullLink, we need to have
48// our openWindowFromNav method use numbers to reference a site if the href has any quotes
49var roboloc = '/robohelp/';
50navsites = [
51                        "http://deposit.rcsb.org",
52                        "http://sg.pdb.org",
53                        "http://targetdb.pdb.org",
54                        "http://function.rcsb.org:8080/pdb/function_distribution/index.html",
55                        "http://mmcif.pdb.org",
56                        "http://pdbml.rcsb.org",
57                        "http://sw-tools.pdb.org",
58                        "http://deposit.pdb.org/cc_dict_tut.html",
59                        "http://pepcdb.pdb.org/"
60                       
61                    ];
62helpsites = [
63            "data_deposition_and_processing/how_to_deposit.htm",
64            "validation_server/how_to_validate.htm",
65            "data_download/how_to_download.htm",
66            "search_database/how_to_search.htm",
67            "browse_database/how_to_browse.htm",
68            "molecular_viewers/introduction_to_molecular_viewers.htm",
69            "files_formats/structures/chemical_component_format/chemical_component_introduction.htm",
70            "data_download/structure_download.htm", // 7
71            "data_download/ftp_services.htm", // 8
72            "data_download/theoretical_models.htm", //9
73            "data_download/cd_rom_dvd.htm", //10
74            "structuralgenomics/sg_home.htm",
75            "structuralgenomics/targetdb.htm",
76            "structuralgenomics/pepcdb.htm",
77            "structuralgenomics/function_distributions.htm", // 14
78            "files_formats/intro_dictionaries_file_formats.htm", //15
79            "software/tools/deposition_mmcif_tools.htm", //16
80            "data_deposition_and_processing/how_to_deposit.htm", //17
81            "data_deposition_and_processing/deposition_tools_at_a_glance.htm", //18
82            "site_navigation/citing_the_pdb.htm" //19
83                    ];
84navalerts = [
85                        "Discussion Forums are not yet active.  Please check back later."
86                    ];
87function openWindowFromNav(urltype, urlnumber)
88{
89        if (urltype == 0) // new windows
90        {
91//              window.open (navsites[urlnumber], "win", "height=600,width=800,location,menubar,resizable,scrollbars,status,toolbar");
92openWindow(navsites[urlnumber]);
93        }
94        else if (urltype == 1) // robo window
95        {
96                callHelp(roboloc, helpsites[urlnumber]);
97        }
98        else if (urltype == 2) // javascript alerts
99        {
100                alert(navalerts[urlnumber]);
101        }
102}
103
104
105// You can find instructions for this file at http://www.treeview.net
106
107//Environment variables are usually set at the top of this file.
108var ICONPATH = '/pdb/skins/pastel/images/tree/';
109USETEXTLINKS = 1;
110STARTALLOPEN = 0;
111USEFRAMES = 0;
112USEICONS = 1;
113WRAPTEXT = 0;
114PRESERVESTATE = 1;
115HIGHLIGHT=1;
116ALLOWTOPLEVELRETRACTION = 1;
117
118
119
120
121var pdbPathNames = new Object(); // associative array of links to xIDs of tree
122
123function myInsDoc(nn,folder,opt,link,iconsrc)
124{
125  //if (opt == 'S')
126  {
127    if (link.substring(0,5) == '/pdb/')
128    {
129      pdbPathNames[link] = nn;
130    }
131  }
132  var myInsDocSub = insDoc(folder,gLnk(opt, nn, link.replace(/'/g, "\\'")));
133  myInsDocSub.xID = nn;
134  if (iconsrc)
135  {
136    myInsDocSub.iconSrc = iconsrc;
137  }
138  else
139  {
140    myInsDocSub.iconSrc = ICONPATH + 'ftvsquare.gif';
141  }
142  return myInsDocSub;
143}
144
145function myInsFolder(nn,folder,link)
146{
147  if (link.substring(0,5) == '/pdb/')
148  {
149    pdbPathNames[link] = nn;
150  }
151  var myInsFldSub = insFld(folder,gFld(nn, link.replace(/'/g, "\\'")));
152  myInsFldSub.xID = nn.replace(/amp;/g, '');
153  return myInsFldSub;
154}
155
156function checkLocation()
157{
158  var pn = window.location.pathname + window.location.search;
159  for (prop in pdbPathNames)
160  {
161    if (pn.indexOf(prop) >= 0)
162    {
163          var docObj;
164          docObj = findObj(pdbPathNames[prop]);
165          docObj.forceOpeningOfAncestorFolders();
166          highlightObjLink(docObj);
167          break;
168    }
169  }
170}
171
172
173
174function addHomeTree()
175{
176
177}
178
179function addSearchTree()
180{
181
182}
183
184
185
186function addExploreTree()
187{
188
189           fSub = myInsDoc('<b>1CY0<\/b>',f,'S','/pdb/explore.do?structureId=1CY0');
190
191   fSub = myInsFolder('Download Files',f,'');
192   fSubSub = myInsDoc('PDB File',fSub,'S','/pdb/download/downloadFile.do?fileFormat=pdb&amp;compression=NO&amp;structureId=1CY0');
193   fSubSub = myInsDoc('PDB gz',fSub,'S','/pdb/files/1cy0.pdb.gz');
194   fSubSub = myInsDoc('PDB File (Header)',fSub,'S','/pdb/download/downloadFile.do?fileFormat=pdb&amp;headerOnly=YES&amp;structureId=1CY0');
195   fSubSub = myInsDoc('mmCIF File',fSub,'S','/pdb/download/downloadFile.do?fileFormat=cif&amp;compression=NO&amp;structureId=1CY0');
196   fSubSub = myInsDoc('mmCIF gz',fSub,'S','/pdb/files/1cy0.cif.gz');
197   fSubSub = myInsDoc('mmCIF File (Header)',fSub,'S','/pdb/download/downloadFile.do?fileFormat=cif&amp;headerOnly=YES&amp;structureId=1CY0');
198   fSubSub = myInsDoc('PDBML/XML File',fSub,'S','/pdb/download/downloadFile.do?fileFormat=xml&amp;compression=NO&amp;structureId=1CY0');
199   fSubSub = myInsDoc('PDBML/XML gz',fSub,'S','/pdb/files/1cy0.xml.gz');
200   fSubSub = myInsDoc('PDBML/XML File (Header)',fSub,'S','/pdb/download/downloadFile.do?fileFormat=xml&amp;headerOnly=YES&amp;structureId=1CY0');
201
202       
203               fSubSub = myInsDoc('Biological Unit Coordinates',fSub,'S','/pdb/files/1cy0.pdb1.gz');
204       
205           fSub = myInsDoc('FASTA Sequence',f,'S','/pdb/download/downloadFile.do?fileFormat=FASTA&amp;compression=NO&amp;structureId=1CY0');
206
207   fSub = myInsFolder('Display Files',f,'');
208
209           fSubSub = myInsDoc('Custom Structure Summary',fSub,'S','/pdb/explore/customStructureReportForm.do?exptype=misc');
210
211   fSubSub = myInsDoc('PDB File',fSub,'B','/pdb/files/1cy0.pdb');
212   fSubSub = myInsDoc('PDB File (Header)',fSub,'B','/pdb/files/1cy0.pdb?headerOnly=YES');
213   fSubSub = myInsDoc('mmCIF File',fSub,'B','/pdb/files/1cy0.cif');
214   fSubSub = myInsDoc('mmCIF File (Header)',fSub,'B','/pdb/files/1cy0.cif?headerOnly=YES');
215   fSubSub = myInsDoc('PDBML/XML File',fSub,'B','/pdb/files/1cy0.xml');
216   fSubSub = myInsDoc('PDBML/XML (Header)',fSub,'B','/pdb/files/1cy0.xml?headerOnly=YES');
217
218           fSub = myInsFolder('Display Molecule',f,'');
219           fSubSub = myInsDoc('Image Gallery',fSub,'S','/pdb/explore/images.do?structureId=1CY0');
220           fSubSub = myInsDoc('KiNG Viewer',fSub,'S','/pdb/static.do?p=explorer/viewers/king.jsp');
221           fSubSub = myInsDoc('Jmol Viewer',fSub,'S','/pdb/static.do?p=explorer/viewers/jmol.jsp');
222           fSubSub = myInsDoc('WebMol Viewer',fSub,'S','/pdb/static.do?p=explorer/viewers/webmol.jsp');
223           fSubSub = myInsDoc('Protein Workshop',fSub,'S','/pdb/Viewers/ProteinWorkshop/protein_workshop_launch.jsp');
224           fSubSub = myInsDoc('Rasmol Viewer <br>(<b>Plugin required</b>)',fSub,'B','/pdb/download/downloadFile.do?fileFormat=PDB&amp;display=rasmol&amp;compression=NO&amp;structureId=1CY0');
225           fSubSub = myInsDoc('Swiss-PDB Viewer <br>(<b>Plugin required</b>)',fSub,'B','/pdb/download/downloadFile.do?fileFormat=PDB&amp;display=spdbv&amp;compression=NO&amp;structureId=1CY0');
226           fSubSub = myInsDoc('KiNG Help',fSub,'S','javascript:callHelp(roboLoc,\'viewers/king.htm\');',ICONPATH + 'question.gif');
227           fSubSub = myInsDoc('Jmol Help',fSub,'S','javascript:callHelp(roboLoc,\'viewers/jmol.htm\');',ICONPATH + 'question.gif');
228           fSubSub = myInsDoc('WebMol Help',fSub,'S','javascript:callHelp(roboLoc,\'viewers/webmol.htm\');',ICONPATH + 'question.gif');
229           fSubSub = myInsDoc('Protein Workshop Help',fSub,'S','javascript:callHelp(roboLoc,\'viewers/proteinworkshop.htm\');',ICONPATH + 'question.gif');
230           fSubSub = myInsDoc('QuickPDB',fSub,'S','javascript:callHelp(roboLoc,\'viewers/thequickpdb.htm\');',ICONPATH + 'question.gif');
231           
232           
233             fSubSub = myInsDoc('Asymmetric Unit /<br> Biological Molecule',fSub,'S','/pdb/static.do?p=explorer/singleimage.jsp&amp;structureId=1cy0&amp;type=asym&amp;size=500');
234           
235           fSub = myInsDoc('<b>Structural Reports</b> ',f,'S','/pdb/explore/biologyAndChemistry.do');
236           fSub = myInsDoc('<b>External Links</b> ',f,'S','/pdb/explore/externalReferences.do');
237           
238           fSub = myInsFolder('Structure Analysis ',f,'');
239           fSubSub = myInsFolder('Geometry ',fSub,'');     
240           
241           
242             fSubSubSub = myInsDoc('RCSB Graphics',fSubSub,'S','/pdb/explore/geometryGraph.do?structureId=1CY0');
243             fSubSubSub = myInsDoc('RCSB Tables',fSubSub,'S','/pdb/explore/geometryDisplay.do');
244           
245             fSubSubSub = myInsDoc('MolProbity Ramachandran Plot',fSubSub,'B','/pdb/images/1CY0_ram_m_500.pdf');
246
247                 
248                                        fSubSub = myInsFolder('Sequence Variants  ',fSub,'');
249                 
250                                                fSubSubSub = myInsDoc('TOP1_ECOLI Variants',fSubSub,'S','/pdb/search/smartSubquery.do?structureId=1CY0&variant=1&smartSearchSubtype=StructureVariantQuery&spId=TOP1_ECOLI');
251                 
252                                                fSubSubSub = myInsDoc('TOP1_ECOLI Non-Variants',fSubSub,'S','/pdb/search/smartSubquery.do?structureId=1CY0&variant=0&smartSearchSubtype=StructureVariantQuery&spId=TOP1_ECOLI');
253                   
254           fSub = myInsFolder('Help ',f,'');
255           fSubSub = myInsDoc('Structure Explorer Intro',fSub,'S','javascript:callHelp(roboLoc,\'structure_explorer/introduction_to_structure_explorer.htm\');',ICONPATH + 'question.gif');
256           fSubSub = myInsDoc('Molecular Viewers',fSub,'S','javascript:callHelp(roboLoc,\'molecular_viewers/introduction_to_molecular_viewers.htm\');',ICONPATH + 'question.gif');
257           fSubSub = myInsDoc('Structure Summary',fSub,'S','javascript:callHelp(roboLoc,\'structure_explorer/summary_information.htm\');',ICONPATH + 'question.gif');
258           fSubSub = myInsDoc('Biological Molecule',fSub,'S','javascript:callHelp(roboLoc,\'data_download/biological_unit/biological_unit_introduction.htm\');',ICONPATH + 'question.gif');
259           fSubSub = myInsDoc('Biology &amp; Chemistry',fSub,'S','javascript:callHelp(roboLoc,\'quick_links/quick_links_biology_and_chemistry.htm\');',ICONPATH + 'question.gif');
260           fSubSub = myInsDoc('Sequence Details',fSub,'S','javascript:callHelp(roboLoc,\'quick_links/quick_links_sequence_details.htm\');',ICONPATH + 'question.gif');
261           fSubSub = myInsDoc('Structural Features',fSub,'S','javascript:callHelp(roboLoc,\'quick_links/quick_links.structural_features.htm\');',ICONPATH + 'question.gif');
262           fSubSub = myInsDoc('Materials &amp; Methods (X-Ray)',fSub,'S','javascript:callHelp(roboLoc,\'quick_links/materials_and_methods/x-ray_materials_and_methods.htm\');',ICONPATH + 'question.gif');
263           fSubSub = myInsDoc('Materials &amp; Methods (NMR)',fSub,'S','javascript:callHelp(roboLoc,\'quick_links/materials_and_methods/nmr_materials_and_methods.htm\');',ICONPATH + 'question.gif');
264       
265
266}
267
268function addReportTree()
269{
270
271  fSub = myInsDoc('<b>Show Query Details<\/b>',f,'S','/pdb/static.do?p=results/queryDesc.jsp');
272  fSub = myInsDoc('Results Help',f,'S','javascript:callHelp(\'/robohelp/\',\'query_results_browser/introduction_to_results_browser.htm\');',ICONPATH + 'question.gif'); 
273 
274}
275
276function addQueriesTree()
277{
278   fSub = myInsDoc('Clear queries',f,'S','/pdb/queries/clearqueries.do');
279}
280
281</script>
282
283                <script type="text/javascript" language="JavaScript">
284                  var roboLoc = "/robohelp/";
285                </script>
286        </head>
287
288  <body bgcolor="#ffffff" style="margin:10px 10px 10px 10px;" onload="liveSearchInit();pdbBodyLoadInit();">
289
290
291<!-- Universal retriever iFrame - for debugging it's a good idea to make the height 60 or so and frameborder set to one -->
292<iframe src="/pdb/browse/menu_empty.html" name="retriever" id="retriever" width="100%" height="1" frameborder="0">
293  <!-- This Page requires a modern browser supporting IFRAMES or ILAYERS --><p>&nbsp;</p>
294</iframe>
295
296<!-- MAIN TABLE -->
297<table border="0" cellpadding="0" cellspacing="0" align="center" ><!-- for debugging use border -->
298<tbody>
299
300 <tr>
301  <td colspan="3">   
302
303 
304
305
306
307
308<script language="Javascript" type="text/javascript">
309function checkSequenceLength()
310{
311if ((document.headerQueryForm.inputQuickSearch.value.substr(0,9) == 'sequence:')&&(document.headerQueryForm.inputQuickSearch.value.length < 15))
312{
313        alert('Sequence searches must be at least 6 characters long');
314        return false;
315}
316else
317        return liveSearchSubmit();
318       
319}
320
321</script>
322<form action="/pdb/search/navbarsearch.do" onSubmit="return checkSequenceLength();" method="get" name="headerQueryForm">   
323   <table border="0" cellpadding="0" cellspacing="0" width="100%">   
324    <tr>
325     <td width="210"><a href="/pdb"><img alt="RCSB PDB Protein Data Bank | Home" title="RCSB PDB Protein Data Bank | Home" src="/pdb/skins/pastel/images/header/pdblogo.gif" width="198" border="0"></a></td>
326     <td align="right" class="headertop" colspan="2">
327      <a href="http://www.wwpdb.org/" target="_blank"><img alt="A Member of the wwPDB" title="A Member of the wwPDB" src="/pdb/skins/pastel/images/header/wwpdb.gif" width="191" height="15" border="0"></a><br/>
328      An Information Portal to Biological Macromolecular Structures
329      <br/>
330      <span class="body">
331        As of <a href="/pdb/search/smartSubquery.do?smartSearchSubtype=LastLoadQuery">Tuesday Dec 26, 2006</a>&nbsp;<a href="/pdb/rss/LastLoad" title="RSS Feed for the Latest Released Structures"><img alt="RSS Feed for the Latest Released Structures" border="0" src="/pdbstatic/images/feed-icon16x16.png"></a>
332        there are 40870 Structures
333        <a href="javascript:callHelp(roboLoc, 'search_database/latest_release/introduction_to_latest_release.htm');"><img alt="&nbsp;&nbsp;? " title="&nbsp;&nbsp;? " src="/pdb/skins/pastel/images/tree/question.gif" border="0" style="vertical-align:middle;"></a>
334        &nbsp;|&nbsp;
335        <a href="/pdb/static.do?p=general_information/pdb_statistics/index.html&amp">PDB Statistics</a><a href="javascript:callHelp(roboLoc, 'web_site/pdb_statistics.htm');"><img alt="&nbsp;&nbsp;? " title="&nbsp;&nbsp;? " src="/pdb/skins/pastel/images/tree/question.gif" border="0" style="vertical-align:middle;"></a>
336      </span>
337     </td>
338    </tr>
339
340    <tr>
341     <td style="vertical-align:top;padding-top:0.2em;">
342      <a href="/pdb/static.do?p=general_information/about_pdb/contact/index.html" class="tabblutxt">Contact Us</a> |
343      <a href="javascript:callHelp(roboLoc,'site_navigation/introduction_to_site_navigation.htm');" class="tabblutxt">Help</a> |
344      <a href="javascript:printPage('http://www.rcsb.org/pdb/explore/explore.do?structureId=1CY0');" class="tabblutxt">Print Page</a>
345     </td>
346     <td style="background-image:url('/pdb/skins/pastel/images/header/header_bg2.jpg');background-repeat: repeat-x;vertical-align:top;background-position: 0% 100%;" width="37" rowspan="2"><img src="/pdbstatic/images/spacer.gif" alt="" width="37" height="35" border="0"></td>
347
348
349     <td nowrap style="background-image:url('/pdb/skins/pastel/images/header/header_bg3.jpg');background-repeat: repeat-x;background-color:#3333FF;background-position: 0% 100%;padding-right:2px;" class="topnavlinks" rowspan="2">
350
351        <table>
352                <tr>
353                        <td nowrap class="topnavlinks">
354                                <input type="hidden" name="newSearch" value="yes">
355                                <input type="hidden" name="isAuthorSearch" value="no"  >
356                                <input type="radio" name="radioset" value="All"  checked  class="radio" onclick="javascript:document.headerQueryForm.isAuthorSearch.value='no';">PDB ID or keyword
357                                <input type="radio" name="radioset" value="Authors"  class="radio" onclick="javascript:if(this.checked){document.headerQueryForm.isAuthorSearch.value='yes';}">Author
358                        </td>
359                        <td class="topnavlinks" nowrap>
360                                <input type="text"  class="input" size="10" name="inputQuickSearch" id="livesearch" onkeypress="liveSearchStart()" onblur="setTimeout('closeResults()',10000);" >
361                                <div id="LSResult" style="display: none;"><div id="LSShadow"></div></div>
362                        </td>
363                        <td class="topnavlinks" nowrap>
364                        <input type="image" src="/pdb/skins/pastel/images/header/header_search.gif" size="61" value="Search" class="text" align="middle" name="image" alt="Search" title="Search">
365                    <a href="javascript:callHelp(roboLoc, 'search_database/top_bar_search/top_bar_search.htm');"><img alt="&nbsp;&nbsp;? " title="&nbsp;&nbsp;? " src="/pdb/skins/pastel/images/header/mainquestion.gif" border="0" style="vertical-align:middle;"></a>
366                                        | <a href="/pdb/search/advSearch.do" class="textwhite">Advanced Search</a>   
367                        </td>
368                </tr>
369        </table>         
370
371     </td>
372    </tr>
373 
374    <tr>
375     <td style="background-image:url('/pdb/skins/pastel/images/header/header_bg1.jpg');text-align:left;background-repeat: repeat-x;vertical-align:top;background-position: 0% 100%;"><img src="/pdbstatic/images/spacer.gif" alt="" width="37" height="13" border="0"></td>
376    </tr>     
377   </table>
378</form> 
379
380
381
382
383
384
385
386
387  </td>
388 </tr>
389
390 <tr valign="top">
391  <td  class="navbackground" style="width:230px;">
392
393 
394
395
396
397
398
399               
400               
401   <table border="0" cellpadding="0" cellspacing="0">
402    <tr>
403     <td class="navbackground">
404                <div id="hdrtab">
405                  <ul>
406                    <li><a href="/pdb/Welcome.do">Home</a></li>
407                    <li><a href="/pdb/static.do?p=search/index.html">Search</a></li>
408                   
409                    <li id="current"><a>Structure</a></li>
410                   
411                  </ul>
412                </div>
413          </td>
414    </tr>
415    <tr>
416     <td class="navbackground">
417                <a style="font-size:1pt;text-decoration:none;color:#FFFF99" href="http://www.treemenu.net/" target=_blank></a>
418                <span class="TreeviewSpanArea">
419                <script type="text/javascript" language="JavaScript">
420                        foldersTree = gFld('', '');
421                        foldersTree.treeID = 'ExploreRoot';
422                        foldersTree.xID = foldersTree.treeID;
423                        f = foldersTree;
424                        addExploreTree();
425                        initializeDocument();
426                        checkLocation();
427                </script>
428
429                </span>
430      </td>
431    </tr>
432    <tr>
433     <td class="homewhite" height="1"><img src="/pdbstatic/images/spacer.gif" alt="" width="1" height="1" border="0"></td>
434    </tr>
435   </table>
436
437
438
439
440
441  </td>
442
443  <td valign="top" style="vertical-align:top;">  <!-- BEGIN MAIN RIGHT -->
444  <table border="0" cellpadding="0" cellspacing="0">
445   <tr>
446     <td valign="top" class="maintd">
447        <noscript><div style="padding-left:8px;font-weight:bold;color:#FF0000;font-size:16px">This browser is either not Javascript enabled or has it turned off.<br />This site will not function correctly without Javascript.</div></noscript>
448         
449       
450
451
452
453
454
455
456
457<div id="hdrtab">
458                  <ul>
459
460                           <li><a href="/pdb/explore.do?structureId=1CY0">Structure Summary</a></li>
461                           
462                           <li><a href="/pdb/explore/biologyAndChemistry.do?structureId=1CY0">Biology & Chemistry</a></li>
463                           
464                           <li><a href="/pdb/explore/materialsAndMethods.do?structureId=1CY0">Materials & Methods</a></li>
465                           
466                           <li><a href="/pdb/explore/sequence.do?structureId=1CY0">Sequence Details</a></li>
467                           
468                           <li><a href="/pdb/explore/geometryDisplay.do?structureId=1CY0">Geometry</a></li>
469                           
470                  </ul>
471                </div>
472     </td>
473   </tr>
474
475   <tr>
476    <td>
477     <font color="RED"><b>LIMITED FUNCTIONALITY BROWSER</b></font>
478     <br />
479     <span class="static_header">
480       You are currently using a browser that is not fully compatible with this website.<br />
481       If you would like to have full functionality, please upgrade your browser. <br />
482       
483                                                                       
484        <a href="/pdb/static.do?p=home/faq.html#goodBrowsers">List of Supported & Unsupported Browsers for the RCSB Protein Data Bank Web Site</a> <br />
485
486       <br />
487     </span>
488    </td>
489   </tr>
490
491   <tr>
492    <td valign="top" class="maintd" style="padding-left:10px;">
493
494
495 
496
497
498
499 
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535<!---->
536
537
538
539
540
541<script type="text/javascript" language="JavaScript">
542        
543                function searchCitationAuthor(author, primary)
544                {
545                                document.queryCitationAuthorForm.elements['citation_author.name.value'].value = author;
546                                document.queryCitationAuthorForm.elements['citation_author.name.comparator'].value = "equals";
547                                if (primary)
548                                        document.queryCitationAuthorForm.elements['citation_author.citation_id.value'].value="primary";
549                                document.queryCitationAuthorForm.submit();
550                }
551
552                function searchStructureAuthor(author)
553                {
554                                document.queryStructureAuthorForm.elements['authName'].value = author;
555                                document.queryStructureAuthorForm.submit();
556                }
557               
558                function searchPdbxKeyword(keyword)
559                {
560                  document.queryKeywordsForm.elements['struct_keywords.pdbx_keywords.value'].value = keyword;
561                  document.queryKeywordsForm.submit();
562                }
563               
564                function searchLigand(id)
565                {
566                                document.ligandQueryForm.elements['chem_comp.id.value'].value = id;
567                                document.ligandQueryForm.elements['chem_comp.id.comparator'].value = "=";
568                                document.ligandQueryForm.submit();
569                }
570                function searchEc(ec)
571                {
572                                document.ecQueryForm.elements['entity.pdbx_ec.value'].value = ec;
573                                document.ecQueryForm.elements['entity.pdbx_ec.comparator'].value = "=";
574                                document.ecQueryForm.submit();
575                }
576                function searchSpaceGroup(sg)
577                {
578                        document.sgQueryForm.elements['symmetry.space_group_name_H-M.value'].value = sg;
579                        document.sgQueryForm.elements['symmetry.space_group_name_H-M.comparator'].value = "=";
580                        document.sgQueryForm.submit();
581                }
582               
583                function searchSource(natSci, natCommon, genSci, genCommon)
584                {
585                        document.srcQueryForm.elements['entity_src_nat.pdbx_organism_scientific.value'].value = natSci;
586                        document.srcQueryForm.elements['entity_src_nat.common_name.value'].value = natCommon;
587                        document.srcQueryForm.elements['entity_src_gen.pdbx_gene_src_scientific_name.value'].value = genSci;
588                        document.srcQueryForm.elements['entity_src_gen.gene_src_common_name.value'].value = genCommon;
589                        document.srcQueryForm.submit();
590                }
591               
592        </script>
593                                       
594
595
596
597<script type="text/javascript" language="JavaScript">
598
599        function queryByExample(s, t)
600        {
601        }
602        function FW_startTimeout()
603        {
604        }
605        function removeHighlight()
606        {
607        }
608
609</script>
610
611        <table cellpadding="2" cellspacing="2" border="0" style="text-align: left; width: 100%;">
612          <tbody>
613                <tr>
614                  <td style="vertical-align: top;">
615                         <table cellpadding="5" cellspacing="2" border="0" style="text-align: left; width: 100%;">
616                           <tbody>
617                                 <tr>
618                                   <td>
619                <!--div id="hdrtab">
620                  <ul>
621                    <li id="current"><a href="#">Structure Summary</a></li>
622                    <li><a href="/pdb/explore/biologyAndChemistry.do">Biology & Chemistry</a></li>
623                    <li><a href="/pdb/explore/materialsAndMethods.do">Materials & Methods</a></li>
624                    <li><a href="/pdb/explore/sequence.do">Sequence Details</a></li>
625                    <li><a href="/pdb/explore/geometryDisplay.do">Geometry</a></li>
626                  </ul>
627                </div-->
628    </td>
629                                   <td style="text-align: right;">
630       
631                                       
632
633
634                                                <span class="se_pagetitle">1CY0&nbsp;</span>
635                                                <a href="/pdb/files/1cy0.pdb" title="Display PDB file" target="_blank"><img src="/pdbstatic/images/summary.jpg" alt="Display PDB file" border='0'></a>
636
637                                   </td>
638                                 </tr>
639                           </tbody>
640                         </table>
641                         <table cellpadding="5" cellspacing="5" border="0"  style="text-align: left; width: 100%;">
642                          <tbody>
643                                <tr class="se_back1">
644                                        <td width="15%" align="right" valign="top" class="se_item">
645                                                Title
646                                        </td>
647                                        <td width="85%" valign="top" class="se_datalarge1">
648                                                       
649                                                        COMPLEX OF E.COLI DNA TOPOISOMERASE I WITH 3'-5'-ADENOSINE DIPHOSPHATE
650                                                       
651                                                        <img src="/pdbstatic/explorer/images/spacer.gif" alt="" name="StructureTitle">
652                                        </td>
653                                </tr>
654                                <tr class="se_back2">
655                                        <td width="15%" align="right" class="se_item">
656                                                Authors
657                                        </td>
658                                        <td width="85%" >
659                                         <form action="/pdb/search/smartSubquery.do" method="get" name="queryStructureAuthorForm">
660                                                 <input type="hidden" name="authName" value="">
661                                                 <input type="hidden" name="smartSearchSubtype" value="AuthorQuery">
662                                                 <input type="hidden" name="display" value="true">
663                                                  <a class="seAuthors" onmouseover="this.className='seAuthorsHover';" onmouseout="this.className='seAuthors';" onclick="searchStructureAuthor('Feinberg, H.');">Feinberg, H.</a>,&nbsp;&nbsp;<a class="seAuthors" onmouseover="this.className='seAuthorsHover';" onmouseout="this.className='seAuthors';" onclick="searchStructureAuthor('Changela, A.');">Changela, A.</a>,&nbsp;&nbsp;<a class="seAuthors" onmouseover="this.className='seAuthorsHover';" onmouseout="this.className='seAuthors';" onclick="searchStructureAuthor('Mondragon, A.');">Mondragon, A.</a>
664                                                <img src="/pdbstatic/explorer/images/spacer.gif" alt="" name="StructureExperimentAuthors">
665                                        </form>
666                                        </td>
667                                </tr>
668                                <tr class="se_back1">
669                                        <td width="15%" align="right" class="se_item">
670                                         <form action="/pdb/search/smartSubquery.do" method="get" name="queryCitationAuthorForm">
671                                                 <input type="hidden" name="citation_author.name.value" value="">
672                                                 <input type="hidden" name="citation_author.name.comparator" value="contains">
673                                                 <input type="hidden" name="citation_author.citation_id.value" value="">
674                                                 <input type="hidden" name="smartSearchSubtype" value="CitationAuthorQuery">
675                                                 <input type="hidden" name="display" value="true">
676                                        </form>
677                                                Primary Citation&nbsp;&nbsp;
678                                        </td>
679                                        <td width="85%" class="se_datasmall1">
680                                                <a class="sePrimarycitations" onmouseover="this.className='sePrimarycitationsHover';" onmouseout="this.className='sePrimarycitations';" onclick="searchCitationAuthor('Feinberg, H.', true);">Feinberg, H.</a>,&nbsp;&nbsp;<a class="sePrimarycitations" onmouseover="this.className='sePrimarycitationsHover';" onmouseout="this.className='sePrimarycitations';" onclick="searchCitationAuthor('Changela, A.', true);">Changela, A.</a>,&nbsp;&nbsp;<a class="sePrimarycitations" onmouseover="this.className='sePrimarycitationsHover';" onmouseout="this.className='sePrimarycitations';" onclick="searchCitationAuthor('Mondragon, A.', true);">Mondragon, A.</a>
681                                                <img src="/pdbstatic/explorer/images/spacer.gif" alt="" name="CitationArticleAuthors">
682                                               
683                                                Protein-nucleotide interactions in E. coli DNA topoisomerase I.
684                                               
685                                                <img src="/pdbstatic/explorer/images/spacer.gif" alt="" name="CitationArticleTitle">
686                                               
687                                                <span class="se_journal">Nat.Struct.Biol.</span>
688                                               
689
690                                                <img src="/pdbstatic/explorer/images/spacer.gif" alt="" name="CitationJournalName">
691                                               
692                                                <span class="se_journal">v6</span>
693                                               
694                                                <img src="/pdbstatic/explorer/images/spacer.gif" alt="" name="CitationJournalVolume">
695                                               
696                                                <span class="se_journal">pp.961-968</span>
697                                               
698                                                ,
699                                                        <span class="se_journal">1999</span>
700                                               
701
702                                                <img src="/pdbstatic/explorer/images/spacer.gif" alt="" name="CitationJournalYear">
703                                                       
704                                               
705                                                <br>
706                                                [&nbsp;<a class="se_datalarge" href="/pdb/explore/pubmed.do?structureId=1CY0" name="Abstract" ALT="View Searchable PubMed Abstract" TITLE="View Searchable PubMed Abstract">Abstract</a>&nbsp;]&nbsp;&nbsp;&nbsp;
707                                <a class="se_datalarge" href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&amp;db=PubMed&amp;dopt=Abstract&amp;list_uids=10504732" target="resource_window">
708                                        <img src="/pdbstatic/explorer/images/abstract_icon.gif" BORDER="0" ALT="View PubMed Abstract at NCBI" TITLE="View PubMed Abstract at NCBI">
709                                               
710                                        </td>
711                                </tr>
712                                <tr class="se_back2">
713                                        <td width="15%" align="right" class="se_item">
714                                                History
715                                        </td>
716                                        <td width="85%" class="se_datalarge2">
717                                                <span class="se_subitem">Deposition&nbsp;&nbsp;</span>
718                                                1999-08-31
719                                                <img src="/pdbstatic/explorer/images/spacer.gif" alt="" name="DepositionDate">
720                                                       
721                                                <span class="se_subitem">&nbsp;Release&nbsp;</span>
722                                                2000-03-08
723                                                <img src="/pdbstatic/explorer/images/spacer.gif" alt="" name="ReleaseDate">
724
725                                         </td>
726                                </tr>
727                                <tr class="se_back1">
728                                        <td width="15%" align="right" class="se_item">
729                                                Experimental Method
730                                        </td>
731                                        <td width="85%" class="se_datalarge1">
732                                                <span class="se_subitem">Type&nbsp;&nbsp;</span>
733                                                X-RAY DIFFRACTION
734                                                <img src="/pdbstatic/explorer/images/spacer.gif" alt="">
735                                                <span class="se_subitem">Data</span>
736
737
738                <a class="se_datasmall1">N/A</a>
739       
740
741
742                                                </td></tr>
743
744
745                <tr class="se_back2">
746                        <td width="15%" align="right" class="se_item">
747                                Parameters&nbsp;&nbsp;
748                        </td>
749                        <td width="85%" class="se_datalarge2">
750                       
751                         <form action="/pdb/search/smartSubquery.do" method="get" name="sgQueryForm">
752                                 <input type="hidden" name="smartSearchSubtype" value="SpaceGroupQuery">
753                                 <input type="hidden" name="display" value="true">
754                                <input type="hidden" name="symmetry.space_group_name_H-M.value" value="">
755                                <input type="hidden" name="symmetry.space_group_name_H-M.comparator" value="=">
756                       
757                                <table border="0" cellpadding="1" cellspacing="1" width="100%">
758                                        <tr class="se_subitem2">
759                                                <td width="20%">
760                                                        Resolution[&Aring;]
761                                                    <a href='/pdb/statistics/histogram.do?mdcat=refine&amp;mditem=ls_d_res_high&amp;minLabel=0&amp;maxLabel=5&amp;numOfbars=10'>
762                                                      <img src='/pdbstatic/images/histogram16x16.jpg' border=0 title='View a histogram of Resolution' alt='View a histogram of Resolution'>
763                                                    </a>
764                                                </td>
765                                                <td width="20%">
766                                                        R-Value
767                                                </td>
768                                                <td width="20%">
769                                                        R-Free
770                                                <td width="25%">
771                                                        Space Group
772                                                </td>
773                                        </tr>
774                                        <tr class="se_subitem2">
775                                            <td width="20%" class="se_datalarge2">
776                                                           2.45
777                                                        <img src="/pdbstatic/explorer/images/spacer.gif" alt="" name="Resolution">
778                                                </td>
779                                                <td width="20%" align="left" class="se_datalarge2">
780                                                        0.220
781                                                        (obs.)
782                                                </td>
783                                                <td width="20%" align="left" class="se_datalarge2">
784                                                        0.274
785                                                       
786                                                </td>
787                                                <td width="25%" class="se_datalarge2">
788                                                               
789                                                  <a class="se_datasmall" onclick="searchSpaceGroup('P 21 21 21');" onmouseover="this.className='se_datasmallHover'" onmouseout="this.className='se_datasmall'">
790                                                  P 2<sub>1</sub> 2<sub>1</sub> 2<sub>1</sub>
791                                                  </a>
792                                                           
793                                                        <img src="/pdbstatic/explorer/images/spacer.gif" alt="" name="SpaceGroup">
794                                                </td>
795                                   </tr>
796                        </table>
797                        </form>
798                        </td>
799                </tr>
800                <tr class="se_back1">
801                        <td width="15%" align="right" class="se_item">
802                                Unit Cell&nbsp;&nbsp;
803                        </td>
804                        <td width="85%" class="se_datalarge1" valign="top">
805                                <table border="0" cellpadding="1" cellspacing="1"  width="100%">
806                                        <tr class="se_subitem1">
807                                                <td width="20%">
808                                                        <span class="se_unitcellitem">Length [&Aring;]</span>
809                                                </td>
810                                                <td width="13%">
811                                                        a
812                                                </td>
813                                                <td width="13%" >
814                                                       
815                                                        <span class="se_datasmall1">63.04</span>
816                                                       
817                                                </td>
818                                                <td width="13%" >
819                                                        b
820                                                </td>
821                                                <td width="13%">
822                                                       
823                                                        <span class="se_datasmall1">73.31</span>
824                                                       
825                                                </td>
826                                                <td width="13%" >
827                                                        c
828                                                </td>
829                                                <td width="15%" >
830                                                       
831                                                        <span class="se_datasmall1">134.46</span>
832                                                       
833                                                </td>
834                                        </tr>
835                                        <tr class="se_subitem1">
836                                                <td width="20%">
837                                                        <span class="se_unitcellitem">Angles [&#176;]</span>
838                                                </td>
839                                                <td width="13%" >
840                                                        alpha
841                                                </td>
842                                                <td width="13%" >
843                                                       
844                                                        <span class="se_datasmall1">90.00</span>&nbsp;
845                                                       
846                                                </td>
847                                                <td width="13%">
848                                                        beta
849                                                </td>
850                                                <td width="13%" >
851                                                       
852                                                        <span class="se_datasmall1">90.00</span>&nbsp;
853                                                       
854                                                </td>
855                                                <td width="13%" >
856                                                        gamma
857                                                </td>
858                                                <td width="15%" >
859                                                       
860                                                        <span class="se_datasmall1">90.00</span>&nbsp;
861                                                       
862                                                </td>
863                                        </tr>
864                                </table>
865                        </td>
866                </tr>
867
868               
869            <tr class="se_back2">
870                        <td width="15%" align="right" valign="top" class="se_item">
871                                Molecular Description  Asymmetric Unit
872                        </td>
873                        <td width="85%" class="se_datalarge2" valign="top">
874                       
875                         <form action="/pdb/search/smartSubquery.do" method="get" name="ecQueryForm">
876                                 <input type="hidden" name="smartSearchSubtype" value="EnzymeClassificationQuery">
877                                 <input type="hidden" name="display" value="true">
878                                <input type="hidden" name="entity.pdbx_ec.value" value="">
879                                <input type="hidden" name="entity.pdbx_ec.comparator" value="=">
880
881                                <!-- %=org.pdb.util.middle.MoleculeDescription.getDescription(myStructureId)%><br-->
882
883       
884                                <span class="se_subitem"><br>Polymer:</span>&nbsp;1&nbsp;&nbsp;
885<span class="se_subitem">Molecule:</span>&nbsp;DNA TOPOISOMERASE I&nbsp;&nbsp;
886<span class="se_subitem">Fragment:</span>&nbsp;67 KDA N-TERMINAL FRAGMENT OF E.COLI TOPOISOMERASE I&nbsp;&nbsp;
887<span class="se_subitem">Chains:</span>&nbsp;A&nbsp;&nbsp;
888<span class="se_subitem">EC no.:</span>&nbsp;<a class="se_datasmall" onclick="searchEc('5.99.1.2');" onmouseover="this.className='se_datasmallHover'" onmouseout="this.className='se_datasmall'">5.99.1.2</a>&nbsp;<a class="se_datalarge" href="http://www.chem.qmul.ac.uk/iubmb/enzyme/EC5/99/1/2.html" target="resource_window"><img src="/pdbstatic/explorer/images/iubmb_icon.gif" BORDER="0" ALT="Go to IUBMB EC entry" TITLE="Go to IUBMB EC entry"></a>&nbsp;
889&nbsp;
890                        </form>                                 
891
892                       
893                                         <form action="/pdb/search/smartSubquery.do" method="get" name="queryKeywordsForm">
894                                                 <input type="hidden" name="smartSearchSubtype" value="StructureKeywordsQuery">
895                                                 <input type="hidden" name="display" value="true">
896                                                 <input type="hidden" name="struct_keywords.pdbx_keywords.value" value="">
897                                                 <input type="hidden" name="struct_keywords.pdbx_keywords.comparator" value="startswith">
898                                        </form>
899
900
901                      <img src="/pdbstatic/explorer/images/spacer.gif" alt="" name="Compound">
902                                        </td>
903                                </tr>
904                                <tr class="se_back1">
905                                        <td width="15%" align="right" valign="top" class="se_item">
906                                                Classification
907                                        </td>
908                                        <td width="40%" class="se_datalarge1">
909                                               
910                                                <span class="qrb_value">
911                                                  <a class="sePrimarycitations" onmouseover="this.className='sePrimarycitationsHover';" onmouseout="this.className='sePrimarycitations';" onclick="searchPdbxKeyword('ISOMERASE');">
912                                                    Isomerase
913                                                  </a>
914                                                </span>
915                                               
916                                                <img src="/pdbstatic/explorer/images/spacer.gif" alt="" name="StructureSummary">
917
918                                        </td>
919                                </tr>
920                        </tbody>
921                  </table>
922                  </td>
923                  <td style="vertical-align: top; text-align: right; width: 250px;">
924                               
925
926
927
928
929
930
931
932
933
934
935<script type="text/javascript" language="JavaScript">
936        
937        var isImage = "bio";
938        function switchStructureImage()
939        {
940                if (isImage == "bio") {
941                        document.switchImageForm.structureImageButton.value = "Asymmetric Unit";
942                        document.switchImageForm.structureImage.src = '/pdb/images/1cy0_asym_r_250.jpg';
943                        isImage = "asym";
944                }
945                else {
946                        document.switchImageForm.structureImageButton.value = "Biological Molecule";
947                        //structureImageText.innerText = "Biological Molecule";
948                        document.switchImageForm.structureImage.src = '/pdb/images/1cy0_bio_r_250.jpg';
949                        isImage = "bio";
950                }
951        }
952</script>
953
954
955
956<form name="switchImageForm" action="">
957
958
959<table border="0" cellpadding="0" cellspacing="0" width="256">
960        <tr class="homedark">
961                <td class="putih4">&nbsp;Images and Visualization</td>
962                <td align="right" valign="top"><img
963                        src="/pdbstatic/home/tablecorner.gif" alt="" border="0"></td>
964        </tr>
965        <tr>
966                <td colspan="2">
967                <table border="0" cellpadding="1" cellspacing="0" width="100%"
968                        class="homedark">
969                        <tr>
970                                <td>
971                                <table border="0" cellpadding="1" cellspacing="0" width="100%"
972                                        class="homewhite">
973
974
975
976
977                                        <!--table border="0" width="250" align="right" bgcolor="#9999cc"-->
978                                       
979                                        <tr>
980                                                <td align="center"><font size="2" face="Arial, Arial, Helvetica">Biological
981                                                Molecule / Asymmetric Unit</font></td>
982                                        </tr>
983                                        <tr>
984                                                <td align="center"><img id="structureImage" name="structureImage"
985                                                        src="/pdb/images/1cy0_asym_r_250.jpg" border="0"
986                                                        alt="Biological Molecule / Asymmetric Unit Image for 1CY0">
987                                                </td>
988                                        </tr>
989                                       
990                                        <tr>
991                                                <td align="center" class="it_item">
992                                                <table>
993                                                        <tr>
994                                                                <td class="it_item" colspan="4" align="center">Display Options</td>
995                                                        </tr>
996                                                        <tr>
997                                                                <td align="center"><a class="imagetable"
998                                                                        href="/pdb/static.do?p=explorer/viewers/king.jsp"
999                                                                        title="KiNG requires Java">KiNG</a></td>
1000                                                        </tr>
1001                                                        <tr>
1002                                                                <td align="center"><a class="imagetable"
1003                                                                        href="/pdb/static.do?p=explorer/viewers/jmol.jsp"
1004                                                                        title="Jmol requires Java">Jmol</a></td>
1005                                                        </tr>
1006                                                        <tr>
1007                                                                <td align="center"><a class="imagetable"
1008                                                                        href="/pdb/static.do?p=explorer/viewers/webmol.jsp"
1009                                                                        title="WebMol requires Java">WebMol</a></td>
1010                                                        </tr>
1011                                                        <tr>
1012                                                                <td align="center"><a class="imagetable"
1013                                                                        href="/pdb/Viewers/ProteinWorkshop/protein_workshop_launch.jsp"
1014                                                                        title="ProteinWorkshop requires Java">Protein Workshop</a></td>
1015                                                        </tr>
1016                                                        <tr><td align="center"><a class="imagetable" href="/pdb/static.do?p=Viewers/QuickPDB/quickPDBApplet.jsp" title="QuickPDB requires Java">QuickPDB</a></td></tr>
1017                                                        <tr>
1018                                                                <td align="center"><a class="imagetable"
1019                                                                        href="/pdb/explore/images.do?structureId=1CY0">All
1020                                                                Images</a></td>
1021                                                        </tr>
1022
1023
1024                                                        <!--
1025                                <tr>
1026                                        <td class="it_item">Web Start&nbsp;&nbsp;</td>
1027                                        <td><a class="imagetable" href="/pdb/Viewers/king.jsp" title="King requires Java">KiNG</a></td>
1028                                        <td><a class="imagetable" href="/pdb/Viewers/jmol.jsp" title="Jmol requires Java">Jmol</a></td>
1029                                        <td><a class="imagetable" href="/pdb/Viewers/webmol.jsp" title="WebMol requires Java">WebMol</a></td>
1030                                </tr>
1031                                -->
1032                                                </table>
1033                                                </td>
1034                                        </tr>
1035
1036
1037                                </table>
1038                                </td>
1039
1040                        </tr>
1041                </table>
1042                </td>
1043        </tr>
1044</table>
1045
1046</form>
1047
1048                  </td>
1049                </tr>
1050          </tbody>
1051        </table>
1052
1053
1054        <table border="0" cellpadding="4" cellspacing="4" width="100%">
1055                                        <tr class="se_back2">
1056                                                <td width="15%" align="right" valign="top" class="se_item">
1057                                                        Source
1058                                                 <form action="/pdb/search/smartSubquery.do" method="get" name="srcQueryForm">
1059                                                        <!--  searchSource(natSci, natCommon, genSci, genCommon) -->
1060                                                         <input type="hidden" name="smartSearchSubtype" value="CifFieldsQuery">
1061                                                         <input type="hidden" name="entity_src_nat.pdbx_organism_scientific.value" value="">
1062                                                         <input type="hidden" name="entity_src_nat.common_name.value" value="">
1063                                                         <input type="hidden" name="entity_src_gen.pdbx_gene_src_scientific_name.value" value="">
1064                                                         <input type="hidden" name="entity_src_gen.gene_src_common_name.value" value="">
1065                                                </form>
1066                                                </td>
1067                                                <td width="85%" class="se_datalarge2" valign="top">
1068               
1069                        <span class="se_subitem">Polymer:</span>
1070                                        &nbsp;1 &nbsp;&nbsp;
1071                                        <span class="se_subitem">Scientific Name:</span>
1072                                        <span class="qrb_value">
1073                                          <a class="sePrimarycitations" onmouseover="this.className='sePrimarycitationsHover';" onmouseout="this.className='sePrimarycitations';" onclick="searchSource('', '', 'ESCHERICHIA COLI', '');">
1074                                            &nbsp;Escherichia coli&nbsp;&nbsp;
1075                                          </a>
1076                                        </span>
1077                                        <a class="se_datalarge" href="http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=562" target="resource_window"><img src="/pdbstatic/explorer/images/taxonomy_icon.gif" BORDER="0" ALT="Go to NCBI Taxonomy entry" TITLE="Go to NCBI Taxonomy entry"></a>
1078               
1079                                        <span class="se_subitem">Common Name:</span>
1080                                        <span class="qrb_value">
1081                                          <a class="sePrimarycitations" onmouseover="this.className='sePrimarycitationsHover';" onmouseout="this.className='sePrimarycitations';" onclick="searchSource('', '', '', 'BACTERIA');">
1082                                            &nbsp;Bacteria&nbsp;&nbsp;
1083                                          </a>
1084                                        </span>
1085               
1086                                        <span class="se_subitem">Expression system:</span>
1087                                        <span class="qrb_value">
1088                                          <a class="sePrimarycitations" onmouseover="this.className='sePrimarycitationsHover';" onmouseout="this.className='sePrimarycitations';" onclick="searchSource('', '', 'ESCHERICHIA COLI', '');">
1089                                            &nbsp;Escherichia coli&nbsp;&nbsp;
1090                                          </a>
1091                                        </span>
1092
1093       
1094           <img src="/pdbstatic/explorer/images/spacer.gif" alt="" name="Source">
1095                                        </td>
1096                                </tr>
1097                                       
1098                                <tr class="se_back1">
1099                                        <td width="15%" align="right" class="se_item">
1100                                                Related PDB Entries
1101                                        </td>
1102                                        <td width="85%" class="se_datalarge1">
1103                                        <table border="0" cellpadding="1" cellspacing="1" width="100%">
1104                                                <tr>
1105                                                        <td width="20%">
1106                                                                <span class="se_subitem">Id</span>
1107                                                        </td>
1108                                                        <td width="80%">
1109                                                                <span class="se_subitem">Details</span>
1110                                                        </td>
1111                                                </tr>
1112                 
1113                                <tr>
1114                                         <td width="15%" class="se_datalarge1">
1115                                                <a class="se_datalarge" href="/pdb/explore.do?structureId=1CYY" >1CYY</a>&nbsp;
1116                                         </td>
1117                                         <td width="65%" class="se_datalarge1">
1118                                                 Crystal structure of the 30 kDa fragment of E. coli DNA topoisomerase I. Hexagonal form&nbsp;
1119                                         </td>
1120                                 </tr>
1121               
1122                                <tr>
1123                                         <td width="15%" class="se_datalarge1">
1124                                                <a class="se_datalarge" href="/pdb/explore.do?structureId=1CY9" >1CY9</a>&nbsp;
1125                                         </td>
1126                                         <td width="65%" class="se_datalarge1">
1127                                                 Crystal structure of the 30 kDa fragment of E. coli DNA topoisomerase I. Monoclinic form&nbsp;
1128                                         </td>
1129                                 </tr>
1130               
1131                                <tr>
1132                                         <td width="15%" class="se_datalarge1">
1133                                                <a class="se_datalarge" href="/pdb/explore.do?structureId=1CY8" >1CY8</a>&nbsp;
1134                                         </td>
1135                                         <td width="65%" class="se_datalarge1">
1136                                                 Complex of E.coli DNA topoisomerase I with 5'-thymidine monophosphate and 3'-thymidine monophosphate&nbsp;
1137                                         </td>
1138                                 </tr>
1139               
1140                                <tr>
1141                                         <td width="15%" class="se_datalarge1">
1142                                                <a class="se_datalarge" href="/pdb/explore.do?structureId=1CY7" >1CY7</a>&nbsp;
1143                                         </td>
1144                                         <td width="65%" class="se_datalarge1">
1145                                                 Complex of E.coli DNA topoisomerase I with 5'-thymidine monophosphate&nbsp;
1146                                         </td>
1147                                 </tr>
1148               
1149                                <tr>
1150                                         <td width="15%" class="se_datalarge1">
1151                                                <a class="se_datalarge" href="/pdb/explore.do?structureId=1CY6" >1CY6</a>&nbsp;
1152                                         </td>
1153                                         <td width="65%" class="se_datalarge1">
1154                                                 Complex of E.coli DNA topoisomerase I with 3'-thymidine monophosphate&nbsp;
1155                                         </td>
1156                                 </tr>
1157               
1158                                <tr>
1159                                         <td width="15%" class="se_datalarge1">
1160                                                <a class="se_datalarge" href="/pdb/explore.do?structureId=1CY4" >1CY4</a>&nbsp;
1161                                         </td>
1162                                         <td width="65%" class="se_datalarge1">
1163                                                 Complex of E.coli DNA topoisomerase I with 5'pTpTpTp3'&nbsp;
1164                                         </td>
1165                                 </tr>
1166               
1167                                <tr>
1168                                         <td width="15%" class="se_datalarge1">
1169                                                <a class="se_datalarge" href="/pdb/explore.do?structureId=1CY2" >1CY2</a>&nbsp;
1170                                         </td>
1171                                         <td width="65%" class="se_datalarge1">
1172                                                 Complex of E.coli DNA topoisomerase I with TpTpTp3'&nbsp;
1173                                         </td>
1174                                 </tr>
1175               
1176                                <tr>
1177                                         <td width="15%" class="se_datalarge1">
1178                                                <a class="se_datalarge" href="/pdb/explore.do?structureId=1CY1" >1CY1</a>&nbsp;
1179                                         </td>
1180                                         <td width="65%" class="se_datalarge1">
1181                                                 COMPLEX OF E.COLI DNA TOPOISOMERASE I WITH 5'pTpTpT&nbsp;
1182                                         </td>
1183                                 </tr>
1184                               
1185                         </table>
1186                        </td>
1187                </tr>                           
1188                       
1189        <!-- Display one or more non - polymers such as ligands here -->
1190               
1191                <tr class="se_back2">
1192                        <td width="15%" align="right" valign="top" class="se_item">
1193                                Chemical Component&nbsp;&nbsp;
1194                        </td>
1195                        <td width="85%" valign="top">
1196                                <table border="0" cellpadding="1" cellspacing="1"  width="100%" >
1197                                 <tr class="se_subitem2">
1198                                         <td width="10%">
1199                                                 Identifier
1200                                         </td>
1201                                         <td width="35%">
1202                                                 Name
1203                                         </td>
1204                                         <td width="25%">
1205                                                 Formula
1206                                         </td>
1207                                         <td width="20%">
1208                                                 Drug Similarity
1209                                         </td>
1210                                         <td width="20%">
1211                                                 Ligand Structure
1212                                         </td>
1213                                         
1214                                         <td width="20%">
1215                                                 Ligand Interaction
1216                                         </td>
1217                                         
1218                                         <td>
1219                                                <form action="/pdb/search/smartSubquery.do" method="get" name="ligandQueryForm">
1220                                                 <input type="hidden" name="smartSearchSubtype" value="LigandIdQuery">
1221                                                 <input type="hidden" name="display" value="true">
1222                                                        <input type="hidden" name="chem_comp.id.value" value="">
1223                                                        <input type="hidden" name="chem_comp.id.comparator" value="=">
1224                                                </form>
1225                                         </td>
1226                                 </tr>
1227                                 
1228                 
1229                                 <tr>
1230                                         <td width="5%" class="se_datalarge2" valign="middle">
1231                                                        <a class="se_datalarge" onclick="searchLigand('A3P');" onmouseover="this.className='se_datalargeHover'" onmouseout="this.className='se_datalarge'">A3P</a>
1232                                            <img src="/pdbstatic/explorer/images/spacer.gif" alt="" name="NonPolymerEntities">&nbsp;
1233                                         </td>
1234                                         <td width="30%" class="se_datalarge2">
1235                                                ADENOSINE-3'-5'-DIPHOSPHATE&nbsp;
1236                                         </td>
1237                                         <td width="20%" class="se_formula2">
1238                                                C<sub>1</sub><sub>0</sub> H<sub>1</sub><sub>5</sub> N<sub>5</sub> O<sub>1</sub><sub>0</sub> P<sub>2</sub> &nbsp;
1239                                         </td>
1240                                         <td width="10%" class="se_datalarge2">
1241                                                 <a class="se_datasmall" href="http://bioinformatics.charite.de/superligands/drug_similarity.php?hetero=A3P" target=resource_window>
1242                                                     [ View ]
1243                                                 </a>
1244                                         </td>
1245                                         <td width="15%" class="se_datalarge2">
1246                                                 <a class="se_datasmall" href="/pdb/explore/marvin.do?handler=structureExplorer&amp;hetId=A3P&amp;sid=1CY0">
1247                                                     [ View ]
1248                                                 </a>
1249                                         </td>
1250                                         
1251                                         <td width="20%" class="se_datalarge2">
1252                                                 <a class="se_datasmall" href="/pdb/explore/ligand3d.jnlp?hetId=A3P">
1253                                                     [ View ]
1254                                                 </a>
1255                                         </td>
1256                                         
1257                                 </tr>
1258                       
1259                       
1260                                </table>
1261                         </td>
1262                    </tr>
1263   
1264     
1265
1266 <tr class="se_back1">
1267                                        <td width="15%" align="right" valign="top" class="se_item">
1268                                                <span class="external_ref">SCOP Classification <font size="-2">(version&nbsp;1.69)</font></span>
1269                                        </td>
1270                                        <td width="85%" valign="top">
1271                                    <table border="0" cellpadding="1" cellspacing="1"  width="100%" >
1272                                             <tr class="se_subitem1">
1273                                                    <td width="12%">
1274                                                           Domain Info
1275                                                   </td>
1276                                                    <td width="13%">
1277                                                           Class
1278                                                   </td>
1279                                                    <td width="15%">
1280                                                           Fold
1281                                                   </td>
1282                                                   <td width="15%">
1283                                                          Superfamily
1284                                                   </td>
1285                                                   <td width="15%">
1286                                                          Family
1287                                                   </td>
1288                                                   <td width="15%">
1289                                                          Domain
1290                                                   </td>
1291                                                   <td width="15%">
1292                                                         Species
1293                                                    </td>
1294                                         </tr>
1295
1296                                         <tr>
1297                                        <td width="12%" class="se_datasmall1">
1298                                                d1cy0a_
1299                                        </td>
1300
1301                                                          <td width="13%" class="se_datasmall1">
1302                                                                          <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=11&amp;n=56572"> Multi-domain proteins (alpha and beta)</a>
1303                                                          </td>
1304
1305                                                          <td width="15%" class="se_datalarge1">
1306                                                                          <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=11&amp;n=56711"> Prokaryotic type I DNA topoisomerase</a>
1307                                                          </td>
1308
1309                                                          <td width="15%" class="se_datalarge1">
1310                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=11&amp;n=56712"> Prokaryotic type I DNA topoisomerase</a>
1311                                                          </td>
1312
1313                                                          <td width="15%" class="se_datalarge1">
1314                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=11&amp;n=56713"> Prokaryotic type I DNA topoisomerase</a>
1315                                                          </td>
1316
1317                                                          <td width="15%" class="se_datalarge1">
1318                                                                          <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=11&amp;n=56714"> DNA topoisomerase I, 67K N-terminal domain</a>
1319                                                          </td>
1320
1321                                                          <td width="15%" class="se_datalarge1">
1322                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=11&amp;n=56715"> Escherichia coli</a>
1323                                                          </td>
1324                                           </tr>
1325
1326                        </table>
1327                      </td>
1328                        </tr>         
1329
1330
1331
1332                                <tr class="se_back2">
1333                                        <td width="15%" align="right" valign="top" class="se_item">
1334                                                <span class="external_ref">CATH Classification <font size="-2">(version v2.6.0)</font></span>
1335                                        </td>
1336                                        <td width="85%" valign="top">
1337                                            <table border="0" cellpadding="1" cellspacing="1"  width="100%" >
1338                                             <tr class="se_subitem2">
1339                                                            <td width="20%">
1340                                                                   Domain
1341                                                           </td>
1342                                                           <td width="20%">
1343                                                                  Class
1344                                                           </td>
1345                                                           <td width="20%">
1346                                                                  Architecture
1347                                                           </td>
1348                                                           <td width="20%">
1349                                                                  Topology
1350                                                           </td>
1351                                                           <td width="20%">
1352                                                                 Homology
1353                                                            </td>
1354                                              </tr>
1355
1356                                          <tr>
1357                                          <td width="20%" class="se_datasmall2">
1358                                                                           1cy0A1
1359                                                          </td>
1360
1361                                                          <td width="20%" class="se_datasmall2">
1362                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=12&amp;n=1274">Alpha Beta</a>
1363                                                          </td>
1364
1365                                                          <td width="20%" class="se_datasmall2">
1366                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=12&amp;n=1842">3-Layer(aba) Sandwich</a>
1367                                                          </td>
1368       
1369                                                          <td width="20%" class="se_datasmall2">
1370                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=12&amp;n=1978">Rossmann fold</a>
1371                                                          </td>
1372
1373                                                          <td width="20%" class="se_datasmall2">
1374                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=12&amp;n=2009">ISOMERASE</a>
1375                                                          </td>
1376                                                </tr>       
1377
1378                                          <tr>
1379                                          <td width="20%" class="se_datasmall2">
1380                                                                           1cy0A2
1381                                                          </td>
1382
1383                                                          <td width="20%" class="se_datasmall2">
1384                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=12&amp;n=1">Mainly Alpha</a>
1385                                                          </td>
1386
1387                                                          <td width="20%" class="se_datasmall2">
1388                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=12&amp;n=2">Orthogonal Bundle</a>
1389                                                          </td>
1390       
1391                                                          <td width="20%" class="se_datasmall2">
1392                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=12&amp;n=352">Topoisomerase I; domain 2</a>
1393                                                          </td>
1394
1395                                                          <td width="20%" class="se_datasmall2">
1396                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=12&amp;n=353">Topoisomerase I, domain 2</a>
1397                                                          </td>
1398                                                </tr>       
1399
1400                                          <tr>
1401                                          <td width="20%" class="se_datasmall2">
1402                                                                           1cy0A3
1403                                                          </td>
1404
1405                                                          <td width="20%" class="se_datasmall2">
1406                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=12&amp;n=762">Mainly Beta</a>
1407                                                          </td>
1408
1409                                                          <td width="20%" class="se_datasmall2">
1410                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=12&amp;n=1229">Distorted Sandwich</a>
1411                                                          </td>
1412       
1413                                                          <td width="20%" class="se_datasmall2">
1414                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=12&amp;n=1248">Topoisomerase I; domain 3</a>
1415                                                          </td>
1416
1417                                                          <td width="20%" class="se_datasmall2">
1418                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=12&amp;n=1249">Topoisomerase I, domain 3</a>
1419                                                          </td>
1420                                                </tr>       
1421
1422                                          <tr>
1423                                          <td width="20%" class="se_datasmall2">
1424                                                                           1cy0A4
1425                                                          </td>
1426
1427                                                          <td width="20%" class="se_datasmall2">
1428                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=12&amp;n=1">Mainly Alpha</a>
1429                                                          </td>
1430
1431                                                          <td width="20%" class="se_datasmall2">
1432                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=12&amp;n=2">Orthogonal Bundle</a>
1433                                                          </td>
1434       
1435                                                          <td width="20%" class="se_datasmall2">
1436                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=12&amp;n=307">Topoisomerase I; domain 4</a>
1437                                                          </td>
1438
1439                                                          <td width="20%" class="se_datasmall2">
1440                                                                           <a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=12&amp;n=308">Topoisomerase I, domain 4</a>
1441                                                          </td>
1442                                                </tr>       
1443     
1444                        </table>
1445                      </td>
1446                        </tr>                   
1447
1448                <tr class="se_back1">
1449                                        <td width="15%" align="right" valign="top" class="se_item">
1450                                                <span class="external_ref">PFAM Classification </span>
1451                                        </td>
1452                                        <td width="85%" valign="top">
1453                                            <table border="0" cellpadding="1" cellspacing="1"  width="100%" >
1454                                             <tr class="se_subitem1">
1455                                                            <td width="5%">
1456                                                                   Chain
1457                                                           </td>
1458                                                           <td width="20%">
1459                                                                  PFAM Accession
1460                                                           </td>
1461                                                           <td width="15%">
1462                                                                  PFAM ID
1463                                                           </td>
1464                                                           <td width="25%">
1465                                                                  Description
1466                                                           </td>
1467                                                           <td width="15%">
1468                                                                 Type
1469                                                            </td>
1470                                                           <td width="20%">
1471                                                                 Clan ID                                                           
1472                                              </tr>
1473
1474
1475                                                <tr>
1476                                          <td width="5%" class="se_datasmall1">
1477                                                                           A
1478                                                          </td>
1479                                                          <td width="20%" class="se_datasmall1">
1480                                                                           <a class="se_datalarge" href="http://www.sanger.ac.uk/cgi-bin/Pfam/getacc?PF01131" target=resource_window>PF01131</a>
1481                                                          </td>
1482                                                          <td width="15%" class="se_datasmall1">
1483                                                                           Topoisom_bac
1484                                                          </td>
1485                                                          <td width="25%" class="se_datasmall1">
1486                                                                           DNA topoisomerase
1487                                                          </td>
1488                                                          <td width="15%" class="se_datasmall1">
1489                                                                           Family
1490                                                          </td>
1491                                                          <td width="20%" class="se_datasmall1" title="Clan Description: n/a">
1492                                                                           n/a</a>
1493                                                          </td>
1494                                                </tr>       
1495
1496                                                <tr>
1497                                          <td width="5%" class="se_datasmall1">
1498                                                                           A
1499                                                          </td>
1500                                                          <td width="20%" class="se_datasmall1">
1501                                                                           <a class="se_datalarge" href="http://www.sanger.ac.uk/cgi-bin/Pfam/getacc?PF01751" target=resource_window>PF01751</a>
1502                                                          </td>
1503                                                          <td width="15%" class="se_datasmall1">
1504                                                                           Toprim
1505                                                          </td>
1506                                                          <td width="25%" class="se_datasmall1">
1507                                                                           Toprim domain
1508                                                          </td>
1509                                                          <td width="15%" class="se_datasmall1">
1510                                                                           Family
1511                                                          </td>
1512                                                          <td width="20%" class="se_datasmall1" title="Clan Description: n/a">
1513                                                                           n/a</a>
1514                                                          </td>
1515                                                </tr>       
1516
1517                                        </table>
1518                      </td>
1519                        </tr>             
1520
1521
1522                                  <tr class="se_back2">
1523                                        <td width="15%" align="right" valign="top" class="se_item">
1524                                                <span class="external_ref">GO Terms</span>
1525                                        </td>
1526                                        <td width="85%" valign="top">
1527                                    <table border="0" cellpadding="1" cellspacing="1"  width="100%" >
1528                                     <tr class="se_subitem1">
1529                                            <td width="25%">
1530                                                        Polymer
1531                                           </td>
1532                                           <td width="25%">
1533                                                   Molecular Function
1534                                           </td>
1535                                           <td width="25%">
1536                                                   Biological Process
1537                                           </td>
1538                                           <td width="25%">
1539                                                   Cellular Component
1540                                            </td>
1541                                  </tr>
1542                                 
1543
1544                <tr>
1545                                         <td width="25%" class="se_datasmall1">
1546                                                        DNA TOPOISOMERASE I (1CY0:A)
1547                                         </td>
1548                                         <td width="25%" class="se_datasmall1">
1549                                               <ul>
1550
1551                         <li><a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=6&amp;n=3676">nucleic acid binding</a>
1552
1553                         <li><a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=6&amp;n=3677">DNA binding</a>
1554
1555                         <li><a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=6&amp;n=3916">DNA topoisomerase activity</a>
1556
1557                         <li><a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=6&amp;n=3917">DNA topoisomerase type I activity</a>
1558
1559                      </ul>
1560                   </td>
1561                   <td width="25%" class="se_datasmall1">
1562                                               <ul>
1563
1564                           <li><a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=4&amp;n=6265">DNA topological change</a>
1565
1566                           <li><a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=4&amp;n=6268">DNA unwinding during replication</a>
1567
1568                           <li><a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=4&amp;n=6304">DNA modification</a>
1569
1570                      </ul>
1571                   </td>
1572                    <td width="25%" class="se_datasmall1">
1573                                               <ul>
1574
1575                           <li><a class="se_datasmall" href="/pdb/search/smartSubquery.do?smartSearchSubtype=TreeQuery&t=5&amp;n=5694">chromosome</a>
1576
1577                      </ul>
1578                   </td>
1579                </tr>
1580
1581                        </table>
1582                        </td>
1583                  </tr>
1584                  <tr>
1585                          <td>
1586                          <!-- Form is setup for the PDF Creator to grab the data -->
1587                                <FORM NAME="PDFCREATOR" ACTION="/pdb/sepdf" method="post" target="sepdfwin">
1588                                        <input type="hidden" name="strId" value="1CY0">
1589                                        <input type="hidden" name="strTitle" value="COMPLEX OF E.COLI DNA TOPOISOMERASE I WITH 3'-5'-ADENOSINE DIPHOSPHATE">
1590                                        <input type="hidden" name="strAuthors" value="Feinberg, H., Changela, A., Mondragon, A.">
1591                                        <input type="hidden" name="strPrimaryCitations" value="Feinberg, H., Changela, A., Mondragon, A.">
1592                                        <input type="hidden" name="strCitationTitle" value="Protein-nucleotide interactions in E. coli DNA topoisomerase I.">
1593                                        <input type="hidden" name="strJournalAbbrev" value="Nat.Struct.Biol.">
1594                                        <input type="hidden" name="strJounralVolume" value="v6">
1595                                        <input type="hidden" name="strJournalPage" value="961-968">
1596                                        <input type="hidden" name="strJournalYear" value="1999">
1597                                        <input type="hidden" name="strDeposition" value="1999-08-31">
1598                                        <input type="hidden" name="strRelease" value="2000-03-08">
1599                                        <input type="hidden" name="strExpMethod" value="X-RAY DIFFRACTION">
1600                                        <input type="hidden" name="strResolution" value="2.450000047683716">
1601                                        <input type="hidden" name="strRValue" value="0.2199999988079071">
1602                                        <input type="hidden" name="strRValueType" value="(obs.)">
1603                                        <input type="hidden" name="strRFree" value="0.27399998903274536">
1604
1605                                                                               
1606                                        <input type="hidden" name="strSpaceGroup" value="P 21 21 21">
1607                                       
1608                                       
1609                                       
1610                                        <input type="hidden" name="strLengthA" value="63.040000915527344">
1611                                       
1612                                       
1613                                       
1614                                       
1615                                        <input type="hidden" name="strLengthB" value="73.30999755859375">                                       
1616                                                                               
1617
1618                                       
1619                                       
1620                                        <input type="hidden" name="strLengthC" value="134.4600067138672">                                       
1621                                                                               
1622                                       
1623                                       
1624                                        <input type="hidden" name="strAngleA" value="90.0">                                     
1625                                                                               
1626                                       
1627                                       
1628                                        <input type="hidden" name="strAngleB" value="90.0">                                     
1629                                                                               
1630                                       
1631                                       
1632                                        <input type="hidden" name="strAngleC" value="90.0">                                     
1633                                                       
1634                                       
1635                                                               
1636                                        <input type="hidden" name="strMolDesc" value="">
1637                                        <input type="hidden" name="strKeywords" value="ISOMERASE">
1638                                        <input type="hidden" name="strSourceLine" value="Polymer: 1, Scientific Name: ESCHERICHIA COLI
1639Common Name: BACTERIA     Expression System: ESCHERICHIA COLI">
1640                                        <input type="hidden" name="strChemCompIdList" value="A3P,">
1641                                        <input type="hidden" name="strChemCompNameList" value="ADENOSINE-3'-5'-DIPHOSPHATE,">
1642                                        <input type="hidden" name="strChemCompFormulaList" value="C10 H15 N5 O10 P2,">
1643                                        <input type="hidden" name="strChemCompListLen" value="1">
1644                                        <input type="hidden" name="strScopFoldDesc" value="Prokaryotic type I DNA topoisomerase">
1645                                        <input type="hidden" name="strScopSFDesc" value="Prokaryotic type I DNA topoisomerase">
1646                                        <input type="hidden" name="strScopFamDesc" value="Prokaryotic type I DNA topoisomerase">
1647                                        <input type="hidden" name="strScopDomDesc" value="DNA topoisomerase I, 67K N-terminal domain">
1648                                        <input type="hidden" name="strScopSpeciesDesc" value="Escherichia coli">
1649                                        <input type="hidden" name="strCathDomainList" value="1cy0A1,1cy0A2,1cy0A3,1cy0A4,">
1650                                        <input type="hidden" name="strCathClassList" value="Alpha Beta,Mainly Alpha,Mainly Beta,Mainly Alpha,">
1651                                        <input type="hidden" name="strCathArchitectureList" value="3-Layer(aba) Sandwich,Orthogonal Bundle,Distorted Sandwich,Orthogonal Bundle,">
1652                                        <input type="hidden" name="strCathTopologyList" value="Rossmann fold,Topoisomerase I; domain 2,Topoisomerase I; domain 3,Topoisomerase I; domain 4,">
1653                                        <input type="hidden" name="strCathHomologyList" value="ISOMERASE,Topoisomerase I, domain 2,Topoisomerase I, domain 3,Topoisomerase I, domain 4,">
1654                                        <input type="hidden" name="strCathListLen" value="4">
1655                                        <input type="hidden" name="strGoMoleculeList" value="DNA TOPOISOMERASE I*,*">                                   
1656                                        <input type="hidden" name="strGoMolecularFunctionList" value="nucleic acid binding,DNA binding,DNA topoisomerase activity,DNA topoisomerase type I activity,||DNA topological change,DNA unwinding during replication,DNA modification,chromosome,">                                   
1657                                        <input type="hidden" name="strGoBiologicalProcessList" value="||">                                     
1658                                        <input type="hidden" name="strGoCellularComponentList" value="||">                                     
1659                                        <input type="hidden" name="strGoListLen" value="1">                                     
1660
1661                                       
1662                                       
1663                                       
1664                                        <!--a href="#" onClick="javascript:document.PDFCREATOR.submit();">|PDF|</a-->
1665                                </form>
1666               
1667                          </td>
1668                  </tr>
1669        </table>
1670
1671
1672</td>
1673   </tr>
1674   <tr>
1675    <td valign="top" class="maintd"> </td>
1676   </tr>
1677  </table>
1678
1679  </td>
1680 </tr>  <!-- END MAIN RIGHT -->
1681
1682
1683 
1684 <tr>
1685  <td colspan="3">   
1686
1687 
1688
1689<table width="100%" border="0" cellpadding="0" cellspacing="0">
1690 <tr>  <!-- BEGIN BOTTOM BORDER -->
1691  <td class="foothomelight"><img src="/pdbstatic/images/spacer.gif" alt="" height="15" border="0"></td>
1692  <td class="foothomelight" colspan="2"></td>
1693 </tr>
1694 <tr>
1695  <td class="foothomedark1" colspan="3">
1696    <a class="foothomedark1" href="http://home.rcsb.org/" target="_blank"><i>&copy; RCSB Protein Data Bank &nbsp;&nbsp;</i></a>
1697  </td>
1698 </tr>  <!-- END BOTTOM BORDER -->
1699
1700<tr>
1701 <td colspan="3"><br></td>
1702</tr>
1703</table>
1704
1705  </td>
1706 </tr>
1707
1708</tbody>
1709</table>
1710
1711<script type="text/javascript" language="JavaScript" src="/pdbstatic/common/lib/wz_tooltip.js"></script>
1712<script type="text/javascript" language=javascript src="/pdbstatic/common/lib/awstats_misc_tracker.js"></script>
1713<script type="text/javascript" language="JavaScript">
1714var htmlHttpLoader = new RemoteFileLoader('htmlHttpLoader');
1715// Props to Simon Willison:
1716// http://simon.incutio.com/archive/2004/05/26/addLoadEvent
1717var oldhandler = window.onload;
1718window.onload = (typeof oldhandler == "function")
1719    ? function() { oldhandler(); initExpandableLists(); } : initExpandableLists;
1720</script>
1721</body>
1722</html>
+
+ + + +
+ +
+ + + + + + + + + + + diff --git a/vendor/gems/hpricot-0.6/test/files/immob.html b/vendor/gems/hpricot-0.6/test/files/immob.html new file mode 100644 index 0000000..b510e63 --- /dev/null +++ b/vendor/gems/hpricot-0.6/test/files/immob.html @@ -0,0 +1,400 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Immobiliensuche - hier sind sie richtig! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+ + + + + + + + + + + + + Wir haben + + 30 + + Immobilien für Sie gefunden. +

+ + + + + + + + +
+ + + + + + + + +
Listenansicht  + Galerieansicht
+
+ + Seiten: 1 +2 +> + +
+ + + +
+ + + + + +
nach:  + + + + + +
+
+ +
+ + + + + + + + +
Erklärung:N Neu! Aktuell
+
+

+ + + + + + + + + + + + + + + +
  + Zimmer
+ Stadt/Kreis
+ + +
+ Wohnfläche
+ Stadtteil/Ort
+ + +
+ Kaltmiete
+ Straße
+ + +
+ Foto +
! Schön Wohnen Nahe der Universitätsstr. mit kurzen Wegen zu allem Balkon Thumbnail
 3,00
Erlangen
111,00 m²
Erlangen - Zentrum
999,45 EUR

Schön Wohnen Nahe der Universitätsstr. mit kurzen Wegen zu allem Balkon Thumbnail
 3,00
Erlangen
110,19 m²
Erlangen - Zentrum
991,71 EUR

Schön Wohnen Nahe der Universitätsstr. mit kurzen Wegen zu allem Balkon Thumbnail
 2,00
Erlangen
104,51 m²
Erlangen - Zentrum
940,59 EUR

N Ideal für Rollstuhlfahrer die Wohnung und die Lage Balkon Thumbnail
 2,00
Erlangen
103,42 m²
Erlangen - Zentrum
930,78 EUR

Schön Wohnen Nahe der Universitätsstr. mit kurzen Wegen zu allem Balkon Thumbnail
 3,00
Erlangen
103,00 m²
Erlangen - Zentrum
926,82 EUR

120 m² 4ZiDesignerGaleriewohnung mit Kamin, Eckbadewanne, Fußbodenheizung, Einbauküche 920 € 1.8.06 Einbauküche Balkon Thumbnail
 4,00
Erlangen
125,00 m²
Erlangen Süd
920,00 EUR
Wohnanlage Nahe Erlangen in Möhrendorf
120 m² 4ZiDesignerGaleriewohnung mit Kamin, Eckbadewanne, Fußbodenheizung, Einbauküche 920 € 1.8.06 Einbauküche Balkon Thumbnail
 4,00
Erlangen
125,00 m²
Erlangen Süd
890,00 EUR
Wohnanlage Nahe Erlangen in Möhrendorf
Schön Wohnen Nahe der Universitätsstr. mit kurzen Wegen zu allem Balkon Thumbnail
 2,00
Erlangen
94,95 m²
Erlangen - Zentrum
854,55 EUR

Schön Wohnen Nahe der Universitätsstr. mit kurzen Wegen zu allem Balkon Thumbnail
 2,00
Erlangen
92,00 m²
Erlangen - Zentrum
827,64 EUR

N Ideal für Rollstuhlfahrer die Wohnung und die Lage Balkon Thumbnail
 3,00
Erlangen
83,00 m²
Erlangen Süd
825,00 EUR
Nahe Unistr
Schön Wohnen Nahe der Universitätsstr. mit kurzen Wegen zu allem Balkon Thumbnail
 2,00
Erlangen
87,16 m²
Erlangen - Zentrum
784,44 EUR

Schön Wohnen Nahe der Universitätsstr. mit kurzen Wegen zu allem Balkon Thumbnail
 2,00
Erlangen
79,46 m²
Erlangen - Zentrum
715,14 EUR

Schön Wohnen Nahe der Universitätsstr. mit kurzen Wegen zu allem Balkon Thumbnail
 2,00
Erlangen
74,02 m²
Erlangen - Zentrum
666,18 EUR

N Ideal für Rollstuhlfahrer die Wohnung und die Lage Balkon Thumbnail
 2,00
Erlangen
74,00 m²
Erlangen - Zentrum
665,28 EUR

Schön Wohnen Nahe der Universitätsstr. mit kurzen Wegen zu allem Balkon Thumbnail
 2,00
Erlangen
74,00 m²
Erlangen - Zentrum
665,28 EUR


+ + + + + + + + + + + + + + + +
+ Seiten: + 1 +2 +> + +
+ nach: + + + + + + +

+ + + + + + + +
+
+
+ powered by ImmobilienScout24 + +
+ + + diff --git a/vendor/gems/hpricot-0.6/test/files/pace_application.html b/vendor/gems/hpricot-0.6/test/files/pace_application.html new file mode 100644 index 0000000..38d1427 --- /dev/null +++ b/vendor/gems/hpricot-0.6/test/files/pace_application.html @@ -0,0 +1,1320 @@ + + + + + + + + + + + + + + + + + + + +
+ First Health Services Corporation logo + + Pennsylvania Department of Aging logo +
+ + PACE/PACENET Enrollment + + + Need Assistance?
+ Call: Inside PA 1-800-225-7223 Outside PA 717-651-3600
+ Email: PACECares@fhsc.com +
+
+ + +
+ + +
+ + + + + + + + + + + + + + + + + +

+ + Check if same + as Applicant +
Preparer's Name + + Preparer's Phone + () + - + + + + + +

+ Please enter the Preparer's Name & Phone #.
+ When you are done, click on 'Continue'.
+


+ + + +

+
+
+ + + + + +
+
The USGenWeb Project, Free Genealogy Online
+ +
+ +
+ +
+ + Home + About Us + States + Projects + Researchers + Volunteers + +
+ +
+ +
+
+

 

+

Keeping Internet Genealogy Free
+
+

+
+
+ + + + +
+

+

Welcome to The USGenWeb Project! We are a group of volunteers working together to provide free genealogy websites for genealogical research in every county and every state of the United States. This Project is non-commercial and fully committed to free genealogy access for everyone.

+

Organization is by county and state, and this website provides you with links to all the state genealogy websites which, in turn, provide gateways to the counties. The USGenWeb Project also sponsors important Special Projects at the national level and this website provides an entry point to all of those pages, as well.

+

Clicking on a State Link (on the left) will take you to the State's website. Clicking on the tabs above will take you to additional information and links.

+

All of the volunteers who make up The USGenWeb Project are very proud of this endeavor and hope that you will find their hard work both beneficial and rewarding. Thank you for visiting!

+

The USGenWeb Project Team +

+

10th Anniversary

+

+
+

2006 marks the 10th Anniversary of the USGenWeb Project and I have been looking back over those past 10 years. When the USGenWeb Project began, it was one of the few (if not the only) centralized places on the internet to find genealogy information and post a query. Those early state and county sites began with links to the small amount of on-line information of interest to a family historian and a query page. The only Special Project was the Archives. How far the Project has come during the past 10 years! Now there are several special projects and the states, counties and special projects sites of the Project not only contain links; they are filled with information and transcribed records, and more is being added every day by our wonderful, dedicated and hard working volunteers.

+

Ten years ago the internet, as we know it today, was in its infancy. The things we take for granted today--e-mail, PCs, cell phones, digital cameras, etc., were not in the average person's world. Family historians and professional genealogists not only didn't use the internet, most had never heard of it.

+

Over the past 10 years the internet has gone from obscurity to commonplace. As the internet became an every day tool for millions of people. it changed the way family historians do research. The availability of on-line, easily accessible genealogy and historical information has fueled the phenomenal growth of Genealogy as a hobby and, I'm proud to say, the Project has been right there every step of the way.

+

Everywhere we look we see genealogy reported as the fastest growing hobby in the country. Now the internet is the first stop for beginning family historians and is used extensively by experienced researchers. New "How To" genealogy books devote chapters to using the internet, and it is a rare book that does not recommend The USGenWeb Project as one of the first places to visit.

+

While subscription sites have popped up everywhere on the web, The Project has continued to offer free access to its vast wealth of information. The USGenWeb Project is recognized as the premier site of free information, and the Project's websites welcome well over a million visitors each day.

+

The Project is where it is today because of the thousands of volunteers, both past and present, who cared enough to devote, collectively, millions of hours to gathering, transcribing and uploading information.

+

To each and every volunteer, past and present, a heartfelt Thank You, because you are ones who have made The Project the fabulous resource it is today.

+

Linda Haas Davenport
+ National Coordinator
+ The USGenWeb Project

+ + + +

+
+

+
+ +
+
+
+ +
+
+ +
+ + + + +
+
+ +
+ + +
+
+ +
+

The USGenWeb Project, Free Genealogy Online

+ + +
+
+
+
+

Comments and administrative-type problems should be emailed to the National Coordinator. + For complaints regarding a specific web site within the USGenWeb Project, please include the URL when emailing the National Coordinator.

+

Direct comments or suggestions about this web site to the Webmaster.

+
+

Visit Rootsweb

+
+

+Home
+About Us
+Projects
+for Researchers
+for Volunteers
+Site Map

+
+ + +
+ + + diff --git a/vendor/gems/hpricot-0.6/test/files/utf8.html b/vendor/gems/hpricot-0.6/test/files/utf8.html new file mode 100644 index 0000000..841eab4 --- /dev/null +++ b/vendor/gems/hpricot-0.6/test/files/utf8.html @@ -0,0 +1,1054 @@ + +UTF-8 Sampler + + +

UTF-8 SAMPLER

+ +  Â¥ Â· Â£ Â· â‚¬ Â· $ Â· Â¢ Â· â‚¡ Â· â‚¢ Â· â‚£ Â· â‚¤ Â· â‚¥ Â· â‚¦ Â· â‚§ Â· â‚¨ Â· â‚© Â· â‚ª Â· â‚« Â· â‚­ Â· â‚® Â· â‚¯ + +

+

+Frank da Cruz
+The Kermit Project - Columbia University
+New York City
+fdc@columbia.edu + +

+Last update: +Wed Apr 12 16:54:07 2006 +

+

+


+[ PEACE ] +[ Poetry ] +[ I Can Eat Glass ] +[ The Quick Brown Fox ] +[ HTML Features ] +[ Credits, Tools, Commentary ] +

+ +UTF-8 is an ASCII-preserving encoding method for +Unicode (ISO 10646), the Universal Character Set +(UCS). The UCS encodes most of the world's writing systems in a single +character set, allowing you to mix languages and scripts within a document +without needing any tricks for switching character sets. This web page is +encoded directly in UTF-8. + +

+ +As shown HERE, +Columbia University's Kermit 95 terminal emulation +software can display UTF-8 plain text in Windows 95, 98, ME, NT, XP, or 2000 +when using a monospace Unicode font like Andale Mono WT J or Everson Mono Terminal, or the lesser +populated Courier New, Lucida Console, or Andale Mono. C-Kermit can handle it too, +if you have a Unicode +display. As many languages as are representable in your font can be seen +on the screen at the same time. + +

+ +This, however, is a Web page. Some Web browsers can handle UTF-8, some can't. +And those that can might not have a sufficiently populated font to work with +(some browsers might pick glyphs dynamically from multiple fonts; Netscape 6 +seems to do this). +CLICK HERE +for a survey of Unicode fonts for Windows. + +

+ +The subtitle above shows currency symbols of many lands. If they don't +appear as blobs, we're off to a good start! + +


+

Poetry

+ +From the Anglo-Saxon Rune Poem (Rune version): +

+ ᚠᛇᚻ᛫ᛒᛦᚦ᛫ᚠᚱᚩᚠᚢᚱ᛫ᚠá›áš±ášªá›«áš·á›–ᚻᚹᛦᛚᚳᚢᛗ
+ ᛋᚳᛖᚪᛚ᛫ᚦᛖᚪᚻ᛫ᛗᚪᚾᚾᚪ᛫ᚷᛖᚻᚹᛦᛚᚳ᛫ᛗá›áš³á›šáš¢áš¾á›«áš»á›¦á›á›«á›žáš«á›šášªáš¾
+ áš·á›áš á›«áš»á›–᛫ᚹá›á›šá›–᛫ᚠᚩᚱ᛫ᛞᚱá›áš»á›áš¾á›–᛫ᛞᚩᛗᛖᛋ᛫ᚻᛚᛇá›ášªáš¾á›¬
+
+

+ +From LaÈamon's Brut +(The Chronicles of England, Middle English, West Midlands): +

+

+An preost wes on leoden, LaÈamon was ihoten
+He wes Leovenaðes sone -- liðe him be Drihten.
+He wonede at ErnleÈe at æðelen are chirechen,
+Uppen Sevarne staþe, sel þar him þuhte,
+Onfest Radestone, þer he bock radde. +
+

+ +(The third letter in the author's name is Yogh, missing from many fonts; +CLICK HERE for another Middle English sample +with some explanation of letters and encoding). + +

+ +From the Tagelied of + + +Wolfram von Eschenbach (Middle High German): +

+Sîne klâwen durh die wolken sint geslagen,
+er stîget ûf mit grôzer kraft,
+ich sih in grâwen tägelîch als er wil tagen,
+den tac, der im geselleschaft
+erwenden wil, dem werden man,
+den ich mit sorgen în verliez.
+ich bringe in hinnen, ob ich kan.
+sîn vil manegiu tugent michz leisten hiez.
+

+ +Some lines of + +Odysseus Elytis (Greek): + +

+Τη γλώσσα μου έδωσαν ελληνική
+το σπίτι φτωχικό στις αμμουδιές του ΟμήÏου.
+Μονάχη έγνοια η γλώσσα μου στις αμμουδιές του ΟμήÏου.
+

+από το Άξιον Εστί
+του Οδυσσέα ΕλÏτη +

+ +

+ +The first stanza of +Pushkin's Bronze Horseman (Russian):
+

+Ðа берегу пуÑтынных волн
+СтоÑл он, дум великих полн,
+И вдаль глÑдел. Пред ним широко
+Река неÑлаÑÑ; бедный чёлн
+По ней ÑтремилÑÑ Ð¾Ð´Ð¸Ð½Ð¾ÐºÐ¾.
+По мшиÑтым, топким берегам
+Чернели избы здеÑÑŒ и там,
+Приют убогого чухонца;
+И леÑ, неведомый лучам
+Ð’ тумане ÑпрÑтанного Ñолнца,
+Кругом шумел.
+

+ +Šota Rustaveli's Veṗxis Ṭq̇aosani, +̣︡Th, The Knight in the Tiger's Skin (Georgian):

+

+ვეპხის ტყáƒáƒáƒ¡áƒáƒœáƒ˜ +შáƒáƒ—რრუსთáƒáƒ•ელი +

+ღმერთსი შემვედრე, ნუთუ კვლრდáƒáƒ›áƒ®áƒ¡áƒœáƒáƒ¡ სáƒáƒ¤áƒšáƒ˜áƒ¡áƒ შრáƒáƒ›áƒáƒ¡áƒ, +ცეცხლს, წყáƒáƒšáƒ¡áƒ დრმიწáƒáƒ¡áƒ, ჰáƒáƒ”რთრთáƒáƒœáƒ მრáƒáƒ›áƒáƒ¡áƒ; +მáƒáƒ›áƒªáƒœáƒ”ს ფრთენი დრáƒáƒ¦áƒ•ფრინდე, მივჰხვდე მáƒáƒ¡ ჩემსრნდáƒáƒ›áƒáƒ¡áƒ, +დღისით დრღáƒáƒ›áƒ˜áƒ— ვჰხედვიდე მზისრელვáƒáƒ—რკრთáƒáƒ›áƒáƒáƒ¡áƒ. +

+

+ +Tamil poetry of Cupiramaniya Paarathiyar, + +சà¯à®ªà¯à®°à®®à®£à®¿à®¯ பாரதியார௠(1882-1921): + +

+

+ +யாமறிநà¯à®¤ மொழிகளிலே தமிழà¯à®®à¯Šà®´à®¿ போல௠இனிதாவத௠எஙà¯à®•à¯à®®à¯ காணோமà¯,
+பாமரராய௠விலஙà¯à®•à¯à®•ளாயà¯, உலகனைதà¯à®¤à¯à®®à¯ இகழà¯à®šà¯à®šà®¿à®šà¯Šà®²à®ªà¯ பானà¯à®®à¯ˆ கெடà¯à®Ÿà¯,
+நாமமத௠தமிழரெனக௠கொணà¯à®Ÿà¯ இஙà¯à®•௠வாழà¯à®¨à¯à®¤à®¿à®Ÿà¯à®¤à®²à¯ நனà¯à®±à¯‹? சொலà¯à®²à¯€à®°à¯!
+ +
+ +
+

I Can Eat Glass

+ +And from the sublime to the ridiculous, here is a +certain phrase¹ in an assortment of languages: + +

+

    +
  1. Sanskrit: काचं शकà¥à¤¨à¥‹à¤®à¥à¤¯à¤¤à¥à¤¤à¥à¤®à¥ । नोपहिनसà¥à¤¤à¤¿ मामॠ॥ + +
  2. Sanskrit (standard transcription): kÄcaṃ Å›aknomyattum; nopahinasti mÄm. +
  3. Classical Greek: ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει. +
  4. Greek: ΜποÏÏŽ να φάω σπασμένα γυαλιά χωÏίς να πάθω τίποτα. +
    Etruscan: (NEEDED) +
  5. Latin: Vitrum edere possum; mihi non nocet. +
  6. Old French: Je puis mangier del voirre. Ne me nuit. +
  7. French: Je peux manger du verre, ça ne me fait pas de mal. +
  8. Provençal / Occitan: Pòdi manjar de veire, me nafrariá pas. +
  9. Québécois: J'peux manger d'la vitre, ça m'fa pas mal. +
  10. Walloon: Dji pou magnî do vêre, çoula m' freut nén må. +
    Champenois: (NEEDED) +
    Lorrain: (NEEDED) +
  11. Picard: Ch'peux mingi du verre, cha m'foé mie n'ma. +
    Corsican: (NEEDED) +
    Jèrriais: (NEEDED) +
  12. Kreyòl Ayisyen: Mwen kap manje vè, li pa blese'm. +
  13. Basque: Kristala jan dezaket, ez dit minik ematen. +
  14. Catalan / Català: Puc menjar vidre, que no em fa mal. +
  15. Spanish: Puedo comer vidrio, no me hace daño. +
  16. Aragones: Puedo minchar beire, no me'n fa mal . +
  17. Galician: Eu podo xantar cristais e non cortarme. +
  18. Portuguese: Posso comer vidro, não me faz mal. +
  19. Brazilian Portuguese (7): + Posso comer vidro, não me machuca. +
  20. Caboverdiano: M' podê cumê vidru, ca ta maguâ-m'. +
  21. Papiamentu: Ami por kome glas anto e no ta hasimi daño. +
  22. Italian: Posso mangiare il vetro e non mi fa male. +
  23. Milanese: Sôn bôn de magnà el véder, el me fa minga mal. +
  24. Roman: Me posso magna' er vetro, e nun me fa male. +
  25. Napoletano: M' pozz magna' o'vetr, e nun m' fa mal. +
  26. Sicilian: Puotsu mangiari u vitru, nun mi fa mali. +
  27. Venetian: Mi posso magnare el vetro, no'l me fa mae. +
  28. Zeneise (Genovese): Pòsso mangiâ o veddro e o no me fà mâ. +
    Rheto-Romance / Romansch: (NEEDED) +
    Romany / Tsigane: (NEEDED) +
  29. Romanian: Pot să mănânc sticlă și ea nu mă rănește. +
  30. Esperanto: Mi povas manÄi vitron, Äi ne damaÄas min. +
    Pictish: (NEEDED) +
    Breton: (NEEDED) +
  31. Cornish: Mý a yl dybry gwéder hag éf ny wra ow ankenya. +
  32. Welsh: Dw i'n gallu bwyta gwydr, 'dyw e ddim yn gwneud dolur i mi. +
  33. Manx Gaelic: Foddym gee glonney agh cha jean eh gortaghey mee. +
  34. Old Irish (Ogham): ᚛᚛ᚉᚑᚅᚔᚉᚉᚔᚋ ᚔᚈᚔ ášáš‚ášáš…ᚑ ᚅᚔᚋᚌᚓᚅášášœ +
  35. Old Irish (Latin): Con·iccim ithi nglano. Ním·géna. + +
  36. Irish: Is féidir liom gloinne a ithe. Ní dhéanann sí dochar ar bith dom. + +
  37. Scottish Gaelic: S urrainn dhomh gloinne ithe; cha ghoirtich i mi. +
  38. Anglo-Saxon (Runes): +á›áš³á›«á›—ᚨᚷ᛫ᚷᛚᚨᛋ᛫ᛖᚩá›ášªáš¾á›«áš©áš¾á›žá›«áš»á›á›á›«áš¾á›–᛫ᚻᛖᚪᚱᛗá›ášªáš§á›«á›—ᛖ᛬ +
  39. Anglo-Saxon (Latin): Ic mæg glæs eotan ond hit ne hearmiað me. +
  40. Middle English: Ich canne glas eten and hit hirtiþ me nouÈt. +
  41. English: I can eat glass and it doesn't hurt me. +
  42. English (IPA): [aɪ kæn iËt glÉ‘Ës ænd ɪt dÉz nÉ’t hÉœËt miË] (Received Pronunciation) +
  43. English (Braille): ⠊⠀⠉â â â €â ‘â â žâ €â ›â ‡â â Žâ Žâ €â â â ™â €â Šâ žâ €â ™â •â ‘â Žâ â žâ €â “⠥⠗⠞⠀â â ‘ +
  44. Lalland Scots / Doric: Ah can eat gless, it disnae hurt us. +
    Glaswegian: (NEEDED) +
  45. Gothic (4): +ðŒ¼ðŒ°ðŒ² +ðŒ²ðŒ»ðŒ´ðƒ +ðŒ¹Ìˆð„ðŒ°ðŒ½, +ðŒ½ðŒ¹ +ðŒ¼ðŒ¹ðƒ +ð…ðŒ¿ +ðŒ½ðŒ³ðŒ°ðŒ½ +ðŒ±ð‚ðŒ¹ðŒ²ðŒ²ðŒ¹ðŒ¸. +
  46. Old Norse (Runes): á›–áš´ áš·á›–á› á›–á›á› +áš§ ᚷᛚᛖᚱ ᛘᚾ +ᚦᛖᛋᛋ ᚨᚧ ᚡᛖ +ᚱᚧᚨ ᛋᚨᚱ + +
  47. Old Norse (Latin): Ek get etið gler án þess að verða sár. + +
  48. Norsk / Norwegian (Nynorsk): Eg kan eta glas utan å skada meg. +
  49. Norsk / Norwegian (Bokmål): Jeg kan spise glass uten å skade meg. +
    Føroyskt / Faroese: (NEEDED) +
  50. Ãslenska / Icelandic: Ég get etið gler án þess að meiða mig. +
  51. Svenska / Swedish: Jag kan äta glas utan att skada mig. +
  52. Dansk / Danish: Jeg kan spise glas, det gør ikke ondt på mig. +
  53. Soenderjysk: Æ ka æe glass uhen at det go mæ naue. +
  54. Frysk / Frisian: Ik kin glês ite, it docht me net sear. + + + +
  55. Nederlands / Dutch: Ik kan glas eten, het doet +mij +geen kwaad. + + +
  56. Kirchröadsj/Bôchesserplat: Iech ken glaas èèse, mer 't deet miech +jing pieng.
  57. + +
  58. Afrikaans: Ek kan glas eet, maar dit doen my nie skade nie. +
  59. Lëtzebuergescht / Luxemburgish: Ech kan Glas iessen, daat deet mir nët wei. +
  60. Deutsch / German: Ich kann Glas essen, ohne mir weh zu tun. +
  61. Ruhrdeutsch: Ich kann Glas verkasematuckeln, ohne dattet mich wat jucken tut. +
  62. Langenfelder Platt: +Isch kann Jlaas kimmeln, uuhne datt mich datt weh dääd. +
  63. Lausitzer Mundart ("Lusatian"): Ich koann Gloos assn und doas +dudd merr ni wii. +
  64. Odenwälderisch: Iech konn glaasch voschbachteln ohne dass es mir ebbs daun doun dud. +
  65. Sächsisch / Saxon: 'sch kann Glos essn, ohne dass'sch mer wehtue. +
  66. Pfälzisch: Isch konn Glass fresse ohne dasses mer ebbes ausmache dud. +
  67. Schwäbisch / Swabian: I kå Glas frässa, ond des macht mr nix! +
  68. Bayrisch / Bavarian: I koh Glos esa, und es duard ma ned wei. +
  69. Allemannisch: I kaun Gloos essen, es tuat ma ned weh. +
  70. Schwyzerdütsch: Ich chan Glaas ässe, das tuet mir nöd weeh. +
  71. Hungarian: Meg tudom enni az üveget, nem lesz tőle bajom. +
  72. Suomi / Finnish: Voin syödä lasia, se ei vahingoita minua. +
  73. Sami (Northern): Sáhtán borrat lása, dat ii leat bávÄÄas. +
  74. Erzian: Мон ÑÑ€Ñан +Ñуликадо, ды +зыÑн +ÑйÑÑ‚ÑÐ½Ð·Ñ Ð° +ули. +
    Karelian: (NEEDED) +
    Vepsian: (NEEDED) +
    Votian: (NEEDED) +
    Livonian: (NEEDED) +
  75. Estonian: Ma võin klaasi süüa, see ei tee mulle midagi. +
  76. Latvian: Es varu ēst stiklu, tas man nekaitē. +
  77. Lithuanian: Aš galiu valgyti stiklą ir jis manęs nežeidžia +
    Old Prussian: (NEEDED) +
    Sorbian (Wendish): (NEEDED) +
  78. Czech: Mohu jíst sklo, neublíží mi. +
  79. Slovak: Môžem jesť sklo. Nezraní ma. +
  80. Polska / Polish: Mogę jeść szkło i mi nie szkodzi. +
  81. Slovenian: Lahko jem steklo, ne da bi mi škodovalo. +
  82. Croatian: Ja mogu jesti staklo i ne boli me. +
  83. Serbian (Latin): Mogu jesti staklo a da mi ne škodi. +
  84. Serbian (Cyrillic): Могу јеÑти Ñтакло +а +да ми +не +шкоди. +
  85. Macedonian: Можам да јадам Ñтакло, а не ме штета. +
  86. Russian: Я могу еÑть Ñтекло, оно мне не вредит. +
  87. Belarusian (Cyrillic): Я магу еÑці шкло, Ñно мне не шкодзіць. +
  88. Belarusian (Lacinka): Ja mahu jeści škło, jano mne ne škodzić. +
  89. Ukrainian: Я можу Ñ—Ñти шкло, й воно мені не пошкодить. + +
  90. Bulgarian: Мога да Ñм Ñтъкло, то не ми вреди. + +
  91. Georgian: მინáƒáƒ¡ ვჭáƒáƒ› დრáƒáƒ áƒ მტკივáƒ. +
  92. Armenian: Ô¿Ö€Õ¶Õ¡Õ´ Õ¡ÕºÕ¡Õ¯Õ« Õ¸Ö‚Õ¿Õ¥Õ¬ Ö‡ Õ«Õ¶Õ®Õ« Õ¡Õ¶Õ°Õ¡Õ¶Õ£Õ«Õ½Õ¿ Õ¹Õ¨Õ¶Õ¥Ö€Ö‰ +
  93. Albanian: Unë mund të ha qelq dhe nuk më gjen gjë. +
  94. Turkish: Cam yiyebilirim, bana zararı dokunmaz. +
  95. Turkish (Ottoman): جام ييه بلورم بڭا ضررى طوقونمز +
  96. Bangla / Bengali: +আমি কাà¦à¦š খেতে পারি, তাতে আমার কোনো কà§à¦·à¦¤à¦¿ হয় না। +
  97. Marathi: मी काच खाऊ शकतो, मला ते दà¥à¤–त नाही. +
  98. Hindi: मैं काà¤à¤š खा सकता हूà¤, मà¥à¤à¥‡ उस से कोई पीडा नहीं होती. +
  99. Tamil: நான௠கணà¯à®£à®¾à®Ÿà®¿ சாபà¯à®ªà®¿à®Ÿà¯à®µà¯‡à®©à¯, அதனால௠எனகà¯à®•௠ஒர௠கேடà¯à®®à¯ வராதà¯. + +
  100. Urdu(2): + میں کانچ کھا سکتا ÛÙˆÚº اور مجھے تکلی٠نÛیں Ûوتی Û” +
  101. Pashto(2): زه شيشه Ø®ÙˆÚ“Ù„Û Ø´Ù…ØŒ هغه ما نه خوږوي +
  102. Farsi / Persian: .من می توانم بدون٠احساس درد شيشه بخورم +
  103. Arabic(2): أنا قادر على أكل الزجاج و هذا لا يؤلمني. +
    Aramaic: (NEEDED) +
  104. Hebrew(2): ×× ×™ יכול ל×כול זכוכית וזה ×œ× ×ž×–×™×§ לי. +
  105. Yiddish(2): ×יך קען עסן גל×ָז ×ון עס טוט מיר נישט װײ. +
    Judeo-Arabic: (NEEDED) +
    Ladino: (NEEDED) +
    GÇʼÇz: (NEEDED) +
    Amharic: (NEEDED) +
  106. Twi: Metumi awe tumpan, ɜnyɜ me hwee. +
  107. Hausa (Latin): Inā iya taunar gilāshi kuma in gamā lāfiyā. +
  108. Hausa (Ajami) (2): +Ø¥Ùنا Ø¥ÙÙ‰ÙŽ تَونَر غÙلَاش٠كÙÙ…ÙŽ Ø¥ÙÙ† غَمَا لَاÙÙىَا +
  109. Yoruba(3): Mo lè je̩ dígí, kò ní pa mí lára. +
  110. (Ki)Swahili: Naweza kula bilauri na sikunyui. + +
  111. Malay: Saya boleh makan kaca dan ia tidak mencederakan saya. +
  112. Tagalog: Kaya kong kumain nang bubog at hindi ako masaktan. +
  113. Chamorro: Siña yo' chumocho krestat, ti ha na'lalamen yo'. +
  114. Javanese: Aku isa mangan beling tanpa lara. +
  115. Burmese: +က္ယ္á€á€”္‌á€á€±á€¬á€¹â€ŒáŠá€€á€¹á€šá€¹á€á€”္‌မ မ္ယက္‌စားနုိင္‌သည္‌ዠáŽá€€á€¹á€›á€±á€¬á€„္‌့ +ထိá€á€¯á€­á€€á€¹â€Œá€™á€¹á€Ÿá€¯ မရ္ဟိပာዠ+(7) + +
  116. Vietnamese (quốc ngữ): Tôi có thể ăn thủy tinh mà không hại gì. +
  117. Vietnamese (nôm) (4): 些 𣎠世 咹 水 晶 𦓡 空 𣎠害 咦 +
    Khmer: (NEEDED) +
    Lao: (NEEDED) +
  118. Thai: ฉันà¸à¸´à¸™à¸à¸£à¸°à¸ˆà¸à¹„ด้ à¹à¸•่มันไม่ทำให้ฉันเจ็บ +
  119. Mongolian (Cyrillic): Би шил идÑй чадна, надад хортой биш +
  120. Mongolian (Classic) (5): + ᠪᠢ ᠰᠢᠯᠢ ᠢᠳᠡᠶᠦ ᠴᠢᠳᠠᠨᠠ ᠂ ᠨᠠᠳᠤᠷ ᠬᠣᠤᠷᠠᠳᠠᠢ ᠪᠢᠰᠢ +
    Dzongkha: (NEEDED) +
    Nepali: (NEEDED) +
  121. Tibetan: ཤེལ་སྒོ་ཟ་ནས་ང་ན་གི་མ་རེད༠+
  122. Chinese: 我能åžä¸‹çŽ»ç’ƒè€Œä¸ä¼¤èº«ä½“。 +
  123. Chinese (Traditional): 我能åžä¸‹çŽ»ç’ƒè€Œä¸å‚·èº«é«”。 + +
  124. Taiwanese(6): Góa Ä“-tàng chiaÌh po-lê, mÄ bÄ“ tioÌh-siong. +
  125. Japanese: ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™ã€‚ãれã¯ç§ã‚’å‚·ã¤ã‘ã¾ã›ã‚“。 +
  126. Korean: 나는 유리를 ë¨¹ì„ ìˆ˜ 있어요. ê·¸ëž˜ë„ ì•„í”„ì§€ 않아요 +
  127. Bislama: Mi save kakae glas, hemi no save katem mi.
    +
  128. Hawaiian: Hiki iaÊ»u ke Ê»ai i ke aniani; Ê»aÊ»ole nÅ lÄ au e Ê»eha.
    +
  129. Marquesan: E koÊ»ana e kai i te karahi, mea Ê»Ä, Ê»aÊ»e hauhau. +
  130. Chinook Jargon: Naika məkmək kakshət labutay, pi weyk ukuk munk-sik nay. +
  131. Navajo: Tsésǫʼ yishÄ…ÌÄ…go bííníshghah dóó doo shiÅ‚ neezgai da. +
    Cherokee (and Cree, Ojibwa, Inuktitut, and other Native American languages): (NEEDED) +
    Garifuna: (NEEDED) +
    Gullah: (NEEDED) +
  132. Lojban: mi kakne le nu citka le blaci .iku'i le se go'i na xrani mi +
  133. Nórdicg: Ljœr ye caudran créneþ ý jor cẃran. +
+

+ +(Additions, corrections, completions, +gratefully accepted.) + +

+For testing purposes, some of these are repeated in a monospace font . . . +

+

    +
  1. Euro Symbol: €. +
  2. Greek: ΜποÏÏŽ να φάω σπασμένα γυαλιά χωÏίς να πάθω τίποτα. +
  3. Ãslenska / Icelandic: Ég get etið gler án þess að meiða mig. + +
  4. Polish: Mogę jeść szkło, i mi nie szkodzi. +
  5. Romanian: Pot să mănânc sticlă și ea nu mă rănește. +
  6. Ukrainian: Я можу Ñ—Ñти шкло, й воно мені не пошкодить. +
  7. Armenian: Ô¿Ö€Õ¶Õ¡Õ´ Õ¡ÕºÕ¡Õ¯Õ« Õ¸Ö‚Õ¿Õ¥Õ¬ Ö‡ Õ«Õ¶Õ®Õ« Õ¡Õ¶Õ°Õ¡Õ¶Õ£Õ«Õ½Õ¿ Õ¹Õ¨Õ¶Õ¥Ö€Ö‰ +
  8. Georgian: მინáƒáƒ¡ ვჭáƒáƒ› დრáƒáƒ áƒ მტკივáƒ. +
  9. Hindi: मैं काà¤à¤š खा सकता हूà¤, मà¥à¤à¥‡ उस से कोई पीडा नहीं होती. +
  10. Hebrew(2): ×× ×™ יכול ל×כול זכוכית וזה ×œ× ×ž×–×™×§ לי. +
  11. Yiddish(2): ×יך קען עסן גל×ָז ×ון עס טוט מיר נישט װײ. +
  12. Arabic(2): أنا قادر على أكل الزجاج و هذا لا يؤلمني. +
  13. Japanese: ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™ã€‚ãれã¯ç§ã‚’å‚·ã¤ã‘ã¾ã›ã‚“。 +
  14. Thai: ฉันà¸à¸´à¸™à¸à¸£à¸°à¸ˆà¸à¹„ด้ à¹à¸•่มันไม่ทำให้ฉันเจ็บ +
+

+ +Notes: + +

+

    + +
  1. The "I can eat glass" phrase and initial translations (about 30 of them) +were borrowed from Ethan Mollick's I Can Eat Glass page +(which disappeared on or about June 2004) and converted to UTF-8. Since +Ethan's original page is gone, I should mention that his purpose was to offer +travelers a phrase they could use in any country that would command a +certain kind of respect, or at least get attention. See Credits for the many additional contributions since +then. When submitting new entries, the word "hurt" (if you have a choice) +is used in the sense of "cause harm", "do damage", or "bother", rather than +"inflict pain" or "make sad". In this vein Otto Stolz comments (as do +others further down; personally I think it's better for the purpose of this +page to have extra entries and/or to show a greater repertoire of characters +than it is to enforce a strict interpretation of the word "hurt"!): + +

    + +
    + + +This is the meaning I have translated to the Swabian dialect. + +However, I just have noticed that most of the German variants +translate the "inflict pain" meaning. The German example should rather +read: + +

    +

    +"Ich kann Glas essen ohne mir zu schaden." +
    +

    + +(The comma fell victim to the 1996 orthographic reform, +cf. http://www.ids-mannheim.de/reform/e3-1.html#P76. + +

    + +You may wish to contact the contributors of the following translations +to correct them: + +

    +

      + +
    • Lëtzebuergescht / Luxemburgish: Ech kan Glas iessen, daat deet mir nët wei. +
    • Lausitzer Mundart ("Lusatian"): Ich koann Gloos assn und doas dudd merr ni wii. +
    • Sächsisch / Saxon: 'sch kann Glos essn, ohne dass'sch mer wehtue. +
    • Bayrisch / Bavarian: I koh Glos esa, und es duard ma ned wei. +
    • Allemannisch: I kaun Gloos essen, es tuat ma ned weh. +
    • Schwyzerdütsch: Ich chan Glaas ässe, das tuet mir nöd weeh. +
    +

    + +In contrast, I deem the following translations *alright*: + +

    +

      + +
    • Ruhrdeutsch: Ich kann Glas verkasematuckeln, ohne dattet mich wat jucken tut. +
    • Pfälzisch: Isch konn Glass fresse ohne dasses mer ebbes ausmache dud. +
    • Schwäbisch / Swabian: I kÃ¥ Glas frässa, ond des macht mr nix! +
    +

    + +(However, you could remove the commas, on account of +http://www.ids-mannheim.de/reform/e3-1.html#P76 +and + +http://www.ids-mannheim.de/reform/e3-1.html#P72, respectively.) + +

    + +I guess, also these examples translate the wrong sense of "hurt", +though I do not know these languages well enough to assert them +definitely: + +

    +

      + +
    • Nederlands / Dutch: Ik kan glas eten; het doet mij geen +pijn. (This one has been changed) +
    • Kirchröadsj/Bôchesserplat: Iech ken glaas èèse, mer 't deet miech jing pieng. + +
    +

    + +In the Romanic languages, the variations on "fa male" (it) are probably +wrong, whilst the variations on "hace daño" (es) and "damaÄas" (Esperanto) are probably correct; "nocet" (la) is definitely right. + +

    + +The northern Germanic variants of "skada" are probably right, as are +the Slavic variants of "škodi/шкоди" (se); however the Slavic variants +of " boli" (hv) are probably wrong, as "bolena" means "pain/ache", IIRC. + + +

    +
    +

    + +The numbering of the samples is arbitrary, done only to keep track of how +many there are, and can change any time a new entry is added. The +arrangement is also arbitrary but with some attempt to group related +examples together. Note: All languages not listed are wanted, not just the +ones that say (NEEDED). + +

  2. Correct right-to-left display of these languages +depends on the capabilities of your browser. The period should +appear on the left. In the monospace Yiddish example, the Yiddish digraphs +should occupy one character cell. + +
  3. Yoruba: The third word is Latin letter small 'j' followed by +small 'e' with U+0329, Combining Vertical Line Below. This displays +correctly only if your Unicode font includes the U+0329 glyph and your +browser supports combining diacritical marks. The Indic examples +also include combining sequences. + +
  4. Includes Unicode 3.1 (or later) characters beyond Plane 0. + +
  5. The Classic Mongolian example should be vertical, top-to-bottom and +left-to-right. But such display is almost impossible. Also no font yet +exists which provides the proper ligatures and positional variants for the +characters of this script, which works somewhat like Arabic. + +
  6. Taiwanese is also known as Holo or Hoklo, and is related to Southern +Min dialects such as Amoy. +Contributed by Henry H. Tan-Tenn, who comments, "The above is +the romanized version, in a script current among Taiwanese Christians since +the mid-19th century. It was invented by British missionaries and saw use in +hundreds of published works, mostly of a religious nature. Most Taiwanese did +not know Chinese characters then, or at least not well enough to read. More +to the point, though, a written standard using Chinese characters has never +developed, so a significant minority of words are represented with different +candidate characters, depending on one's personal preference or etymological +theory. In this sentence, for example, "-tàng", "chiaÌh", +"mÄ" and "bÄ“" are problematic using Chinese characters. +"Góa" (I/me) and "po-lê" (glass) are as written in other Sinitic +languages (e.g. Mandarin, Hakka)." + +
  7. Wagner Amaral of Pinese & Amaral Associados notes that +the Brazilian Portuguese sentence for +"I can eat glass" should be identical to the Portuguese one, as the word +"machuca" means "inflict pain", or rather "injuries". The words "faz +mal" would more correctly translate as "cause harm". + +
  8. Burmese: In English the first person pronoun "I" stands for both +genders, male and female. In Burmese (except in the central part of Burma) +kyundaw (က္ယ္á€á€”္‌á€á€±á€¬á€¹â€Œ) for male and kyanma (က္ယ္á€á€”္‌မ) for female. +Using here a fully-compliant Unicode Burmese font -- sadly one and only Padauk +Graphite font exists -- rendering using graphite engine. +CLICK HERE to test Burmese +characters. + +
+ +
+

The Quick Brown Fox

+ +The "I can eat glass" sentences do not necessarily show off the orthography of +each language to best advantage. In many alphabetic written languages it is +possible to include all (or most) letters (or "special" characters) in +a single (often nonsense) pangram. These were traditionally used in +typewriter instruction; now they are useful for stress-testing computer fonts +and keyboard input methods. Here are a few examples (SEND MORE): + +

+

    + +
  1. English: The quick brown fox jumps over the lazy dog. +
  2. Irish: "An ḃfuil do Ä‹roí ag bualaḋ ó ḟaitíos an Ä¡rá a á¹eall lena ṗóg éada ó +ṡlí do leasa ṫú?" +"D'ḟuascail Ãosa Úrá¹ac na hÓiÄ¡e Beannaiṫe pór Éava agus Ãḋaiá¹." +
  3. Dutch: Pa's wijze lynx bezag vroom het fikse aquaduct. +
  4. German: Falsches Üben von Xylophonmusik quält jeden +größeren Zwerg. (1) +
  5. German: Im finſteren Jagdſchloß am offenen Felsquellwaſſer patzte der affig-flatterhafte kauzig-höf‌liche Bäcker über ſeinem verſifften kniffligen C-Xylophon. (2) +
  6. Swedish: Flygande bäckasiner söka strax hwila på mjuka tuvor. +
  7. Icelandic: Sævör grét áðan því úlpan var ónýt. +
  8. Polish: Pchnąć w tę łódź jeża lub ośm skrzyń fig. +
  9. Czech: PříliÅ¡ +žluÅ¥ouÄký kůň úpÄ›l +Äábelské kódy. +
  10. Slovak: Starý kôň na hÅ•be +kníh žuje tíško povädnuté +ruže, na stĺpe sa Äateľ +uÄí kvákaÅ¥ novú ódu o +živote. +
  11. Russian: Ð’ чащах +юга жил-был +цитруÑ? Да, +но +фальшивый +ÑкземплÑÑ€! +ёъ. + +
  12. Bulgarian: Жълтата Ð´ÑŽÐ»Ñ Ð±ÐµÑˆÐµ щаÑтлива, че пухът, който цъфна, замръзна като гьон. + +
  13. Sami (Northern): Vuol Ruoŧa geÄ‘ggiid leat máŋga luosa ja Äuovžža. +
  14. Hungarian: ÃrvíztűrÅ‘ tükörfúrógép. +
  15. Spanish: El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y frío, añoraba a su querido cachorro. +
  16. Portuguese: O próximo vôo à noite sobre o Atlântico, põe freqüentemente o único médico. (3) +
  17. French: Les naïfs ægithales hâtifs pondant à Noël où il gèle sont sûrs d'être +déçus et de voir leurs drôles d'œufs abîmés. + +
  18. Esperanto: EÄ¥oÅanÄo +ĉiuĵaÅ­de. + +
  19. Hebrew: ×–×” ×›×™×£ ×¡×ª× ×œ×©×ž×•×¢ ×יך תנצח קרפד ×¢×¥ טוב בגן. + +
  20. Japanese (Hiragana):
    +ã„ã‚ã¯ã«ã»ã¸ã©ã€€ã¡ã‚Šã¬ã‚‹ã‚’
    +ã‚ãŒã‚ˆãŸã‚Œãžã€€ã¤ã­ãªã‚‰ã‚€
    +ã†ã‚ã®ãŠãã‚„ã¾ã€€ã‘ãµã“ãˆã¦
    +ã‚ã•ãゆã‚ã¿ã˜ã€€ã‚‘ã²ã‚‚ã›ãš +(4) +
    + +
+

+Notes: +

+

    + +
  1. Other phrases commonly used in Germany include: "Ein wackerer Bayer +vertilgt ja bequem zwo Pfund Kalbshaxe" and, more recently, "Franz jagt im +komplett verwahrlosten Taxi quer durch Bayern", but both lack umlauts and +esszet. Previously, going for the shortest sentence that has all the +umlauts and special characters, I had +"Grüße aus Bärenhöfe +(und Óechtringen)!" +Acute accents are not used in native German words, so I was surprised to +discover "Óechtringen" in the Deutsche Bundespost +Postleitzahlenbuch: +

    +

    +Click for full-size image (2.8MB) +
    +

    +It's a small village in eastern Lower Saxony. +The "oe" in this case +turns out to be the Lower Saxon "lengthening e" (Dehnungs-e), which makes the +previous vowel long (used in a number of Lower Saxon place names such as Soest +and Itzehoe), not the "e" that indicates umlaut of the preceding vowel. +Many thanks to the Óechtringen-Namenschreibungsuntersuchungskomitee +(Alex Bochannek, Manfred Erren, Asmus Freytag, Christoph Päper, plus +Werner Lemberg who serves as +Óechtringen-Namenschreibungsuntersuchungskomiteerechtschreibungsprüfer) + +for their relentless pursuit of the facts in this case. Conclusion: the +accent almost certainly does not belong on this (or any other native German) +word, but neither can it be dismissed as dirt on the page. To add to the +mystery, it has been reported that other copies of the same edition of the +PLZB do not show the accent! UPDATE (March 2006): David Krings was +intrigued enough by this report to contact the mayor of Ebstorf, of which +Oechtringen is a borough, who responded: + +

    +

    +Sehr geehrter Mr. Krings,
    +wenn Oechtringen irgendwo mit einem Akzent auf dem O geschrieben wurde, +dann kann das nur ein Fehldruck sein. Die offizielle Schreibweise lautet +jedenfalls „Oechtringen“.
    +Mit freundlichen Grüssen
    +Der Samtgemeindebürgermeister
    +i.A. Lothar Jessel + +
    + + +

    +

  2. From Karl Pentzlin (Kochel am See, Bavaria, Germany): +"This German phrase is suited for display by a Fraktur (broken letter) +font. It contains: all common three-letter ligatures: ffi ffl fft and all +two-letter ligatures required by the Duden for Fraktur typesetting: ch ck ff +fi fl ft ll ſch ſi ſſ ſt tz (all in a +manner such they are not part of a three-letter ligature), one example of f-l +where German typesetting rules prohibit ligating (marked by a ZWNJ), and all +German letters a...z, ä,ö,ü,ß, ſ [long s] +(all in a manner such that they are not part of a two-letter Fraktur +ligature)." + +Otto Stolz notes that "'Schloß' is now spelled 'Schloss', in +contrast to 'größer' (example 4) which has kept its +'ß'. Fraktur has been banned from general use, in 1942, and long-s +(ſ) has ceased to be used with Antiqua (Roman) even earlier (the +latest Antiqua-ſ I have seen is from 1913, but then +I am no expert, so there may well be a later instance." Later Otto confirms +the latter theory, "Now I've run across a book “Deutsche +Rechtschreibung†(edited by Lutz Mackensen) from 1954 (my reprint +is from 1956) that has kept the Antiqua-ſ in its dictionary part (but +neither in the preface nor in the appendix)." + +

    + +

  3. Diaeresis is not used in Iberian Portuguese. + +

    + +

  4. From Yurio Miyazawa: "This poetry contains all the sounds in the +Japanese language and used to be the first thing for children to learn in +their Japanese class. The Hiragana version is particularly neat because it +covers every character in the phonetic Hiragana character set." Yurio also +sent the Kanji version: + +

    +

    +色ã¯åŒ‚ã¸ã© 散りã¬ã‚‹ã‚’
    +我ãŒä¸–誰㞠常ãªã‚‰ã‚€
    +有為ã®å¥¥å±± 今日越ãˆã¦
    +æµ…ã夢見㘠酔ã²ã‚‚ã›ãš +
    + +
+

+Accented Cyrillic: +

+ +(This section contributed by Vladimir Marinov.) + +

+ +In Bulgarian it is desirable, customary, or in some cases required to +write accents over vowels. Unfortunately, no computer character sets +contain the full repertoire of accented Cyrillic letters. With Unicode, +however, it is possible to combine any Cyrillic letter with any combining +accent. The appearance of the result depends on the font and the rendering +engine. Here are two examples. + +

+

    + +
  1. Той Ð²Ð¸Ð´Ñ Ð±Ñлата коÑÐ°Ì Ð¿Ð¾ главата Ð¸Ì Ð¸ коÌÑа на рамото иÌ, и реÌче да Ð¸Ì +речеÌ: "ПараÌта Ð¿Ð¾Ì Ð¿Ð°Ìри от паÌрата, не ща париÌ!", но Ñи помиÌÑли: "Хей, +помиÑÐ»Ð¸Ì Ñи! ÐÌ Ð¸Ì Ñ€ÐµÐºÐ°, Ð°Ì Ðµ Ñкочила в тази река, коÑто щеше да течеÌ, +а не теÌче." + +

    + +

  2. По пъÌÑ‚Ñ Ð¿ÑŠÑ‚ÑƒÌват кюÌрди и югоÑлавÑÌни. + +
+ +
+

HTML Features

+ +Here is the Russian alphabet (uppercase only) coded in three +different ways, which should look identical: + +

+

    +
  1. ÐБВГДЕЖЗИЙКЛМÐОПРСТУФХЦЧШЩЪЫЬЭЮЯ +  (Literal UTF-8) +
  2. АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ +  (Decimal numeric character reference) +
  3. АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ +  (Hexadecimal numeric character reference) +
+ +

+ +In another test, we use HTML language tags to distinguish Bulgarian, Russian, +and Serbian, +which have different italic forms for lowercase +б, г, д, п, and/or т: +

+

+ + + + +
Bulgarian:   +[ Ð±Ð³Ð´Ð¿Ñ‚ ]   +бгдпт ]   + Мога да Ñм Ñтъкло и не ме боли. +
Russian: +[ Ð±Ð³Ð´Ð¿Ñ‚ ]   +бгдпт ]   +Я могу еÑть Ñтекло, Ñто мне не вредит. +
Serbian: +[ Ð±Ð³Ð´Ð¿Ñ‚ ]   +бгдпт ]   + Могу јеÑти Ñтакло +а +да ми +не +шкоди. +
+
+

+ +


+

Credits, Tools, and Commentary

+ +
+
Credits:
+
+The "I can eat glass" phrase and the initial collection of translations: +Ethan Mollick. +Transcription / conversion to UTF-8: Frank da Cruz. +Albanian: Sindi Keesan. +Afrikaans: Johan Fourie, Kevin Poalses. +Anglo Saxon: Frank da Cruz. +Arabic: Najib Tounsi. +Armenian: Vaçe Kundakçı. +Belarusian: Alexey Chernyak. +Bengali: Somnath Purkayastha, Deepayan Sarkar. +Bislama: Dan McGarry. +Braille: Frank da Cruz. +Bulgarian: Sindi Keesan, Guentcho Skordev, Vladimir Marinov. +Burmese: "cetanapa". +Cabo Verde Creole: Cláudio Alexandre Duarte. +Catalán: Jordi Bancells. +Chinese: Jack Soo, Wong Pui Lam. +Chinook Jargon: David Robertson. +Cornish: Chris Stephens. +Croatian: Marjan Baće. +Czech: Stanislav Pecha, Radovan Garabík. +Dutch: Peter Gotink. Pim Blokland, Rob Daniel, Rob de Wit. +Erzian: Jack Rueter. +Esperanto: Franko Luin, Radovan Garabík. +Estonian: Meelis Roos. +Farsi/Persian: Payam Elahi. +Finnish: Sampsa Toivanen. +French: Luc Carissimo, Anne Colin du Terrail, Sean M. Burke. +Galician: Laura Probaos. +Georgian: Giorgi Lebanidze. +German: Christoph Päper, Otto Stolz, Karl Pentzlin, David Krings, +Frank da Cruz. +Gothic: Aurélien Coudurier. +Greek: Ariel Glenn, Constantine Stathopoulos, Siva Nataraja. +Hebrew: Jonathan Rosenne, Tal Barnea. +Hausa: Malami Buba, Tom Gewecke. +Hawaiian: na HauÊ»oli Motta, Anela de Rego, Kaliko Trapp. +Hindi: Shirish Kalele. +Hungarian: András Rácz, Mark Holczhammer. +Icelandic: Andrés Magnússon, Sveinn Baldursson. +International Phonetic Alphabet (IPA): Siva Nataraja / Vincent Ramos. +Irish: Michael Everson, Marion Gunn, James Kass, Curtis Clark. +Italian: Thomas De Bellis. +Japanese: Makoto Takahashi, Yurio Miyazawa. +Kirchröadsj: Roger Stoffers. +Kreyòl: Sean M. Burke. +Korean: Jungshik Shin. +Langenfelder Platt: David Krings. +Lëtzebuergescht: Stefaan Eeckels. +Lithuanian: Gediminas Grigas. +Lojban: Edward Cherlin. +Lusatian: Ronald Schaffhirt. +Macedonian: Sindi Keesan. +Malay: Zarina Mustapha. +Manx: Éanna Ó Brádaigh. +Marathi: Shirish Kalele. +Marquesan: Kaliko Trapp. +Middle English: Frank da Cruz. +Milanese: Marco Cimarosti. +Mongolian: Tom Gewecke. +Napoletano: Diego Quintano. +Navajo: Tom Gewecke. +Nórdicg: +Yẃlyan Rott. +Norwegian: Herman Ranes. +Odenwälderisch: Alexander Heß. +Old Irish: Michael Everson. +Old Norse: Andrés Magnússon. +Papiamentu: Bianca and Denise Zanardi. +Pashto: N.R. Liwal. +Pfälzisch: Dr. Johannes Sander. +Picard: Philippe Mennecier. +Polish: Juliusz Chroboczek, PaweÅ‚ Przeradowski. +Portuguese: "Cláudio" Alexandre Duarte, Bianca and Denise +Zanardi, Pedro Palhoto Matos, Wagner Amaral. +Québécois: Laurent Detillieux. +Roman: Pierpaolo Bernardi. +Romanian: Juliusz Chroboczek, Ionel Mugurel. +Ruhrdeutsch: "Timwi". +Russian: Alexey Chernyak, Serge Nesterovitch. +Sami: Anne Colin du Terrail, Luc Carissimo. +Sanskrit: Siva Nataraja / Vincent Ramos. +Sächsisch: André Müller. +Schwäbisch: Otto Stolz. +Scots: Jonathan Riddell. +Serbian: Sindi Keesan, Ranko Narancic, Boris Daljevic, Szilvia Csorba. +Slovak: G. Adam Stanislav, Radovan Garabík. +Slovenian: Albert Kolar. +Spanish: Aleida +Muñoz, Laura Probaos. +Swahili: Ronald Schaffhirt. +Swedish: Christian Rose, Bengt Larsson. +Taiwanese: Henry H. Tan-Tenn. +Tagalog: Jim Soliven. +Tamil: Vasee Vaseeharan. +Tibetan: D. Germano, Tom Gewecke. +Thai: Alan Wood's wife. +Turkish: Vaçe Kundakçı, Tom Gewecke, Merlign Olnon. +Ukrainian: Michael Zajac. +Urdu: Mustafa Ali. +Vietnamese: Dixon Au, +[James] Äá»— Bá Phước +杜 伯 福. +Walloon: Pablo Saratxaga. +Welsh: Geiriadur Prifysgol Cymru (Andrew). +Yiddish: Mark David, +Zeneise: Angelo Pavese. + +

+ +

Tools Used to Create This Web Page:
+ +
The UTF8-aware Kermit 95 terminal emulator on +Windows, to a Unix host with the EMACS text editor. Kermit +95 displays UTF-8 and also allows keyboard entry of arbitrary Unicode BMP +characters as 4 hex digits, as shown HERE. Hex codes +for Unicode values can be found in The Unicode +Standard (recommended) and the online code charts. When +submissions arrive by email encoded in some other character set (Latin-1, +Latin-2, KOI, various PC code pages, JEUC, etc), I use the TRANSLATE command +of C-Kermit on the Unix host (where I read my mail) to convert the character set to +UTF-8 (I could also use Kermit 95 for this; it has the same TRANSLATE +command). That's it -- no "Web authoring" tools, no locales, no "smart" +anything. It's just plain text, nothing more. By the way, there's nothing +special about EMACS -- any text editor will do, providing it allows entry of +arbitrary 8-bit bytes as text, including the 0x80-0x9F "C1" range. EMACS 21.1 +actually supports UTF-8; earlier versions don't know about it and display the +octal codes; either way is OK for this purpose. + +

+ +

Commentary: +
Date: Wed, 27 Feb 2002 13:21:59 +0100
+From: "Bruno DEDOMINICIS" <b.dedominicis@cite-sciences.fr>
+Subject: Je peux manger du verre, cela ne me fait pas mal. + +

+ +I just found out your website and it makes me feel like proposing an +interpretation of the choice of this peculiar phrase. + +

+ +Glass is transparent and can hurt as everyone knows. The relation between +people and civilisations is sometimes effusional and more often rude. The +concept of breaking frontiers through globalization, in a way, is also an +attempt to deny any difference. Isn't "transparency" the flag of modernity? +Nothing should be hidden any more, authority is obsolete, and the new powers +are supposed to reign through loving and smiling and no more through +coercion... + +

+ +Eating glass without pain sounds like a very nice metaphor of this attempt. +That is, frontiers should become glass transparent first, and be denied by +incorporating them. On the reverse, it shows that through globalization, +frontiers undergo a process of displacement, that is, when they are not any +more speakable, they become repressed from the speech and are therefore +incorporated and might become painful symptoms, as for example what happens +when one tries to eat glass. + +

+ +The frontiers that used to separate bodies one from another tend to divide +bodies from within and make them suffer.... The chosen phrase then appears +as a denial of the symptom that might result from the destitution of +traditional frontiers. + +

+Best,
+Bruno De Dominicis, Paris, France +

+ +

+Other Unicode pages onsite: +

+

+Unicode samplers offsite: +

+

+Unicode fonts: +

+ +

+[ Kermit 95 ] +[ K95 Screen Shots ] +[ C-Kermit ] +[ Kermit Home ] +[ Display Problems? ] +[ The Unicode Consortium ] +


+
+UTF-8 Sampler / The Kermit Project / +Columbia University / +kermit@columbia.edu +
+ + diff --git a/vendor/gems/hpricot-0.6/test/files/week9.html b/vendor/gems/hpricot-0.6/test/files/week9.html new file mode 100644 index 0000000..932e2da --- /dev/null +++ b/vendor/gems/hpricot-0.6/test/files/week9.html @@ -0,0 +1,1723 @@ + + + +NFL Football Scores - CBS SportsLine.com + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+
+ + + +
+ +
Scoreboard presented by
XXLXXL
XXL
+
+
+ + + + +
+ + + + +
+ PARTNER LINKS   NFL.com  PGATOUR.com  NCAAsports.com   +
+
+
+
+
+ + + + + +
+ + + + + + + + + + + + + +
  Register · Help 
+
+ + + + +
+ + + + + + + + + + + + + + +
|  powered by Google
+ +
+
+
+ + + + + + + + + + +
CBS SportsLine.comNFL Football Sports News
+ +
+
+ + + + + +
+
 Home  NFL  NBA  MLB  NHL  Coll FB  Coll BK  PGA TOUR  Autos  Tennis  Horses  More  
+
+ + + + + + + + +
 Fantasy  Mobile  Games  Contests  Shop 
+
+
+ +
+ +
+ + +
+· Home
+· NFL
+· NCAA
+· MLB
+· NBA
+· NHL
+· Fantasy + +
+ + +
+ + + + + + + + + + +
+ +
 NFL HomeScoreboardStandings | Schedules | Stats | Teams | Players | Transactions | Injuries | Fantasy News
+
+ + + + + + + + + + + + + +
  + + + + +
+ Scoreboard + + + + +
+

+ + + + + + + + + + + +
   + +
+
+
+ + + + + + + +
ALERT:
+
+
+
+ +
+ +
Preseason WeekHall of Fame · 1 · 2 · 3 · 4 +
+Week1 · 2 · 3 · 4 · 5 · 6 · 7 · 8 · 9 · 10 · 11 · 12 · 13 · 14 · 15 · 16 · 17 +
+
+
+ + + + + +
+
+ +
 
+ + + + + +
Open Date: Arizona, Carolina, N.Y. Jets, PhiladelphiaAll times are US/Eastern
+ +
 
+ +
+
+
+ +
 
+ +
Sunday, November 5, 2006
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
Ford Field
+ +
Atlanta (5-3-0)770014
Detroit  (2-6-0) «10731030
+
+ + + + + + +
+ + + +
+ + Game Leaders
ATL: M. Vick (17-32, 163), M. Vick (10-80)
DET: J. Kitna (20-32, 321), R. Williams (6-138) +
+
+
+ + +
Recap · GameCenter · Live Commentary (Glog)
+
+
 
+ +
Soldier Field
+ +
Miami  (2-6-0) «01471031
Chicago (7-1-0)373013
+
+ + + + + + +
+ + + +
+ + Game Leaders
MIA: J. Harrington (16-32, 137), R. Brown (29-157)
CHI: R. Grossman (18-42, 210), T. Jones (20-69) +
+
+
+ + +
Recap · GameCenter · Live Commentary (Glog)
+
+
 
+ +
Ralph Wilson Stadium
+ +
Green Bay (3-5-0)007310
Buffalo  (3-5-0) «3701424
+
+ + + + + + +
+ + + +
+ + Game Leaders
GB: B. Favre (28-47, 287), A. Green (23-122)
BUF: J. Losman (8-15, 102), A. Thomas (20-95) +
+
+
+ + +
Recap · GameCenter · Live Commentary (Glog)
+
+
 
+ +
M&T Bank Stadium
+ +
Cincinnati (4-4-0)0731020
Baltimore  (6-2-0) «1436326
+
+ + + + + + +
+ + + +
+ + Game Leaders
CIN: C. Palmer (12-26, 195), C. Henry (2-79)
BAL: S. McNair (21-31, 245), T. Heap (4-84) +
+
+
+ + +
Recap · GameCenter · Live Commentary (Glog)
+
+
 
+ +
FedEx Field
+ +
Dallas (4-4-0)0127019
Washington  (3-5-0) «5701022
+
+ + + + + + +
+ + + +
+ + Game Leaders
DAL: T. Romo (24-36, 284), P. Crayton (4-84)
WAS: M. Brunell (14-23, 192), C. Portis (23-84) +
+
+
+ + +
Recap · GameCenter · Live Commentary (Glog)
+
+
 
+ +
Raymond James Stadium
+ +
New Orleans  (6-2-0) «14314031
Tampa Bay (2-6-0)0140014
+
+ + + + + + +
+ + + +
+ + Game Leaders
NO: D. Brees (24-32, 314), M. Colston (11-123)
TB: B. Gradkowski (18-31, 185), J. Galloway (4-97) +
+
+
+ + +
Recap · GameCenter · Live Commentary (Glog)
+
+
 
+ +
Edward Jones Dome
+ +
Kansas City  (5-3-0) «7170731
St. Louis (4-4-0)0107017
+
+ + + + + + +
+ + + +
+ + Game Leaders
KC: D. Huard (10-15, 148), L. Johnson (27-172)
STL: M. Bulger (31-42, 354), S. Jackson (13-133) +
+
+
+ + +
Recap · GameCenter · Live Commentary (Glog)
+
+
 
+ +
Giants Stadium
+ +
Houston (2-6-0)037010
NY Giants  (6-2-0) «700714
+
+ + + + + + +
+ + + +
+ + Game Leaders
HOU: D. Carr (21-30, 176), A. Johnson (9-83)
NYG: E. Manning (17-28, 179), T. Barber (17-115) +
+
+
+ + +
Recap · GameCenter · Live Commentary (Glog)
+
+
 
+ +
ALLTEL Stadium
+ +
Tennessee (2-6-0)00077
Jacksonville  (5-3-0) «14617037
+
+ + + + + + +
+ + + +
+ + Game Leaders
TEN: V. Young (15-36, 163), B. Scaife (5-70)
JAC: D. Garrard (12-22, 177), F. Taylor (13-79) +
+
+
+ + +
Recap · GameCenter · Live Commentary (Glog)
+
+
 
+ +
Monster Park
+ +
Minnesota (4-4-0)30003
San Francisco  (3-5-0) «06039
+
+ + + + + + +
+ + + +
+ + Game Leaders
MIN: B. Johnson (21-31, 136), C. Taylor (26-96)
SF: A. Smith (13-21, 105), F. Gore (19-41) +
+
+
+ + +
Recap · GameCenter · Live Commentary (Glog)
+
+
 
+ +
Qualcomm Stadium
+ +
Cleveland (2-6-0)3901325
San Diego  (6-2-0) «3771532
+
+ + + + + + +
+ + + +
+ + Game Leaders
CLE: C. Frye (25-43, 236), K. Winslow (11-78)
SD: P. Rivers (19-28, 211), L. Tomlinson (18-172) +
+
+
+ + +
Recap · GameCenter · Live Commentary (Glog)
+
+
 
+ +
Heinz Field
+ +
Denver  (6-2-0) «14071031
Pittsburgh (2-6-0)0107320
+
+ + + + + + +
+ + + +
+ + Game Leaders
DEN: J. Plummer (16-27, 227), J. Walker (6-134)
PIT: B. Roethlisberger (38-54, 433), H. Ward (7-127) +
+
+
+ + +
Recap · GameCenter · Live Commentary (Glog)
+
+
 
+ +
Gillette Stadium
+ +
Indianapolis  (8-0-0) «7107327
New England (6-2-0)0143320
+
+ + + + + + +
+ + + +
+ + Game Leaders
IND: P. Manning (20-36, 326), M. Harrison (8-145)
NE: T. Brady (20-35, 201), L. Maroney (13-63) +
+
+
+ + +
Recap · GameCenter · Live Commentary (Glog)
+
+
 
 

Monday, November 6, 2006
+
+ + + + + +
+ +
Qwest Field
+ +
Oakland (2-6-0)00000
Seattle  (5-3-0) «1030316
+
+ + + + + + +
+ + + +
+ + Game Leaders
OAK: A. Walter (16-35, 166), R. Moss (6-76)
SEA: S. Wallace (18-30, 176), M. Morris (30-138) +
+
+
+ + +
Recap · GameCenter · Live Commentary (Glog)
+
+
 
 

+ +
+ + + + + + + + + + + + +
Key:
possession = Possession
« = Game Winner
 = Red Zone
 = New Play
+
+ + +
 
+ +
+ + + + + + + + +
 
 
+ +
+ + + + + + + + + + + + + + +
+Fantasy Football at CBS SportsLine.com +
+ + + + + +
+Help · +User Comments · +Site Index · +Privacy Policy · +About Us · +Terms of Service +
+CBS.com · +CBSNews.com · +TheShowBuzz.com · +CBS Corporation · +Advertise With Us +
+CBS Sports Store · +The INSIDER · +Entertainment Tonight +
+ + + +
+Copyright © 1995 - 2006 SportsLine.com, Inc. All rights reserved. SportsLine is a registered service mark of SportsLine.com, Inc.
+CBS "eye device" is a registered trademark of CBS Broadcasting, Inc. + +
+ + + + diff --git a/vendor/gems/hpricot-0.6/test/files/why.xml b/vendor/gems/hpricot-0.6/test/files/why.xml new file mode 100644 index 0000000..3dd71fb --- /dev/null +++ b/vendor/gems/hpricot-0.6/test/files/why.xml @@ -0,0 +1,19 @@ + + + why the lucky stiff + http://whytheluckystiff.net + hex-editing reality to give us infinite grenades!! + en-us + + 2007-01-16T22:39:04+00:00 + + hourly + 1 + 2000-01-01T12:00+00:00 + 1.3http://whytheluckystiff.net/quatrains/1.3.htmlquatrains/1.3@http://whytheluckystiff.netquatrainsquatrainswhy the lucky stiff2007-01-14T08:47:05+00:00<blockquote> + <p>That cadillac of yours and that driver of yours!<br />You and your teacups rattling away in the back seat!<br />You always took the mike, oh, and all those cowboys you shot!<br />I held your hand! And I&#8217;ll shoot a cowboy one day!</p> + </blockquote> + <blockquote> + <p>You said, &#8220;Let&#8217;s run into the woods like kids!&#8221; <br />You said, &#8220;Let&#8217;s rub our hands together super-hot!&#8221; <br />And we scalded the trees and left octagons, I think that was you and<br />You threw parties on the roof!</p> + </blockquote> + diff --git a/vendor/gems/hpricot-0.6/test/load_files.rb b/vendor/gems/hpricot-0.6/test/load_files.rb new file mode 100644 index 0000000..d18559a --- /dev/null +++ b/vendor/gems/hpricot-0.6/test/load_files.rb @@ -0,0 +1,7 @@ +module TestFiles + Dir.chdir(File.dirname(__FILE__)) do + Dir['files/*.{html,xhtml,xml}'].each do |fname| + const_set fname[%r!/(\w+)\.\w+$!, 1].upcase, IO.read(fname) + end + end +end diff --git a/vendor/gems/hpricot-0.6/test/test_alter.rb b/vendor/gems/hpricot-0.6/test/test_alter.rb new file mode 100644 index 0000000..69e9568 --- /dev/null +++ b/vendor/gems/hpricot-0.6/test/test_alter.rb @@ -0,0 +1,65 @@ +#!/usr/bin/env ruby + +require 'test/unit' +require 'hpricot' +require 'load_files' + +class TestAlter < Test::Unit::TestCase + def setup + @basic = Hpricot.parse(TestFiles::BASIC) + end + + def test_before + test0 = "" + @basic.at("link").before(test0) + assert_equal 'test0.css', @basic.at("link").attributes['href'] + end + + def test_after + test_inf = "" + @basic.search("link")[-1].after(test_inf) + assert_equal 'test_inf.css', @basic.search("link")[-1].attributes['href'] + end + + def test_wrap + ohmy = (@basic/"p.ohmy").wrap("
") + assert_equal 'wrapper', ohmy[0].parent['id'] + assert_equal 'ohmy', Hpricot(@basic.to_html).at("#wrapper").children[0]['class'] + end + + def test_add_class + first_p = (@basic/"p:first").add_class("testing123") + assert first_p[0].get_attribute("class").split(" ").include?("testing123") + assert (Hpricot(@basic.to_html)/"p:first")[0].attributes["class"].split(" ").include?("testing123") + assert !(Hpricot(@basic.to_html)/"p:gt(0)")[0].attributes["class"].split(" ").include?("testing123") + end + + def test_change_attributes + all_ps = (@basic/"p").attr("title", "Some Title") + all_as = (@basic/"a").attr("href", "http://my_new_href.com") + all_lb = (@basic/"link").attr("href") { |e| e.name } + assert_changed(@basic, "p", all_ps) {|p| p.attributes["title"] == "Some Title"} + assert_changed(@basic, "a", all_as) {|a| a.attributes["href"] == "http://my_new_href.com"} + assert_changed(@basic, "link", all_lb) {|a| a.attributes["href"] == "link" } + end + + def test_remove_attr + all_rl = (@basic/"link").remove_attr("href") + assert_changed(@basic, "link", all_rl) { |link| link['href'].nil? } + end + + def test_remove_class + all_c1 = (@basic/"p[@class*='last']").remove_class("last") + assert_changed(@basic, "p[@class*='last']", all_c1) { |p| p['class'] == 'final' } + end + + def test_remove_all_classes + all_c2 = (@basic/"p[@class]").remove_class + assert_changed(@basic, "p[@class]", all_c2) { |p| p['class'].nil? } + end + + def assert_changed original, selector, set, &block + assert set.all?(&block) + assert Hpricot(original.to_html).search(selector).all?(&block) + end +end diff --git a/vendor/gems/hpricot-0.6/test/test_builder.rb b/vendor/gems/hpricot-0.6/test/test_builder.rb new file mode 100644 index 0000000..3cfe759 --- /dev/null +++ b/vendor/gems/hpricot-0.6/test/test_builder.rb @@ -0,0 +1,24 @@ +#!/usr/bin/env ruby + +require 'test/unit' +require 'hpricot' + +class TestBuilder < Test::Unit::TestCase + def test_escaping_text + doc = Hpricot() { b "" } + assert_equal "<a"b>", doc.to_html + assert_equal %{}, doc.at("text()").to_s + end + + def test_no_escaping_text + doc = Hpricot() { div.test.me! { text "" } } + assert_equal %{
}, doc.to_html + assert_equal %{}, doc.at("text()").to_s + end + + def test_latin1_entities + doc = Hpricot() { b "\200\225" } + assert_equal "ۥ", doc.to_html + assert_equal "\342\202\254\342\200\242", doc.at("text()").to_s + end +end diff --git a/vendor/gems/hpricot-0.6/test/test_parser.rb b/vendor/gems/hpricot-0.6/test/test_parser.rb new file mode 100644 index 0000000..88c7681 --- /dev/null +++ b/vendor/gems/hpricot-0.6/test/test_parser.rb @@ -0,0 +1,379 @@ +#!/usr/bin/env ruby + +require 'test/unit' +require 'hpricot' +require 'load_files' + +class TestParser < Test::Unit::TestCase + def test_set_attr + @basic = Hpricot.parse(TestFiles::BASIC) + @basic.search('//p').set('class', 'para') + assert_equal 4, @basic.search('//p').length + assert_equal 4, @basic.search('//p').find_all { |x| x['class'] == 'para' }.length + end + + # Test creating a new element + def test_new_element + elem = Hpricot::Elem.new(Hpricot::STag.new('form')) + assert_not_nil(elem) + assert_not_nil(elem.attributes) + end + + def test_scan_text + assert_equal 'FOO', Hpricot.make("FOO").first.content + end + + def test_filter_by_attr + @boingboing = Hpricot.parse(TestFiles::BOINGBOING) + + # this link is escaped in the doc + link = 'http://www.youtube.com/watch?v=TvSNXyNw26g&search=chris%20ware' + assert_equal link, @boingboing.at("a[@href='#{link}']")['href'] + end + + def test_filter_contains + @basic = Hpricot.parse(TestFiles::BASIC) + assert_equal 'Sample XHTML', @basic.search("title:contains('Sample')").to_s + end + + def test_get_element_by_id + @basic = Hpricot.parse(TestFiles::BASIC) + assert_equal 'link1', @basic.get_element_by_id('link1')['id'] + assert_equal 'link1', @basic.get_element_by_id('body1').get_element_by_id('link1').get_attribute('id') + end + + def test_get_element_by_tag_name + @basic = Hpricot.parse(TestFiles::BASIC) + assert_equal 'link1', @basic.get_elements_by_tag_name('a')[0].get_attribute('id') + assert_equal 'link1', @basic.get_elements_by_tag_name('body')[0].get_element_by_id('link1').get_attribute('id') + end + + def test_output_basic + @basic = Hpricot.parse(TestFiles::BASIC) + @basic2 = Hpricot.parse(@basic.inner_html) + scan_basic @basic2 + end + + def test_scan_basic + @basic = Hpricot.parse(TestFiles::BASIC) + scan_basic @basic + end + + def scan_basic doc + assert_kind_of Hpricot::XMLDecl, doc.children.first + assert_not_equal doc.children.first.to_s, doc.children[1].to_s + assert_equal 'link1', doc.at('#link1')['id'] + assert_equal 'link1', doc.at("p a")['id'] + assert_equal 'link1', (doc/:p/:a).first['id'] + assert_equal 'link1', doc.search('p').at('a').get_attribute('id') + assert_equal 'link2', (doc/'p').filter('.ohmy').search('a').first.get_attribute('id') + assert_equal (doc/'p')[2], (doc/'p').filter(':nth(2)')[0] + assert_equal (doc/'p')[2], (doc/'p').filter('[3]')[0] + assert_equal 4, (doc/'p').filter('*').length + assert_equal 4, (doc/'p').filter('* *').length + eles = (doc/'p').filter('.ohmy') + assert_equal 1, eles.length + assert_equal 'ohmy', eles.first.get_attribute('class') + assert_equal 3, (doc/'p:not(.ohmy)').length + assert_equal 3, (doc/'p').not('.ohmy').length + assert_equal 3, (doc/'p').not(eles.first).length + assert_equal 2, (doc/'p').filter('[@class]').length + assert_equal 'last final', (doc/'p[@class~="final"]').first.get_attribute('class') + assert_equal 1, (doc/'p').filter('[@class~="final"]').length + assert_equal 2, (doc/'p > a').length + assert_equal 1, (doc/'p.ohmy > a').length + assert_equal 2, (doc/'p / a').length + assert_equal 2, (doc/'link ~ link').length + assert_equal 3, (doc/'title ~ link').length + assert_equal 5, (doc/"//p/text()").length + assert_equal 6, (doc/"//p[a]//text()").length + assert_equal 2, (doc/"//p/a/text()").length + end + + def test_positional + h = Hpricot( "

one

two

" ) + assert_equal "

one

", h.search("//div/p:eq(0)").to_s + assert_equal "

one

", h.search("//div/p:first").to_s + assert_equal "

one

", h.search("//div/p:first()").to_s + end + + def test_pace + doc = Hpricot(TestFiles::PACE_APPLICATION) + assert_equal 'get', doc.at('form[@name=frmSect11]')['method'] + # assert_equal '2', doc.at('#hdnSpouse')['value'] + end + + def test_scan_boingboing + @boingboing = Hpricot.parse(TestFiles::BOINGBOING) + assert_equal 60, (@boingboing/'p.posted').length + assert_equal 1, @boingboing.search("//a[@name='027906']").length + assert_equal 10, @boingboing.search("script comment()").length + assert_equal 3, @boingboing.search("a[text()*='Boing']").length + assert_equal 1, @boingboing.search("h3[text()='College kids reportedly taking more smart drugs']").length + assert_equal 0, @boingboing.search("h3[text()='College']").length + assert_equal 60, @boingboing.search("h3").length + assert_equal 59, @boingboing.search("h3[text()!='College kids reportedly taking more smart drugs']").length + assert_equal 17, @boingboing.search("h3[text()$='s']").length + assert_equal 129, @boingboing.search("p[text()]").length + assert_equal 211, @boingboing.search("p").length + end + + def test_reparent + doc = Hpricot(%{
}) + div1 = doc.search('#blurb_1') + div1.before('
') + + div0 = doc.search('#blurb_0') + div0.before('
') + + assert_equal 'div', doc.at('#blurb_1').name + end + + def test_siblings + @basic = Hpricot.parse(TestFiles::BASIC) + t = @basic.at(:title) + e = t.next_sibling + assert_equal 'test1.css', e['href'] + assert_equal 'title', e.previous_sibling.name + end + + def test_css_negation + @basic = Hpricot.parse(TestFiles::BASIC) + assert_equal 3, (@basic/'p:not(.final)').length + end + + def test_remove_attribute + @basic = Hpricot.parse(TestFiles::BASIC) + (@basic/:p).each { |ele| ele.remove_attribute('class') } + assert_equal 0, (@basic/'p[@class]').length + end + + def test_abs_xpath + @boingboing = Hpricot.parse(TestFiles::BOINGBOING) + assert_equal 60, @boingboing.search("/html/body//p[@class='posted']").length + assert_equal 60, @boingboing.search("/*/body//p[@class='posted']").length + assert_equal 18, @boingboing.search("//script").length + divs = @boingboing.search("//script/../div") + assert_equal 1, divs.length + imgs = @boingboing.search('//div/p/a/img') + assert_equal 15, imgs.length + assert_equal 17, @boingboing.search('//div').search('p/a/img').length + assert imgs.all? { |x| x.name == 'img' } + end + + def test_predicates + @boingboing = Hpricot.parse(TestFiles::BOINGBOING) + assert_equal 2, @boingboing.search('//link[@rel="alternate"]').length + p_imgs = @boingboing.search('//div/p[/a/img]') + assert_equal 15, p_imgs.length + assert p_imgs.all? { |x| x.name == 'p' } + p_imgs = @boingboing.search('//div/p[a/img]') + assert_equal 18, p_imgs.length + assert p_imgs.all? { |x| x.name == 'p' } + assert_equal 1, @boingboing.search('//input[@checked]').length + end + + def test_tag_case + @tenderlove = Hpricot.parse(TestFiles::TENDERLOVE) + assert_equal 2, @tenderlove.search('//a').length + assert_equal 3, @tenderlove.search('//area').length + assert_equal 2, @tenderlove.search('//meta').length + end + + def test_alt_predicates + @boingboing = Hpricot.parse(TestFiles::BOINGBOING) + assert_equal 1, @boingboing.search('//table/tr:last').length + + @basic = Hpricot.parse(TestFiles::BASIC) + assert_equal "

The third paragraph

", + @basic.search('p:eq(2)').to_html + assert_equal '

THE FINAL PARAGRAPH

', + @basic.search('p:last').to_html + assert_equal 'last final', @basic.search('//p:last-of-type').first.get_attribute('class') + end + + def test_insert_after # ticket #63 + doc = Hpricot('
') + (doc/'div').each do |element| + element.after('

Paragraph 1

Paragraph 2

') + end + assert_equal doc.to_html, '

Paragraph 1

Paragraph 2

' + end + + def test_insert_before # ticket #61 + doc = Hpricot('
') + (doc/'div').each do |element| + element.before('

Paragraph 1

Paragraph 2

') + end + assert_equal doc.to_html, '

Paragraph 1

Paragraph 2

' + end + + def test_many_paths + @boingboing = Hpricot.parse(TestFiles::BOINGBOING) + assert_equal 62, @boingboing.search('p.posted, link[@rel="alternate"]').length + assert_equal 20, @boingboing.search('//div/p[a/img]|//link[@rel="alternate"]').length + end + + def test_stacked_search + @boingboing = Hpricot.parse(TestFiles::BOINGBOING) + assert_kind_of Hpricot::Elements, @boingboing.search('//div/p').search('a img') + end + + def test_class_search + # test case sent by Chih-Chao Lam + doc = Hpricot("
abc
") + assert_equal 1, doc.search(".xyz").length + doc = Hpricot("
abc
xyz
") + assert_equal 1, doc.search(".xyz").length + assert_equal 4, doc.search("*").length + end + + def test_kleene_star + # bug noticed by raja bhatia + doc = Hpricot("1
2
3
4") + assert_equal 2, doc.search("*[@class*='small']").length + assert_equal 2, doc.search("*.small").length + assert_equal 2, doc.search(".small").length + assert_equal 2, doc.search(".large").length + end + + def test_empty_comment + doc = Hpricot("

") + assert doc.children[0].children[0].comment? + doc = Hpricot("

") + assert doc.children[0].children[0].comment? + end + + def test_body_newlines + @immob = Hpricot.parse(TestFiles::IMMOB) + body = @immob.at(:body) + {'background' => '', 'bgcolor' => '#ffffff', 'text' => '#000000', 'marginheight' => '10', + 'marginwidth' => '10', 'leftmargin' => '10', 'topmargin' => '10', 'link' => '#000066', + 'alink' => '#ff6600', 'hlink' => "#ff6600", 'vlink' => "#000000"}.each do |k, v| + assert_equal v, body[k] + end + end + + def test_nested_twins + @doc = Hpricot("
Hi
there
") + assert_equal 1, (@doc/"div div").length + end + + def test_wildcard + @basic = Hpricot.parse(TestFiles::BASIC) + assert_equal 3, (@basic/"*[@id]").length + assert_equal 3, (@basic/"//*[@id]").length + end + + def test_javascripts + @immob = Hpricot.parse(TestFiles::IMMOB) + assert_equal 3, (@immob/:script)[0].inner_html.scan(/
}, + %{
}, + %{
}, + %{
}]. + each do |str| + doc = Hpricot(str) + assert_equal 1, (doc/:form).length + assert_equal '/units/a/login/1,13088,779-1,00.html', doc.at("form")['action'] + end + end + + def test_procins + doc = Hpricot("\n") + assert_equal "php", doc.children[0].target + assert_equal "blah='blah'", doc.children[2].content + end + + def test_buffer_error + assert_raise Hpricot::ParseError, "ran out of buffer space on element , starting on line 3." do + Hpricot(%{

\n\n\n\n

}) + end + end + + def test_youtube_attr + str = <<-edoc + + Lorem ipsum. Jolly roger, ding-dong sing-a-long + + + + + + + Check out my posting, I have bright mice in large clown cars. + + + + + + + + HAI + edoc + assert_equal "HAI", doc.at("body").inner_text + end + + # Reported by Jonathan Nichols on the Hpricot list (24 May 2007) + def test_self_closed_form + doc = Hpricot(<<-edoc) + +
+ +
+ + edoc + assert_equal "button", doc.at("//form/input")['type'] + end + + def test_filters + @basic = Hpricot.parse(TestFiles::BASIC) + assert_equal 0, (@basic/"title:parent").size + assert_equal 3, (@basic/"p:parent").size + assert_equal 1, (@basic/"title:empty").size + assert_equal 1, (@basic/"p:empty").size + end + + def test_keep_cdata + str = %{} + assert_equal str, Hpricot(str).to_html + end + + def test_namespace + chunk = <<-END + + hi + + END + doc = Hpricot::XML(chunk) + assert (doc/"//t:sam").size > 0 # at least this should probably work + # assert (doc/"//sam").size > 0 # this would be nice + end +end diff --git a/vendor/gems/hpricot-0.6/test/test_paths.rb b/vendor/gems/hpricot-0.6/test/test_paths.rb new file mode 100644 index 0000000..7204b77 --- /dev/null +++ b/vendor/gems/hpricot-0.6/test/test_paths.rb @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby + +require 'test/unit' +require 'hpricot' +require 'load_files' + +class TestParser < Test::Unit::TestCase + def test_roundtrip + @basic = Hpricot.parse(TestFiles::BASIC) + %w[link link[2] body #link1 a p.ohmy].each do |css_sel| + ele = @basic.at(css_sel) + assert_equal ele, @basic.at(ele.css_path) + assert_equal ele, @basic.at(ele.xpath) + end + end +end diff --git a/vendor/gems/hpricot-0.6/test/test_preserved.rb b/vendor/gems/hpricot-0.6/test/test_preserved.rb new file mode 100644 index 0000000..673e980 --- /dev/null +++ b/vendor/gems/hpricot-0.6/test/test_preserved.rb @@ -0,0 +1,66 @@ +#!/usr/bin/env ruby + +require 'test/unit' +require 'hpricot' +require 'load_files' + +class TestPreserved < Test::Unit::TestCase + def assert_roundtrip str + doc = Hpricot(str) + yield doc if block_given? + str2 = doc.to_original_html + [*str].zip([*str2]).each do |s1, s2| + assert_equal s1, s2 + end + end + + def assert_html str1, str2 + doc = Hpricot(str2) + yield doc if block_given? + assert_equal str1, doc.to_original_html + end + + def test_simple + str = "

Hpricot is a you know uh fine thing.

" + assert_html str, str + assert_html "

Hpricot is a you know uh fine thing.

", str do |doc| + (doc/:p).set('class', 'new') + end + end + + def test_parent + str = "Test

Paragraph one.

Paragraph two.

" + assert_html str, str + assert_html "

Paragraph one.

Paragraph two.

", str do |doc| + (doc/:head).remove + (doc/:div).set('id', 'all') + (doc/:p).wrap('
') + end + end + + def test_escaping_of_contents + doc = Hpricot(TestFiles::BOINGBOING) + assert_equal "Fukuda\342\200\231s Automatic Door opens around your body as you pass through it. The idea is to save energy and keep the room clean.", doc.at("img[@alt='200606131240']").next.to_s.strip + end + + def test_files + assert_roundtrip TestFiles::BASIC + assert_roundtrip TestFiles::BOINGBOING + assert_roundtrip TestFiles::CY0 + end + + def test_escaping_of_attrs + # ampersands in URLs + str = %{Google} + link = (doc = Hpricot(str)).at(:a) + assert_equal "http://google.com/search?q=hpricot&l=en", link['href'] + assert_equal "http://google.com/search?q=hpricot&l=en", link.attributes['href'] + assert_equal "http://google.com/search?q=hpricot&l=en", link.get_attribute('href') + assert_equal "http://google.com/search?q=hpricot&l=en", link.raw_attributes['href'] + assert_equal str, doc.to_html + + # alter the url + link['href'] = "javascript:alert(\"AGGA-KA-BOO!\")" + assert_equal %{Google}, doc.to_html + end +end diff --git a/vendor/gems/hpricot-0.6/test/test_xml.rb b/vendor/gems/hpricot-0.6/test/test_xml.rb new file mode 100644 index 0000000..ac9306d --- /dev/null +++ b/vendor/gems/hpricot-0.6/test/test_xml.rb @@ -0,0 +1,28 @@ +#!/usr/bin/env ruby + +require 'test/unit' +require 'hpricot' +require 'load_files' + +class TestParser < Test::Unit::TestCase + # normally, the link tags are empty HTML tags. + # contributed by laudney. + def test_normally_empty + doc = Hpricot::XML("this is titlehttp://fake.com") + assert_equal "this is title", (doc/:rss/:channel/:title).text + assert_equal "http://fake.com", (doc/:rss/:channel/:link).text + end + + # make sure XML doesn't get downcased + def test_casing + doc = Hpricot::XML(TestFiles::WHY) + assert_equal "hourly", (doc.at "sy:updatePeriod").inner_html + assert_equal 1, (doc/"guid[@isPermaLink]").length + end + + # be sure tags named "text" are ok + def test_text_tags + doc = Hpricot::XML("City PoisonedRita Lee has poisoned Brazil.") + assert_equal "City Poisoned", (doc/"title").text + end +end