diff options
author | myltsev <myltsev@yandex-team.ru> | 2022-02-10 16:46:03 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:03 +0300 |
commit | fc361854fd6ee8d747229b090f0b8018e260d1fb (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/xml/document/README | |
parent | 9166d66c30c23c9e85a7c88185a068987148d23f (diff) | |
download | ydb-fc361854fd6ee8d747229b090f0b8018e260d1fb.tar.gz |
Restoring authorship annotation for <myltsev@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/xml/document/README')
-rw-r--r-- | library/cpp/xml/document/README | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/library/cpp/xml/document/README b/library/cpp/xml/document/README index c7396aec30..b2649523d8 100644 --- a/library/cpp/xml/document/README +++ b/library/cpp/xml/document/README @@ -1,20 +1,20 @@ -A wrapper around the DOM interface of libxml2. - -The standard way to use it is as follows: - +A wrapper around the DOM interface of libxml2. + +The standard way to use it is as follows: + #include <library/cpp/xml/document/xml-document.h> - ... - - // open a document - NXml::TDocument xml("filename.xml"); - - // get a nodeset from an XPath query - NXml::TConstNodes nodes = xml.Root().Nodes("xpath/expression/here"); - - // iterate over the nodeset - for (size_t i = 0; i < nodes.size(); ++i) { + ... + + // open a document + NXml::TDocument xml("filename.xml"); + + // get a nodeset from an XPath query + NXml::TConstNodes nodes = xml.Root().Nodes("xpath/expression/here"); + + // iterate over the nodeset + for (size_t i = 0; i < nodes.size(); ++i) { using namespace NXml; - TConstNode& node = nodes[i]; + TConstNode& node = nodes[i]; // query node TString name = node.Name(); TString lang = node.Attr<TString>("lang"); @@ -26,8 +26,8 @@ The standard way to use it is as follows: node.SetAttr("x", 2); node.SetValue(5); node.AddText(" apples"); - } - + } + // edit documents with copy-paste NXml::TDocument xml2("<xpath><node/></xpath>", NXml::TDocument::String); NXml::TNode place = xml2.Root().Node("xpath/node"); @@ -39,4 +39,4 @@ The standard way to use it is as follows: TString modifiedDoc = xml2.ToString("ISO-8559-1"); -See xml-document_ut.cpp for more examples. +See xml-document_ut.cpp for more examples. |