Sha256: a0f0372c2c54b83930aa54877784188f374cae2ebd3f15e0a7e94dd6d1040083

Contents?: true

Size: 1.14 KB

Versions: 80

Compression:

Stored size: 1.14 KB

Contents

def xml2doc(xml)
  Nokogiri::XML(xml, &:noblanks)
end

def subsection(xml)
  pre = <<XML
<?xml version="1.0" encoding="UTF-8"?>
<akomaNtoso xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.akomantoso.org/2.0" xsi:schemaLocation="http://www.akomantoso.org/2.0 akomantoso20.xsd">
  <act contains="singleVersion">
    <body>
      <section id="section-10">
        <num>10.</num>
        <heading>Effect of order for <term refersTo="#term-eviction" id="trm236">eviction</term></heading>
        <subsection id="section-10.1">
          <num>(1)</num>
          <content>
XML
  post = <<XML
          </content>
        </subsection>
      </section>
    </body>
  </act>
</akomaNtoso>
XML

  return pre + xml + post
end

def section(xml)
  pre = <<XML
<?xml version="1.0" encoding="UTF-8"?>
<akomaNtoso xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.akomantoso.org/2.0" xsi:schemaLocation="http://www.akomantoso.org/2.0 akomantoso20.xsd">
  <act contains="singleVersion">
    <body>
      <section id="section-10">
XML
  post = <<XML
      </section>
    </body>
  </act>
</akomaNtoso>
XML

  return pre + xml + post
end

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
slaw-9.2.0 spec/xml_helpers.rb
slaw-9.1.0 spec/xml_helpers.rb
slaw-9.0.0 spec/xml_helpers.rb
slaw-8.0.1 spec/xml_helpers.rb
slaw-8.0.0 spec/xml_helpers.rb
slaw-7.0.0 spec/xml_helpers.rb
slaw-6.2.0 spec/xml_helpers.rb
slaw-6.1.0 spec/xml_helpers.rb
slaw-6.0.0 spec/xml_helpers.rb
slaw-5.0.0 spec/xml_helpers.rb
slaw-4.2.0 spec/xml_helpers.rb
slaw-4.1.0 spec/xml_helpers.rb
slaw-4.0.0 spec/xml_helpers.rb
slaw-3.4.0 spec/xml_helpers.rb
slaw-3.3.2 spec/xml_helpers.rb
slaw-3.3.1 spec/xml_helpers.rb
slaw-3.3.0 spec/xml_helpers.rb
slaw-3.2.0 spec/xml_helpers.rb
slaw-3.1.1 spec/xml_helpers.rb
slaw-3.1.0 spec/xml_helpers.rb