Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

Workshop  |  XML (Extensible Markup Language)

IDOMElement::setAttribute Method


Sets the value of the named attribute.

Syntax

HRESULT setAttribute(
    BSTR name,
    VARIANT value);

Parameters

name
[in] Name of the attribute. If an attribute with that name already exists, its value is changed. If an attribute with that name does not exist, it is created.
value
[in] Value for the named attribute.

Return Value

Returns S_OK if successful, or an error code otherwise.

Remarks

If an attribute with the supplied name already exists, this method changes its value to the supplied value parameter. The supplied string is not parsed, so any markup is treated as literal text (such as syntax to be recognized as an entity reference), and needs to be appropriately escaped by the implementation when it is written out.

In order to assign an attribute value that contains entity references, the user must create an IDOMAttribute object plus any IDOMText and IDOMEntityReference objects, build the appropriate subtree, and call the setAttributeNode method.

See Also

IDOMElement


Does this content meet your programming needs? Write us!

Back to topBack to top

© 1998 Microsoft Corporation. All rights reserved. Terms of use.

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site