diff options
author | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2009-01-06 12:20:22 +0000 |
---|---|---|
committer | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2009-01-06 12:20:22 +0000 |
commit | 5054325378a67e1480fe2474836f6f5a919dc4bc (patch) | |
tree | 3dd559e9af1219ad2e8e9e4eb0bae24aff54494a /src/pugixml.hpp | |
parent | c507d9b10eaa3cd0d3065f4da8e0beb15a21d033 (diff) |
Added node_declaration node type for <?xml nodes, added corresponding parse_declaration and format_no_declaration flags and parsing/saving/DOM functionality
git-svn-id: http://pugixml.googlecode.com/svn/trunk@104 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'src/pugixml.hpp')
-rw-r--r-- | src/pugixml.hpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 26e2f0f..b1096fe 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -42,7 +42,8 @@ namespace pugi node_pcdata, ///< E.g. '>...<' node_cdata, ///< E.g. '<![CDATA[...]]>' node_comment, ///< E.g. '<!--...-->' - node_pi ///< E.g. '<?...?>' + node_pi, ///< E.g. '<?...?>' + node_declaration ///< E.g. '<?xml ...?>' }; // Parsing options @@ -155,6 +156,18 @@ namespace pugi const unsigned int parse_wconv_attribute = 0x0080; /** + * This flag determines if XML document declaration (this node has the form of <?xml ... ?> in XML) + * are to be put in DOM tree. If this flag is off, it is not put in the tree, but is still parsed + * and checked for correctness. + * + * The corresponding node in DOM tree will have type node_declaration, name "xml" and attributes, + * if any. + * + * This flag is off by default. + */ + const unsigned int parse_declaration = 0x0100; + + /** * This is the default set of flags. It includes parsing CDATA sections (comments/PIs are not * parsed), performing character and entity reference expansion, replacing whitespace characters * with spaces in attribute values and performing EOL handling. Note, that PCDATA sections @@ -188,6 +201,15 @@ namespace pugi const unsigned int format_raw = 0x04; /** + * If this flag is on, no default XML declaration is written to output file. + * This means that there will be no XML declaration in output stream unless there was one in XML document + * (i.e. if it was parsed with parse_declaration flag). + * + * This flag is off by default. + */ + const unsigned int format_no_declaration = 0x08; + + /** * This is the default set of formatting flags. It includes indenting nodes depending on their * depth in DOM tree. */ |