Class: Moxml::Adapter::Base
- Inherits:
-
Object
- Object
- Moxml::Adapter::Base
show all
- Extended by:
- XmlUtils
- Defined in:
- lib/moxml/adapter/base.rb
Class Method Summary
collapse
-
.create_cdata(content) ⇒ Object
-
.create_comment(content) ⇒ Object
-
.create_declaration(version = "1.0", encoding = "UTF-8", standalone = nil) ⇒ Object
-
.create_doctype(name, external_id, system_id) ⇒ Object
-
.create_document ⇒ Object
-
.create_element(name) ⇒ Object
-
.create_namespace(element, prefix, uri) ⇒ Object
-
.create_processing_instruction(target, content) ⇒ Object
-
.create_text(content) ⇒ Object
-
.duplicate_node(node) ⇒ Object
-
.parse(xml, options = {}) ⇒ Object
-
.set_attribute_name(attribute, name) ⇒ Object
-
.set_attribute_value(attribute, value) ⇒ Object
-
.set_root(doc, element) ⇒ Object
Methods included from XmlUtils
encode_entities, normalize_xml_value, validate_comment_content, validate_declaration_encoding, validate_declaration_standalone, validate_declaration_version, validate_element_name, validate_pi_target, validate_prefix, validate_uri
Class Method Details
.create_cdata(content) ⇒ Object
35
36
37
|
# File 'lib/moxml/adapter/base.rb', line 35
def create_cdata(content)
create_native_cdata(normalize_xml_value(content))
end
|
39
40
41
42
|
# File 'lib/moxml/adapter/base.rb', line 39
def (content)
(content)
(normalize_xml_value(content))
end
|
.create_declaration(version = "1.0", encoding = "UTF-8", standalone = nil) ⇒ Object
53
54
55
56
57
58
|
# File 'lib/moxml/adapter/base.rb', line 53
def create_declaration(version = "1.0", encoding = "UTF-8", standalone = nil)
validate_declaration_version(version)
validate_declaration_encoding(encoding)
validate_declaration_standalone(standalone)
create_native_declaration(version, encoding, standalone)
end
|
.create_doctype(name, external_id, system_id) ⇒ Object
44
45
46
|
# File 'lib/moxml/adapter/base.rb', line 44
def create_doctype(name, external_id, system_id)
create_native_doctype(name, external_id, system_id)
end
|
.create_document ⇒ Object
22
23
24
|
# File 'lib/moxml/adapter/base.rb', line 22
def create_document
raise NotImplementedError
end
|
.create_element(name) ⇒ Object
26
27
28
29
|
# File 'lib/moxml/adapter/base.rb', line 26
def create_element(name)
validate_element_name(name)
create_native_element(name)
end
|
.create_namespace(element, prefix, uri) ⇒ Object
60
61
62
63
64
|
# File 'lib/moxml/adapter/base.rb', line 60
def create_namespace(element, prefix, uri)
validate_prefix(prefix) if prefix
validate_uri(uri)
create_native_namespace(element, prefix, uri)
end
|
.create_processing_instruction(target, content) ⇒ Object
48
49
50
51
|
# File 'lib/moxml/adapter/base.rb', line 48
def create_processing_instruction(target, content)
validate_pi_target(target)
create_native_processing_instruction(target, normalize_xml_value(content))
end
|
.create_text(content) ⇒ Object
31
32
33
|
# File 'lib/moxml/adapter/base.rb', line 31
def create_text(content)
create_native_text(normalize_xml_value(content))
end
|
.duplicate_node(node) ⇒ Object
74
75
76
|
# File 'lib/moxml/adapter/base.rb', line 74
def duplicate_node(node)
node.dup
end
|
.parse(xml, options = {}) ⇒ Object
18
19
20
|
# File 'lib/moxml/adapter/base.rb', line 18
def parse(xml, options = {})
raise NotImplementedError
end
|
.set_attribute_name(attribute, name) ⇒ Object
66
67
68
|
# File 'lib/moxml/adapter/base.rb', line 66
def set_attribute_name(attribute, name)
attribute.name = name
end
|
.set_attribute_value(attribute, value) ⇒ Object
70
71
72
|
# File 'lib/moxml/adapter/base.rb', line 70
def set_attribute_value(attribute, value)
attribute.value = value
end
|
.set_root(doc, element) ⇒ Object
14
15
16
|
# File 'lib/moxml/adapter/base.rb', line 14
def set_root(doc, element)
raise NotImplementedError
end
|