File: documenttype.rb

package info (click to toggle)
ruby-xmlparser 0.7.3-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 980 kB
  • sloc: ruby: 9,342; ansic: 2,017; makefile: 11
file content (102 lines) | stat: -rw-r--r-- 1,589 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
## -*- Ruby -*-
## XML::DOM
## 1998-2001 by yoshidam
##

require 'xml/dom2/node'

module XML
  module DOM

=begin
== Class XML::DOM::DocumentType

=== superclass
Node
=end
    class DocumentType<Node

=begin
=== Class Methods

    --- DocumentType.new(name, pubid, sysid, *children)

creates a new DocuemntType.
=end
      def initialize(name, pubid, sysid, *children)
        super(*children)
        raise "parameter error" if !name
        @name = name.freeze
        @pubid = pubid.freeze
        @sysid = sysid.freeze
      end

=begin
=== Methods

    --- DocumentType#nodeType

[DOM]
returns the nodeType.
=end
      ## [DOM]
      def nodeType
        DOCUMENT_TYPE_NODE
      end

=begin
    --- DocumentType#nodeName

[DOM]
returns the nodeName.
=end
      ## [DOM]
      def nodeName
        @name
      end

=begin
    --- DocumentType#to_s

returns the string representation of the DocumentType.
=end
      def to_s
        ""
      end

=begin
    --- DocumentType#dump(depth = 0)

dumps the DocumentType.
=end
      def dump(depth = 0)
        print ' ' * depth * 2
        print "<!DOCTYPE #{@name}>\n"
      end

=begin
    --- DocumentType#cloneNode(deep = true)

[DOM]
returns the copy of the DocumentType.
=end
      ## [DOM]
      def cloneNode(deep = true)
        super(deep, @name, @pubid, @sysid)
      end

      ## [DOM]
      ## def entities; @entities; end
      ## def notations; @notations; end

      ## [DOM2]
      def publicId; @pubid; end

      ## [DOM2]
      def systemId; @sysid; end

      ## [DOM2]
      def internalSubset; end
    end
  end
end