File: doctypei.rb

package info (click to toggle)
libxml-parser-ruby 0.6.8-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 912 kB
  • ctags: 1,523
  • sloc: ruby: 11,080; ansic: 1,958; xml: 467; makefile: 59
file content (19 lines) | stat: -rw-r--r-- 524 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /usr/local/bin/ruby

require 'xml/parser'

p = XML::Parser.new(nil, " ")
p.setReturnNSTriplet(true);

def p.startDoctypeDecl(name, sysid, pubid, has_internal) end
def p.endDoctypeDecl() end
def p.elementDecl(name, model) end
def p.attlistDecl(name, elname, attname, att_type, dflt, isreq) end
def p.xmlDecl(version, enc, standalone) end
def p.entityDecl(name, param, value, base, sysid, pubid, notation) end
def p.startElement(name, attrs) end
def p.endElement(name) end

p.parse($<.read) do |t, n, d|
  p([t, n, d])
end