var attrNode = xml.documentElement.getAttributeNode("myAttr")




Download 2,96 Mb.
Pdf ko'rish
bet119/131
Sana14.05.2024
Hajmi2,96 Mb.
#232039
1   ...   115   116   117   118   119   120   121   122   ...   131
Bog'liq
Ceponkus, Hoodbhoy - Applied XML - Toolkit for Programmers
1. Работа с современными учебными техническими средствами по информационным технологиям1, Quchqorov Bahromning F.O`.M fanidan Slayd, 65dfb5a88b75b5da48b5a403fa4d41c2, CqAmAyPw4fTCALP4WYshpYdZitzfIdVeTpeXQRhQ, Toza qayta tiklanadigan energiyaga global talabning tobora ortib borayotgani bizning sayyoramizdagi kelajagimiz uchun katta iqtisodiy va ijtimoiy ta, 1, 1, 853777, O.S.Axmedov Python dasturlash tili fanidan yakuniy nazorat 30ta bilet [3 0], Fortuna akumliyatori, Презентация2, 1. Gravirazvedka — lotin, DMM6500-FRP-v1 7 12 Apr 2022 RNs DMM6500-FRP-V1.7.12, Microsoft Word Document, 1- 2Электромагнит нурланишларнинг муҳитлар билан таъсирлашуви фанининг предмети






- 133 -



This example takes the attribute myAttr=“”hello” off rootElement and puts it on myElem. If 
the tree was to be persisted (saved to disk), then the XML document would appear as 
follows:



In Internet Explorer 5, if the line xml.documentElement.removeAttributeNode(attrNode) 
was removed from the script, an error would be issued saying that the node must first be 
removed from before inserting into another element.
getElementsByTagName(name)
Parameters

name
is a string value.
Return value
: NodeList
Exceptions
thrown:
None
Description
: Returns a list of Element nodes that have a property tagName (or 
nodeValue) that matches the parameter name name. This method searches the whole 
subtree of the Element that it was called on. If name equals “*”, then all the Element 
nodes are returned.
Comments
: This method is performs the same operation as the get-
ElementsByTagName(name) method that is found on the Document node. The 
Document node’s getElementsByTagName(name) searches the whole tree, whereas the 
Element’s method searches only the sub-tree of the Element that it was called on.
normalize()
Parameters:
None
Return value
: None
Exceptions thrown
: None
Description
: Collapses adjacent Text nodes into one node. This view is reference as the 
normal form where only another type of node can separate a Text node.
Example
: If a programmer ended with a DOM tree as depicted in Figure 5.9, which can 
be done easily when moving nodes around, a call to normalize() on rootElement would 
produce the DOM tree shown in Figure 5.10.


- 134 -

Download 2,96 Mb.
1   ...   115   116   117   118   119   120   121   122   ...   131




Download 2,96 Mb.
Pdf ko'rish

Bosh sahifa
Aloqalar

    Bosh sahifa



var attrNode = xml.documentElement.getAttributeNode("myAttr")

Download 2,96 Mb.
Pdf ko'rish