CARVIEW |
Select Language
HTTP/2 200
date: Wed, 23 Jul 2025 20:26:50 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"53a565cf5374876b87da7499a207bbc1"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.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 *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=JeGmWIdfy6RL2FFNuEKfj4b1oygnVCJDI6eiRNEX0QpslJKVcykI9e%2Fe%2FjwDbuBMY1Gr46ogb9bYDjiojKvngrjG6%2Fyz7%2BNUBqMUkiSmZdnwkmHVHbH98ru7qsHImJCTXYdCDwyceu67%2B2LrNuLfx6WUtuKtbTfZoURp7ujwFKqX%2FomJUeJhUwhYTmoJb83qPZNiWJCjrhNCgfCVunbRI%2BvvpS2FT7fNRdIZB%2BZPgJS3ydosOqPYLYUV1MlqxiTiFMcoTa8iK%2BJedQ5zj1kZ6w%3D%3D--LPSkfrfRyGmiKxKl--QBlczGrXVy3%2FX5UluXIM8A%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.892267678.1753302409; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 20:26:49 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 20:26:49 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: AC0E:394F4C:10A402E:13C4FD7:68814589
Builder Options · oozcitak/xmlbuilder-js Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 107
Builder Options
Ozgur Ozcitak edited this page Mar 26, 2020
·
8 revisions
This page documents the various options that can be used to customize the behavior of the XML builder.
-
version
A version number string:1.0
or1.1
. This also changes character validation. Defaults to1.0
if omitted. -
encoding
Encoding declaration, e.g.UTF-8
. No encoding declaration will be produced if omitted. -
standalone
standalone document declaration:true
orfalse
. No standalone document declaration will be produced if omitted. -
headless
whether XML declaration and doctype will be included:true
orfalse
. Defaults tofalse
.
Note: XML declaration can be specified later with the dec
function. Also see this wiki page.
builder.create('root')
.dec('1.0', 'UTF-8', true);
-
pubID
public identifier of the external subset. No default. -
sysID
system identifier of the external subset. No default.
Note: If neither pubID
nor sysID
is given, an external document type definition will not be produced.
Note: A DTD can also be created at a later time by calling doctype
from anywhere in the document (can also be abbreviated to dtd
). Also see this wiki page.
var dtd = root.dtd('pubID', 'sysID');
-
keepNullNodes
whether nodes withnull
values will be kept or ignored:true
orfalse
. Defaults tofalse
, which silently ignores nodes withnull
values. When set totrue
,null
will be treated as an empty string. -
keepNullAttributes
whether attributes with null values will be kept or ignored:true
orfalse
. Defaults tofalse
, which silently ignores attributes withnull
values. When set totrue
,null
will be treated as an empty string. -
ignoreDecorators
whether decorator strings will be ignored when converting JS objects:true
orfalse
. Defaults tofalse
. See this page for a list of decorator strings. -
separateArrayItems
whether array items are created as separate nodes when passed as an object value:true
orfalse
. Defaults tofalse
. See this page for an example. -
noDoubleEncoding
whether existing html entities are encoded:true
orfalse
. Defaults tofalse
. For example, when converting the following JS object:
const root = {
'@att': 'attribute value with # and #'
'#text': 'HTML entities for umlaut are ü and ü.'
}
// with noDoubleEncoding: false (default)
const xmlStr = builder.create(obj).end({ pretty: true });
// <?xml version="1.0"?>
// <root att="attribute value with &num; and &#35;">
// HTML entities for umlaut are &uuml; and &#252;.'
// </root>
// with noDoubleEncoding: true
const xmlStr = builder.create(obj, { noDoubleEncoding: true }).end({ pretty: true });
// <?xml version="1.0"?>
// <root att="attribute value with # and #">
// HTML entities for umlaut are ü and ü.'
// </root>
-
noValidation
whether XML character validation will be disabled:true
orfalse
. Defaults tofalse
. -
invalidCharReplacement
sets a character to replace invalid characters in input strings. Defaults toundefined
. Note that setting this option also disables character validation. See XML 1.0, §2.2 Characters and XML 1.1, §2.2 Characters for valid and invalid character definitions.
const obj = {
'node\x00': 'text\x08content'
}
const xmlStr = builder.create(obj, { invalidCharReplacement: '' }).end({ pretty: true });
// <?xml version="1.0"?>
// <node>textcontent</node>
or using a replacement function:
const obj = {
'node\x00': 'text\x08content'
}
const options = {
invalidCharReplacement: (c) => c === '\x00' ? '' : '_'
};
const xmlStr = builder.create(obj, options).end({ pretty: true });
// <?xml version="1.0"?>
// <node>text_content</node>
-
stringify
a set of functions to use for converting values to strings. See this page for value conversion details and decorator strings. -
writer
the default XML writer to use for converting nodes to string. If the default writer is not set, the built-inXMLStringWriter
will be used instead. See this page for information on writers.
Clone this wiki locally
You can’t perform that action at this time.