{"id":4736,"date":"2021-08-06T09:25:53","date_gmt":"2021-08-06T09:25:53","guid":{"rendered":"https:\/\/www.bearloga.space\/?page_id=4736"},"modified":"2021-08-06T09:25:54","modified_gmt":"2021-08-06T09:25:54","slug":"xml-dom-dobavit-uzel","status":"publish","type":"page","link":"https:\/\/www.bearloga.space\/en\/xml-dom-dobavit-uzel\/","title":{"rendered":"XML DOM \u2014 \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0443\u0437\u0435\u043b"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u0412 \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u0435 \u043c\u044b \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u0443\u0437\u043b\u044b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.&nbsp;\u042d\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u2014<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u0443\u0437\u043b\u044b \u0434\u043e \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u0443\u0437\u043b\u043e\u0432<\/li><li>\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u0443\u0437\u043b\u0435<\/li><li>\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0443\u0437\u0435\u043b \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u0443\u0437\u043b\u044b \u0434\u043e \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u0443\u0437\u043b\u043e\u0432<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u0443\u0437\u043b\u0435<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0443\u0437\u0435\u043b \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \/ \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u0437\u043b\u043e\u0432 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u0432 DOM \u2014<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>AppendChild ()<\/li><li>InsertBefore ()<\/li><li>insertData ()<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">AppendChild ()<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u0435\u0442\u043e\u0434 appendChild () \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u0443\u0437\u0435\u043b \u043f\u043e\u0441\u043b\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e \u0443\u0437\u043b\u0430.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043c\u0435\u0442\u043e\u0434\u0430 appendChild () \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Node appendChild(Node newChild) throws DOMException\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u0443\u0434\u0430,<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><em>newChild<\/em>&nbsp;\u2014 \u044d\u0442\u043e \u0443\u0437\u0435\u043b \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/li><li>\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439&nbsp;<em>\u0443\u0437\u0435\u043b<\/em>&nbsp;.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><em>newChild<\/em>&nbsp;\u2014 \u044d\u0442\u043e \u0443\u0437\u0435\u043b \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439&nbsp;<em>\u0443\u0437\u0435\u043b<\/em>&nbsp;.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u043f\u0440\u0438\u043c\u0435\u0440<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 (appendchildnode_example.htm) \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f XML-\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 (&nbsp;<a href=\"https:\/\/www.tutorialspoint.com\/dom\/node.xml\" target=\"_blank\" rel=\"noreferrer noopener\">node.xml<\/a>&nbsp;) \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 XML DOM \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439&nbsp;<em>PhoneNo<\/em>&nbsp;\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 &lt;FirstName&gt;.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n   &lt;head&gt;\n      &lt;script&gt;\n         function loadXMLDoc(filename) {\n            if (window.XMLHttpRequest) {\n               xhttp = new XMLHttpRequest();\n            } else \/\/ code for IE5 and IE6 {\n               xhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n            xhttp.open(\"GET\",filename,false);\n            xhttp.send();\n            return xhttp.responseXML;\n         }\n      &lt;\/script&gt;\n   &lt;\/head&gt;\n   &lt;body&gt;\n      &lt;script&gt;\n         xmlDoc = loadXMLDoc(\"\/dom\/node.xml\");\n\n         create_e = xmlDoc.createElement(\"PhoneNo\");\n\n         x = xmlDoc.getElementsByTagName(\"FirstName\")[0];\n         x.appendChild(create_e);\n\n         document.write(x.getElementsByTagName(\"PhoneNo\")[0].nodeName);\n      &lt;\/script&gt;\n   &lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u2014<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u0442\u043e\u0434 createElement (), \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442&nbsp;<em>PhoneNo<\/em>&nbsp;.<\/li><li>\u041d\u043e\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442&nbsp;<em>PhoneNo<\/em>&nbsp;\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442&nbsp;<em>FirstName<\/em>&nbsp;\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 appendChild ().<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u0442\u043e\u0434 createElement (), \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442&nbsp;<em>PhoneNo<\/em>&nbsp;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u043e\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442&nbsp;<em>PhoneNo<\/em>&nbsp;\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442&nbsp;<em>FirstName<\/em>&nbsp;\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 appendChild ().<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043a\u0430\u043a\u00a0<em>appendchildnode_example.htm<\/em>\u00a0\u043d\u0430 \u043f\u0443\u0442\u0438 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 (\u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0438 \u0444\u0430\u0439\u043b node.xml \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438 \u0442\u043e\u043c \u0436\u0435 \u043f\u0443\u0442\u0438 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435).\u00a0\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u043a\u0430\u043a\u00a0<em>PhoneNo<\/em>\u00a0.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">InsertBefore ()<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u0435\u0442\u043e\u0434&nbsp;<em>insertBefore ()<\/em>&nbsp;\u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u043e\u0432\u044b\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u0443\u0437\u043b\u044b \u043f\u0435\u0440\u0435\u0434 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c\u0438 \u0443\u0437\u043b\u0430\u043c\u0438.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043c\u0435\u0442\u043e\u0434\u0430 insertBefore () \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Node insertBefore(Node newChild, Node refChild) throws DOMException\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u0443\u0434\u0430,<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><em>newChild<\/em>&nbsp;\u2014 \u044d\u0442\u043e \u0443\u0437\u0435\u043b \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438<\/li><li><em>refChild<\/em>&nbsp;\u2014&nbsp;<em>\u0421\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0439<\/em>&nbsp;\u0443\u0437\u0435\u043b, \u0442. \u0435. \u0443\u0437\u0435\u043b, \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u043e\u0432\u044b\u0439 \u0443\u0437\u0435\u043b.<\/li><li>\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439&nbsp;<em>\u0443\u0437\u0435\u043b<\/em>&nbsp;.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><em>newChild<\/em>&nbsp;\u2014 \u044d\u0442\u043e \u0443\u0437\u0435\u043b \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>refChild<\/em>&nbsp;\u2014&nbsp;<em>\u0421\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0439<\/em>&nbsp;\u0443\u0437\u0435\u043b, \u0442. \u0435. \u0443\u0437\u0435\u043b, \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u043e\u0432\u044b\u0439 \u0443\u0437\u0435\u043b.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439&nbsp;<em>\u0443\u0437\u0435\u043b<\/em>&nbsp;.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u043f\u0440\u0438\u043c\u0435\u0440<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 (insertnodebefore_example.htm) \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f XML-\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 (&nbsp;<a href=\"https:\/\/www.tutorialspoint.com\/dom\/node.xml\" target=\"_blank\" rel=\"noreferrer noopener\">node.xml<\/a>&nbsp;) \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 XML DOM \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439&nbsp;<em>Email<\/em>&nbsp;\u043f\u0435\u0440\u0435\u0434 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c &lt;Email&gt;.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n   &lt;head&gt;\n      &lt;script&gt;\n         function loadXMLDoc(filename) {\n            if (window.XMLHttpRequest) {\n               xhttp = new XMLHttpRequest();\n            } else \/\/ code for IE5 and IE6 {\n               xhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n            xhttp.open(\"GET\",filename,false);\n            xhttp.send();\n            return xhttp.responseXML;\n         }\n      &lt;\/script&gt;\n   &lt;\/head&gt;\n   &lt;body&gt;\n      &lt;script&gt;\n         xmlDoc = loadXMLDoc(\"\/dom\/node.xml\");\n\n         create_e = xmlDoc.createElement(\"Email\");\n\n         x = xmlDoc.documentElement;\n         y = xmlDoc.getElementsByTagName(\"Email\");\n\n         document.write(\"No of Email elements before inserting was: \" + y.length);\n         document.write(\"&lt;br&gt;\");\n         x.insertBefore(create_e,y[3]);\n\n         y=xmlDoc.getElementsByTagName(\"Email\");\n         document.write(\"No of Email elements after inserting is: \" + y.length);\n      &lt;\/script&gt;\n   &lt;\/body&gt;\n&lt;\/html&gt;\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u2014<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u0442\u043e\u0434 createElement (), \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442&nbsp;<em>Email<\/em>&nbsp;.<\/li><li>\u041d\u043e\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442&nbsp;<em>Email<\/em>&nbsp;\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c&nbsp;<em>Email<\/em>&nbsp;\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 insertBefore ().<\/li><li><em>y.length<\/em>&nbsp;\u0434\u0430\u0435\u0442 \u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u043e \u0438 \u043f\u043e\u0441\u043b\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u0442\u043e\u0434 createElement (), \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442&nbsp;<em>Email<\/em>&nbsp;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u043e\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442&nbsp;<em>Email<\/em>&nbsp;\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c&nbsp;<em>Email<\/em>&nbsp;\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 insertBefore ().<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>y.length<\/em>&nbsp;\u0434\u0430\u0435\u0442 \u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u043e \u0438 \u043f\u043e\u0441\u043b\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043a\u0430\u043a&nbsp;<em>insertnodebefore_example.htm<\/em>&nbsp;\u043d\u0430 \u043f\u0443\u0442\u0438 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 (\u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0438 \u0444\u0430\u0439\u043b node.xml \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438 \u0442\u043e\u043c \u0436\u0435 \u043f\u0443\u0442\u0438 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435).&nbsp;\u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u044b\u0432\u043e\u0434 \u2014<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">No of Email elements before inserting was: 3\nNo of Email elements after inserting is: 4 \n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">insertData ()<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u0435\u0442\u043e\u0434 insertData () \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c 16-\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u044b\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">InsertData () \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u2014<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">void insertData(int offset, java.lang.String arg) throws DOMException\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u0443\u0434\u0430,<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><em>\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435<\/em>&nbsp;\u2014 \u044d\u0442\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438.<\/li><li><em>arg<\/em>&nbsp;\u2014 \u044d\u0442\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.&nbsp;\u041e\u043d \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 offset \u0438 string \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u044f\u0442\u043e\u0439.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><em>\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435<\/em>&nbsp;\u2014 \u044d\u0442\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>arg<\/em>&nbsp;\u2014 \u044d\u0442\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.&nbsp;\u041e\u043d \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 offset \u0438 string \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u044f\u0442\u043e\u0439.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u043f\u0440\u0438\u043c\u0435\u0440<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 (addtext_example.htm) \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 XML-\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 (\u00bb&nbsp;<a href=\"https:\/\/www.tutorialspoint.com\/dom\/node.xml\" target=\"_blank\" rel=\"noreferrer noopener\">node.xml<\/a>&nbsp;\u00ab) \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 XML DOM \u0438&nbsp;<em>\u0432\u0441\u0442\u0430\u0432\u043a\u0430<\/em>&nbsp;\u043d\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445&nbsp;<em>MiddleName<\/em>&nbsp;\u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 &lt;FirstName&gt;.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n   &lt;head&gt;\n      &lt;script&gt;\n         function loadXMLDoc(filename) {\n            if (window.XMLHttpRequest) {\n               xhttp = new XMLHttpRequest();\n            } else \/\/ code for IE5 and IE6 {\n               xhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n            xhttp.open(\"GET\",filename,false);\n            xhttp.send();\n            return xhttp.responseXML;\n         }\n     &lt;\/script&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n     &lt;script&gt;\n        xmlDoc = loadXMLDoc(\"\/dom\/node.xml\");\n\n        x = xmlDoc.getElementsByTagName(\"FirstName\")[0].childNodes[0];\n        document.write(x.nodeValue);\n        x.insertData(6,\"MiddleName\");\n        document.write(\"&lt;br&gt;\");\n        document.write(x.nodeValue);\n\n     &lt;\/script&gt;\n   &lt;\/body&gt;\n&lt;\/html&gt;\n<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><em>x.insertData (6, \u00abMiddleName\u00bb);<\/em><\/strong>&nbsp;\u2014 \u0417\u0434\u0435\u0441\u044c&nbsp;<em>x<\/em>&nbsp;\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043c\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e \u0438\u043c\u0435\u043d\u0438, \u0442\u043e \u0435\u0441\u0442\u044c &lt;FirstName&gt;.&nbsp;\u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u044d\u0442\u043e\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0443\u0437\u0435\u043b \u0434\u0430\u043d\u043d\u044b\u0435&nbsp;<em>\u00abMiddleName\u00bb,<\/em>&nbsp;\u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 6.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>x.insertData (6, \u00abMiddleName\u00bb);<\/em><\/strong>&nbsp;\u2014 \u0417\u0434\u0435\u0441\u044c&nbsp;<em>x<\/em>&nbsp;\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043c\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e \u0438\u043c\u0435\u043d\u0438, \u0442\u043e \u0435\u0441\u0442\u044c &lt;FirstName&gt;.&nbsp;\u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u044d\u0442\u043e\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0443\u0437\u0435\u043b \u0434\u0430\u043d\u043d\u044b\u0435&nbsp;<em>\u00abMiddleName\u00bb,<\/em>&nbsp;\u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 6.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043a\u0430\u043a&nbsp;<em>addtext_example.htm<\/em>&nbsp;\u043d\u0430 \u043f\u0443\u0442\u0438 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 (\u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0438 \u0444\u0430\u0439\u043b node.xml \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438 \u0442\u043e\u043c \u0436\u0435 \u043f\u0443\u0442\u0438 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u0435 \u043c\u044b \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u0443\u0437\u043b\u044b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.&nbsp;\u042d\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u0443\u0437\u043b\u044b \u0434\u043e \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[152],"tags":[],"class_list":["post-4736","page","type-page","status-publish","hentry","category-xml-dom"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/pages\/4736","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/comments?post=4736"}],"version-history":[{"count":0,"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/pages\/4736\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/media?parent=4736"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/categories?post=4736"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/tags?post=4736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}