Class: Docbook::Output::PipelineSteps::ParseXml

Inherits:
Object
  • Object
show all
Defined in:
lib/docbook/output/pipeline_steps/parse_xml.rb

Overview

Step 1: Parse DocBook XML and resolve XIncludes.

Instance Method Summary collapse

Instance Method Details

#call(guide, context) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/docbook/output/pipeline_steps/parse_xml.rb', line 8

def call(guide, context)
  require_relative "../../../docbook"
  xml_string = File.read(context.xml_path)
  resolved_xml = Docbook::XIncludeResolver.resolve_string(xml_string,
                                                          base_path: context.xml_path)
  context.parsed = Docbook::Document.from_xml(resolved_xml.to_xml)
  guide
end