Sophie

Sophie

distrib > * > 2009.0 > i586 > by-pkgid > a6711891ce757817bba854bf3f25205a > files > 1982

qtjambi-doc-4.3.3-3mdv2008.1.i586.rpm

<class name="QDomAttr" doc="/**
&lt;p&gt;The &lt;a href=&quot;QDomAttr.html#QDomAttr()&quot;&gt;&lt;tt&gt;QDomAttr&lt;/tt&gt;&lt;/a&gt; class represents one attribute of a &lt;a href=&quot;QDomElement.html&quot;&gt;&lt;tt&gt;QDomElement&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For example, the following piece of XML produces an element with no children, but two attributes:&lt;/p&gt;
&lt;pre&gt;    &amp;lt;link href=&amp;quot;http:&lt;span class=&quot;comment&quot;&gt;//www.trolltech.com&amp;quot; color=&amp;quot;red&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;You can access the attributes of an element with code like this:&lt;/p&gt;
&lt;pre&gt;    QDomElement e = &lt;span class=&quot;comment&quot;&gt;//...&lt;/span&gt;
&lt;span class=&quot;comment&quot;&gt;    //...&lt;/span&gt;
    QDomAttr a = e.attributeNode(&amp;quot;href&amp;quot;);
    cout &amp;lt;&amp;lt; a.value() &amp;lt;&amp;lt; endl;                &lt;span class=&quot;comment&quot;&gt;// prints &amp;quot;http://www.trolltech.com&amp;quot;&lt;/span&gt;
    a.setValue(&amp;quot;http:&lt;span class=&quot;comment&quot;&gt;//doc.trolltech.com&amp;quot;); // change the node's attribute&lt;/span&gt;
    QDomAttr a2 = e.attributeNode(&amp;quot;href&amp;quot;);
    cout &amp;lt;&amp;lt; a2.value() &amp;lt;&amp;lt; endl;               &lt;span class=&quot;comment&quot;&gt;// prints &amp;quot;http://doc.trolltech.com&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This example also shows that changing an attribute received from an element changes the attribute of the element. If you do not want to change the value of the element's attribute you must use &lt;a href=&quot;QDomNode.html#cloneNode(boolean)&quot;&gt;&lt;tt&gt;cloneNode&lt;/tt&gt;&lt;/a&gt; to get an independent copy of the attribute.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QDomAttr.html#QDomAttr()&quot;&gt;&lt;tt&gt;QDomAttr&lt;/tt&gt;&lt;/a&gt; can return the &lt;a href=&quot;QDomAttr.html#name()&quot;&gt;&lt;tt&gt;name&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QDomAttr.html#value()&quot;&gt;&lt;tt&gt;value&lt;/tt&gt;&lt;/a&gt; of an attribute. An attribute's value is set with &lt;a href=&quot;QDomAttr.html#setValue(java.lang.String)&quot;&gt;&lt;tt&gt;setValue&lt;/tt&gt;&lt;/a&gt;. If &lt;a href=&quot;QDomAttr.html#specified()&quot;&gt;&lt;tt&gt;specified&lt;/tt&gt;&lt;/a&gt; returns true the value was either set in the document or set with &lt;a href=&quot;QDomAttr.html#setValue(java.lang.String)&quot;&gt;&lt;tt&gt;setValue&lt;/tt&gt;&lt;/a&gt;; otherwise the value hasn't been set. The node this attribute is attached to (if any) is returned by &lt;a href=&quot;QDomAttr.html#ownerElement()&quot;&gt;&lt;tt&gt;ownerElement&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For further information about the Document Object Model see &lt;a href=&quot;http://www.w3.org/TR/REC-DOM-Level-1/&quot;&gt;&lt;tt&gt;http://www.w3.org/TR/REC-DOM-Level-1/&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;http://www.w3.org/TR/DOM-Level-2-Core/&quot;&gt;&lt;tt&gt;http://www.w3.org/TR/DOM-Level-2-Core/&lt;/tt&gt;&lt;/a&gt;. For a more general introduction of the DOM implementation see the &lt;a href=&quot;QDomDocument.html&quot;&gt;&lt;tt&gt;QDomDocument&lt;/tt&gt;&lt;/a&gt; documentation.&lt;/p&gt;
 */">
    <method name="public QDomAttr(com.trolltech.qt.xml.QDomAttr x)" doc="/**
&lt;p&gt;Constructs a copy of &lt;tt&gt;x&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;The data of the copy is shared (shallow copy): modifying one node will also change the other. If you want to make a deep copy, use &lt;a href=&quot;QDomNode.html#cloneNode(boolean)&quot;&gt;&lt;tt&gt;cloneNode&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
 */"/>
    <method name="public QDomAttr()" doc="/**
&lt;p&gt;Constructs an empty attribute.&lt;/p&gt;
 */"/>
    <method name="public final java.lang.String name()" doc="/**
&lt;p&gt;Returns the attribute's name.&lt;/p&gt;
 */"/>
    <method name="public final com.trolltech.qt.xml.QDomElement ownerElement()" doc="/**
&lt;p&gt;Returns the element node this attribute is attached to or a null node&lt;/tt&gt; if this attribute is not attached to any element.&lt;/p&gt;
 */"/>
    <method name="public final void setValue(java.lang.String arg__1)" doc="/**
&lt;p&gt;Sets the attribute's value to &lt;tt&gt;arg__1&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QDomAttr.html#value()&quot;&gt;&lt;tt&gt;value&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final boolean specified()" doc="/**
&lt;p&gt;Returns true if the attribute has either been expicitly specified in the XML document or was set by the user with &lt;a href=&quot;QDomAttr.html#setValue(java.lang.String)&quot;&gt;&lt;tt&gt;setValue&lt;/tt&gt;&lt;/a&gt;. Returns false if the value hasn't been specified or set.&lt;/p&gt;

@see &lt;a href=&quot;QDomAttr.html#setValue(java.lang.String)&quot;&gt;&lt;tt&gt;setValue&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final java.lang.String value()" doc="/**
&lt;p&gt;Returns the value of the attribute or an empty string if the attribute has not been specified.&lt;/p&gt;

@see &lt;a href=&quot;QDomAttr.html#specified()&quot;&gt;&lt;tt&gt;specified&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QDomAttr.html#setValue(java.lang.String)&quot;&gt;&lt;tt&gt;setValue&lt;/tt&gt;&lt;/a&gt; */"/>
</class>