Sha256: 1b1dfb68e6030a259d902ab5e4f881ca976da6880105df6e9fb93179667e1860

Contents?: true

Size: 1.01 KB

Versions: 261

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

module Nokogiri
  module XML
    ###
    # Represents the allowed content in an Element Declaration inside a DTD:
    #
    #   <?xml version="1.0"?><?TEST-STYLE PIDATA?>
    #   <!DOCTYPE staff SYSTEM "staff.dtd" [
    #      <!ELEMENT div1 (head, (p | list | note)*, div2*)>
    #   ]>
    #   </root>
    #
    # ElementContent represents the binary tree inside the <!ELEMENT> tag shown above that lists the
    # possible content for the div1 tag.
    class ElementContent
      include Nokogiri::XML::PP::Node

      # Possible definitions of type
      PCDATA  = 1
      ELEMENT = 2
      SEQ     = 3
      OR      = 4

      # Possible content occurrences
      ONCE    = 1
      OPT     = 2
      MULT    = 3
      PLUS    = 4

      attr_reader :document

      ###
      # Get the children of this ElementContent node
      def children
        [c1, c2].compact
      end

      private

      def inspect_attributes
        [:prefix, :name, :type, :occur, :children]
      end
    end
  end
end

Version data entries

261 entries across 261 versions & 7 rubygems

Version Path
nokogiri-1.16.8-x86_64-linux lib/nokogiri/xml/element_content.rb
nokogiri-1.16.8-x86_64-darwin lib/nokogiri/xml/element_content.rb
nokogiri-1.16.8-x64-mingw-ucrt lib/nokogiri/xml/element_content.rb
nokogiri-1.16.8-x64-mingw32 lib/nokogiri/xml/element_content.rb
nokogiri-1.16.8-java lib/nokogiri/xml/element_content.rb
nokogiri-1.16.8 lib/nokogiri/xml/element_content.rb
nokogiri-1.16.8-arm-linux lib/nokogiri/xml/element_content.rb
nokogiri-1.16.8-arm64-darwin lib/nokogiri/xml/element_content.rb
nokogiri-1.16.8-aarch64-linux lib/nokogiri/xml/element_content.rb
nokogiri-1.16.7 lib/nokogiri/xml/element_content.rb
nokogiri-1.16.7-x86_64-linux lib/nokogiri/xml/element_content.rb
nokogiri-1.16.7-x86_64-darwin lib/nokogiri/xml/element_content.rb
nokogiri-1.16.7-x86-mingw32 lib/nokogiri/xml/element_content.rb
nokogiri-1.16.7-x86-linux lib/nokogiri/xml/element_content.rb
nokogiri-1.16.7-x64-mingw32 lib/nokogiri/xml/element_content.rb
nokogiri-1.16.7-x64-mingw-ucrt lib/nokogiri/xml/element_content.rb
nokogiri-1.16.7-java lib/nokogiri/xml/element_content.rb
nokogiri-1.16.7-arm64-darwin lib/nokogiri/xml/element_content.rb
nokogiri-1.16.7-arm-linux lib/nokogiri/xml/element_content.rb
nokogiri-1.16.7-aarch64-linux lib/nokogiri/xml/element_content.rb