CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Sun, 10 Aug 2025 09:36:53 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20180611014631
location: https://web.archive.org/web/20180611014631/https://github.com/stuarthalloway/builder
server-timing: captures_list;dur=0.745481, exclusion.robots;dur=0.025418, exclusion.robots.policy;dur=0.010811, esindex;dur=0.012981, cdx.remote;dur=267.229890, LoadShardBlock;dur=222.139776, PetaboxLoader3.datanode;dur=55.928573, PetaboxLoader3.resolve;dur=84.468044
x-app-server: wwwb-app214
x-ts: 302
x-tr: 607
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app214; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Sun, 10 Aug 2025 09:36:54 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: GitHub.com
x-archive-orig-date: Mon, 11 Jun 2018 01:46:31 GMT
x-archive-orig-transfer-encoding: chunked
x-archive-orig-status: 200 OK
x-archive-orig-cache-control: no-cache
x-archive-orig-vary: X-PJAX
x-archive-orig-set-cookie: logged_in=no; domain=.github.com; path=/; expires=Fri, 11 Jun 2038 01:46:31 -0000; secure; HttpOnly
x-archive-orig-set-cookie: _gh_sess=NXMrRkkxVmtockZaUjhWRlduaTdFNU1jRXQxa2ZCM1dLbVRDam9QVW1ydTN6Y3Q4ZG1oQUhlYVVMSmplaVNOdnFQckljMnhqZXpLTVVwa0JpSHlmMkI2UTB2N3hvTlNqUEc2Ri8yQWFkdVVoRzdneVZTRlJVMk9RWlZ2ZysySUNQSGNYMHJMczZFTFZRZnZZY2lsc2RFdXg2cG00aEw5Z3c3TllPWm1OQlFNVmppZEJGcFB5ZDY5NXB6ZkYzT2QwQURkOVhxZk9FUEVxU3U3aGtVMDlzL1ZpOEY0ZFQ0WjB6ZGlOMzU2U0c5ZHR0R2hBUXFOUkg3RG5VRnlWNWFzVk02R2JaRktwQXBEejFGSGEvYis4K1VPem45RkF2UWNBeDdSYW95VUtMdE5kOGlod2FCQlM5MVNsbno4YnhGaEFNK2VuaUNUWEdYZGR1NGJnSkxra1dYRm91ei9GTHVLcC85TGV6VkRjbzVUOEdPRXlUaFJRajZKd2UrUk53bVVRcnQzd1djZFBpc2EwdThEcERCb1VlREsrZWNFdjdzS3ZneEhhVUM5UzNKOD0tLVJLbU53LzRhT1FyUSt1UUVJQWFRcnc9PQ%3D%3D--98f7ca230a1370e742e9ddb4a229fe7efa212e97; path=/; secure; HttpOnly
x-archive-orig-x-request-id: 5be18784-3bad-4e30-b84c-fed61fc6c3db
x-archive-orig-x-runtime: 0.276610
x-archive-orig-strict-transport-security: max-age=31536000; includeSubdomains; preload
x-archive-orig-x-frame-options: deny
x-archive-orig-x-content-type-options: nosniff
x-archive-orig-x-xss-protection: 1; mode=block
x-archive-orig-expect-ct: max-age=2592000, report-uri="https://api.github.com/_private/browser/errors"
x-archive-orig-content-security-policy: default-src 'none'; base-uri 'self'; block-all-mixed-content; connect-src 'self' uploads.github.com status.github.com collector.githubapp.com api.github.com www.google-analytics.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com wss://live.github.com; font-src assets-cdn.github.com; form-action 'self' github.com gist.github.com; frame-ancestors 'none'; frame-src render.githubusercontent.com; img-src 'self' data: assets-cdn.github.com identicons.github.com collector.githubapp.com github-cloud.s3.amazonaws.com *.githubusercontent.com; manifest-src 'self'; media-src 'none'; script-src assets-cdn.github.com; style-src 'unsafe-inline' assets-cdn.github.com
x-archive-orig-x-runtime-rack: 0.285086
x-archive-orig-x-github-request-id: C344:1021:2E0DCCC:5C69776:5B1DD477
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Mon, 11 Jun 2018 01:46:31 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Mon, 11 Jun 2018 01:46:31 GMT", ; rel="memento"; datetime="Mon, 11 Jun 2018 01:46:31 GMT", ; rel="next memento"; datetime="Tue, 08 Sep 2020 22:04:16 GMT", ; rel="last memento"; datetime="Tue, 08 Sep 2020 22:04:22 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: archiveteam_github_20180703192236/archiveteam_github_20180703192236.megawarc.warc.gz
server-timing: captures_list;dur=0.473468, exclusion.robots;dur=0.017622, exclusion.robots.policy;dur=0.008155, esindex;dur=0.010952, cdx.remote;dur=132.795064, LoadShardBlock;dur=159.685625, PetaboxLoader3.datanode;dur=81.581548, PetaboxLoader3.resolve;dur=243.880453, load_resource;dur=192.423336
x-app-server: wwwb-app214
x-ts: 200
x-tr: 564
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
GitHub - stuarthalloway/builder: Provide a simple way to create XML markup and data structures.
Fetching latest commit…
Permalink
stuarthalloway/builder forked from jimweirich/builder
Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Provide a simple way to create XML markup and data structures.
https://builder.rubyforge.org
Clone or download
Launching GitHub Desktop...
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop...
If nothing happens, download GitHub Desktop and try again.
Launching Xcode...
If nothing happens, download Xcode and try again.
Launching Visual Studio...
If nothing happens, download the GitHub extension for Visual Studio and try again.
Pull request
Compare
This branch is 86 commits behind jimweirich:master.

Cannot retrieve the latest commit at this time.
Failed to load latest commit information. | |||
![]() |
doc | ||
![]() |
lib | ||
![]() |
rakelib | ||
![]() |
test | ||
![]() |
.gitignore | ||
![]() |
CHANGES | ||
![]() |
README | ||
![]() |
Rakefile | ||
![]() |
TAGS | ||
![]() |
builder.blurb |
README
= Project: Builder == Goal Provide a simple way to create XML markup and data structures. == Classes Builder::XmlMarkup:: Generate XML markup notiation Builder::XmlEvents:: Generate XML events (i.e. SAX-like) <b>Notes</b>:: * An <tt>Builder::XmlTree</tt> class to generate XML tree (i.e. DOM-like) structures is also planned, but not yet implemented. Also, the events builder is currently lagging the markup builder in features. == Usage require 'rubygems' require_gem 'builder', '~> 2.0' builder = Builder::XmlMarkup.new xml = builder.person { |b| b.name("Jim"); b.phone("555-1234") } xml #=> <person><name>Jim</name><phone>555-1234</phone></person> or require 'rubygems' require_gem 'builder' builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2) builder.person { |b| b.name("Jim"); b.phone("555-1234") } # # Prints: # <person> # <name>Jim</name> # <phone>555-1234</phone> # </person> == Compatibility === Version 2.0.0 Compatibility Changes Version 2.0.0 introduces automatically escaped attribute values for the first time. Versions prior to 2.0.0 did not insert escape characters into attribute values in the XML markup. This allowed attribute values to explicitly reference entities, which was occasionally used by a small number of developers. Since strings could always be explicitly escaped by hand, this was not a major restriction in functionality. However, it did suprise most users of builder. Since the body text is normally escaped, everybody expected the attribute values to be escaped as well. Escaped attribute values were the number one support request on the 1.x Builder series. Starting with Builder version 2.0.0, all attribute values expressed as strings will be processed and the appropriate characters will be escaped (e.g. "&" will be tranlated to "&"). Attribute values that are expressed as Symbol values will not be processed for escaped characters and will be unchanged in output. (Yes, this probably counts as Symbol abuse, but the convention is convenient and flexible). Example: xml = Builder::XmlMarkup.new xml.sample(:escaped=>"This&That", :unescaped=>:"Here&There") xml.target! => <sample escaped="This&That" unescaped="Here&There"/> === Version 1.0.0 Compatibility Changes Version 1.0.0 introduces some changes that are not backwards compatible with earlier releases of builder. The main areas of incompatibility are: * Keyword based arguments to +new+ (rather than positional based). It was found that a developer would often like to specify indentation without providing an explicit target, or specify a target without indentation. Keyword based arguments handle this situation nicely. * Builder must now be an explicit target for markup tags. Instead of writing xml_markup = Builder::XmlMarkup.new xml_markup.div { strong("text") } you need to write xml_markup = Builder::XmlMarkup.new xml_markup.div { xml_markup.strong("text") } * The builder object is passed as a parameter to all nested markup blocks. This allows you to create a short alias for the builder object that can be used within the block. For example, the previous example can be written as: xml_markup = Builder::XmlMarkup.new xml_markup.div { |xml| xml.strong("text") } * If you have both a pre-1.0 and a post-1.0 gem of builder installed, you can choose which version to use through the RubyGems +require_gem+ facility. require_gem 'builder', "~> 0.0" # Gets the old version require_gem 'builder', "~> 1.0" # Gets the new version == Features * XML Comments are supported ... xml_markup.comment! "This is a comment" #=> <!-- This is a comment --> * XML processing instructions are supported ... xml_markup.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8" #=> <?xml version="1.0" encoding="UTF-8"?> If the processing instruction is omitted, it defaults to "xml". When the processing instruction is "xml", the defaults attributes are: <b>version</b>:: 1.0 <b>encoding</b>:: "UTF-8" (NOTE: if the encoding is set to "UTF-8" and $KCODE is set to "UTF8", then Builder will emit UTF-8 encoded strings rather than encoding non-ASCII characters as entities.) * XML entity declarations are now supported to a small degree. xml_markup.declare! :DOCTYPE, :chapter, :SYSTEM, "../dtds/chapter.dtd" #=> <!DOCTYPE chapter SYSTEM "../dtds/chapter.dtd"> The parameters to a declare! method must be either symbols or strings. Symbols are inserted without quotes, and strings are inserted with double quotes. Attribute-like arguments in hashes are not allowed. If you need to have an argument to declare! be inserted without quotes, but the arguement does not conform to the typical Ruby syntax for symbols, then use the :"string" form to specify a symbol. For example: xml_markup.declare! :ELEMENT, :chapter, :"(title,para+)" #=> <!ELEMENT chapter (title,para+)> Nested entity declarations are allowed. For example: @xml_markup.declare! :DOCTYPE, :chapter do |x| x.declare! :ELEMENT, :chapter, :"(title,para+)" x.declare! :ELEMENT, :title, :"(#PCDATA)" x.declare! :ELEMENT, :para, :"(#PCDATA)" end #=> <!DOCTYPE chapter [ <!ELEMENT chapter (title,para+)> <!ELEMENT title (#PCDATA)> <!ELEMENT para (#PCDATA)> ]> * Some support for XML namespaces is now available. If the first argument to a tag call is a symbol, it will be joined to the tag to produce a namespace:tag combination. It is easier to show this than describe it. xml.SOAP :Envelope do ... end Just put a space before the colon in a namespace to produce the right form for builder (e.g. "<tt>SOAP:Envelope</tt>" => "<tt>xml.SOAP :Envelope</tt>") * String attribute values are <em>now</em> escaped by default by Builder (<b>NOTE:</b> this is _new_ behavior as of version 2.0). However, occasionally you need to use entities in attribute values. Using a symbols (rather than a string) for an attribute value will cause Builder to not run its quoting/escaping algorithm on that particular value. (<b>Note:</b> The +escape_attrs+ option for builder is now obsolete). Example: xml = Builder::XmlMarkup.new xml.sample(:escaped=>"This&That", :unescaped=>:"Here&There") xml.target! => <sample escaped="This&That" unescaped="Here&There"/> * UTF-8 Support Builder correctly translates UTF-8 characters into valid XML. (New in version 2.0.0). Thanks to Sam Ruby for the translation code. Example: xml = Builder::Markup.new xml.sample("Iñtërnâtiônàl") xml.target! => "<sample>Iñtërnâtiônàl</sample>" You can get UTF-8 encoded output by making sure that the XML encoding is set to "UTF-8" and that the $KCODE variable is set to "UTF8". $KCODE = 'UTF8' xml = Builder::Markup.new xml.instruct!(:xml, :encoding => "UTF-8") xml.sample("Iñtërnâtiônàl") xml.target! => "<sample>Iñtërnâtiônàl</sample>" == Contact Author:: Jim Weirich Email:: jim@weirichhouse.org Home Page:: https://onestepback.org License:: MIT Licence (https://www.opensource.org/licenses/mit-license.html)
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.