Management of XML file headers and formating. More...
Public Member Functions | |
this (PRETTY_FLAGS pretty=PRETTY_FLAGS.PRETTY_INDENT, in char[] xml_version="1.0", in char[] encoding="utf-8", in DocType doctype=new DocType) | |
void | print_header (Stream o, bool lf=true) |
Public Attributes | |
PRETTY_FLAGS | _pretty |
char[] | _endl |
char[] | _version |
char[] | _encoding |
DocType | _doctype |
StyleSheetList | _stylesheets |
int | _standalone |
Management of XML file headers and formating.
Definition at line 413 of file xmlstorage.d.
xmlstorage::XMLFormat::this | ( | PRETTY_FLAGS | pretty = PRETTY_FLAGS.PRETTY_INDENT , |
in char[] | xml_version = "1.0" , |
||
in char[] | encoding = "utf-8" , |
||
in DocType | doctype = new DocType |
||
) | [inline] |
Definition at line 416 of file xmlstorage.d.
{ _pretty = pretty; _endl = "\n"; _version = xml_version; _encoding = encoding; _doctype = doctype; _standalone = -1; _stylesheets = new StyleSheetList; }
void xmlstorage::XMLFormat::print_header | ( | Stream | o, |
bool | lf = true |
||
) | [inline] |
Definition at line 428 of file xmlstorage.d.
{ o.writeString("<?xml version=\"" ~ _version ~ "\" encoding=\"" ~ _encoding ~ "\""); if (_standalone != -1) o.writeString(" standalone=\"yes\""); o.writeString("?>"); if (lf) o.writeString(_endl); if (!_doctype.empty()) { o.writeString("<!DOCTYPE " ~ _doctype._name); if (_doctype._public.length) { o.writeString(" PUBLIC \"" ~ _doctype._public ~ '"'); if (lf) o.writeString(_endl); o.writeString(" \"" ~ _doctype._system ~ '"'); } else if (_doctype._system.length) o.writeString(" SYSTEM \"" ~ _doctype._system ~ '"'); o.writeString("?>"); if (lf) o.writeString(_endl); } foreach(it; _stylesheets) { it.print(o); if (lf) o.writeString(_endl); } /* if (!_additional.empty()) { o.writeString(_additional); if (lf) o.writeString(_endl; } */ }
Definition at line 480 of file xmlstorage.d.
char [] xmlstorage::XMLFormat::_encoding |
Definition at line 478 of file xmlstorage.d.
char [] xmlstorage::XMLFormat::_endl |
Definition at line 475 of file xmlstorage.d.
Referenced by xmlstorage::XMLNode::pretty_write_worker(), xmlstorage::XMLDoc::read(), and xmlstorage::XMLNode::smart_write_worker().
Definition at line 474 of file xmlstorage.d.
Definition at line 486 of file xmlstorage.d.
Definition at line 482 of file xmlstorage.d.
char [] xmlstorage::XMLFormat::_version |
Definition at line 477 of file xmlstorage.d.