|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!DOCTYPE apiClassifier PUBLIC "-//IBM//DTD DITA API Classifier Reference Type//EN" |
|
3 "../dtd/apiClassifier.dtd"> |
|
4 <apiClassifier id="MultiLanguage"> |
|
5 <apiName>Document interface</apiName> |
|
6 <shortdesc>Represents the entire HTML or XML document. Conceptually, it is |
|
7 the root of the document tree, and provides the primary access to the document's |
|
8 data.</shortdesc> |
|
9 <apiClassifierDetail> |
|
10 <apiDesc>Since elements, text nodes, comments, processing instructions, etc. |
|
11 cannot exist outside the context of a Document, the Document interface also |
|
12 contains the factory methods needed to create these objects. The Node objects |
|
13 created have a ownerDocument attribute which associates them with the Document |
|
14 within whose context they were created.</apiDesc> |
|
15 <example><pre platform="java">Document doc = docBuilder.newDocument(); |
|
16 Attr attr = doc.createAttribute("name");</pre><pre platform="vb">Dim xmlDoc As New Msxml2.DOMDocument30 |
|
17 Dim newAtt As IXMLDOMAttribute |
|
18 Set newAtt = xmlDoc.createAttribute("name")</pre><p>The example creates a |
|
19 document object and attribute object.</p></example> |
|
20 </apiClassifierDetail> |
|
21 <apiOperation id="createAttribute"> |
|
22 <apiName>createAttribute() method</apiName> |
|
23 <shortdesc>Creates an Attr of the given name. </shortdesc> |
|
24 <apiOperationDetail> |
|
25 <apiSyntax platform="java"> |
|
26 <apiSyntaxText><apiItemName>Attr</apiItemName> createAttribute(String <apiItemName>name</apiItemName>) throws <apiRelation |
|
27 keyref="org.w3c.dom.DOMException">DOMException</apiRelation></apiSyntaxText> |
|
28 <apiSyntaxItem> |
|
29 <apiItemName>Attr</apiItemName> |
|
30 <apiDefNote id="attributeParamDesc">The returned <apiclassifier keyref="org.w3c.dom.Attr">Attr</apiclassifier> object.</apiDefNote> |
|
31 </apiSyntaxItem> |
|
32 <apiSyntaxItem id="nameParam"> |
|
33 <apiItemName>name</apiItemName> |
|
34 <apiDefNote>The name for the created attribute.</apiDefNote> |
|
35 </apiSyntaxItem> |
|
36 </apiSyntax> |
|
37 <apiSyntax platform="vb"> |
|
38 <apiSyntaxText>Sub createAttribute(<apiItemName>name</apiItemName>, <apiItemName>mode</apiItemName>) Returns <apiItemName>IXMLDOMAttribute</apiItemName |
|
39 ></apiSyntaxText> |
|
40 <apiSyntaxItem conref="#createAttribute/nameParam"></apiSyntaxItem> |
|
41 <apiSyntaxItem> |
|
42 <apiItemName>mode</apiItemName> |
|
43 <apiDefNote>The read / write mode for the created attribute.</apiDefNote> |
|
44 </apiSyntaxItem> |
|
45 <apiSyntaxItem> |
|
46 <apiItemName>IXMLDOMAttribute</apiItemName> |
|
47 <apiDefNote conref="#createAttribute/attributeParamDesc"></apiDefNote> |
|
48 </apiSyntaxItem> |
|
49 </apiSyntax> |
|
50 <apiDesc>After creation, the <apiclassifier keyref="org.w3c.dom.Attr">Attr</apiclassifier> instance |
|
51 can be set on an <apiclassifier keyref="org.w3c.dom.Element">Element</apiclassifier> instance |
|
52 using the <apioperation keyref="org.w3c.dom.Element.setAttributeNode">setAttributeNode</apioperation> method.</apiDesc> |
|
53 </apiOperationDetail> |
|
54 </apiOperation> |
|
55 </apiClassifier> |