An XML builder generates valid XML.
An XML::Error
is raised if attempting to generate an invalid XML (for example, if invoking #end_element
without a matching #start_element
, or trying to use a non-string value as an object's field name)
Creates a builder that writes to the given io.
Emits an attribute with a value.
Emits an attribute with namespace info and a value.
Emits the start of an attribute, invokes the block, and then emits the end of the attribute.
Emits the given attributes with their values.
Emits the given attributes with their values.
Emits a CDATA
section.
Emits the start of a CDATA
section, invokes the block and then emits the end of the CDATA
section.
Emits a comment.
Emits the start of a comment, invokes the block and then emits the end of the comment.
Emits the start of the document, invokes the block, and then emits the end of the document.
Emits a DTD
.
Emits the start of a DTD
, invokes the block and then emits the end of the DTD
.
Emits the start of an element with the given attributes, invokes the block and then emits the end of the element.
Emits an element with namespace info with the given attributes.
Emits an element with namespace info with the given attributes.
Emits an element with the given attributes.
Emits an element with the given attributes.
Emits the start of an element with the given attributes, invokes the block and then emits the end of the element.
Emits the start of an element with namespace info with the given attributes, invokes the block and then emits the end of the element.
Emits the start of an element with namespace info with the given attributes, invokes the block and then emits the end of the element.
Emits the end of an attribute.
Emits the end of a CDATA
section.
Emits the end of a comment.
Emits the end of a document.
Emits the end of a DTD
.
Emits the end of an element.
Forces content written to this writer to be flushed to this writer's IO
.
Sets the indent level (number of spaces).
Sets the indent string.
Emits a namespace.
Sets the quote char to use, either '
or "
.
Emits the start of an attribute.
Emits the start of an attribute with namespace info.
Emits the start of a CDATA
section.
Emits the start of a comment.
Emits the start of the document.
Emits the start of a DTD
.
Emits the start of an element.
Emits the start of an element with namespace info.
Emits text content.
Struct
Value
Object
Object
Emits an attribute with namespace info and a value.
Emits the start of an attribute, invokes the block, and then emits the end of the attribute.
Emits the given attributes with their values.
Emits the given attributes with their values.
Emits the start of a CDATA
section, invokes the block and then emits the end of the CDATA
section.
NOTE CDATA
end sequences written within the block need to be escaped manually.
Emits the start of a comment, invokes the block and then emits the end of the comment.
Emits the start of the document, invokes the block, and then emits the end of the document.
Emits a DTD
.
Emits the start of a DTD
, invokes the block and then emits the end of the DTD
.
Emits the start of an element with the given attributes, invokes the block and then emits the end of the element.
Emits an element with namespace info with the given attributes.
Emits an element with namespace info with the given attributes.
Emits an element with the given attributes.
Emits the start of an element with the given attributes, invokes the block and then emits the end of the element.
Emits the start of an element with namespace info with the given attributes, invokes the block and then emits the end of the element.
Emits the start of an element with namespace info with the given attributes, invokes the block and then emits the end of the element.
Emits a namespace.
Emits the start of an attribute with namespace info.
Emits the start of an element with namespace info.
Emits text content.
Text content can happen inside of an #element
, #attribute
value, #cdata
, #dtd
, etc.
© 2012–2020 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.35.1/XML/Builder.html