Compartilhar via


WriteAttributeString

 

Writes an attribute.

Syntax

  
HRESULT WriteAttributeString (cont WCHAR * pwszPrefix,  
    const WCHAR * pwszLocalName, const WCHAR * pwszNamespaceUri,  
    const WCHAR * pwszValue);  

Arguments

pwszPrefix
The namespace prefix for the attribute. NULL is equivalent to an empty string.

pwszLocalName
The local name of the attribute. NULL is a valid value only if pwszPrefix has a value of xmlns.

pwszNamespaceUri
The namespace URI for the attribute. NULL is equivalent to an empty string.

pwszValue
The value of the attribute. NULL is equivalent to an empty string.

Return Value

Returns S_OK if no error is generated.

Remarks

When the attribute name is xmlns, this method also treats the attribute as a namespace declaration and associates the declared prefix with the specified namespace. In this case, if a namespace has already been specified for this element, that namespace is overridden and any child elements written with the original namespace are automatically written out as part of the new namespace.

If NULL is supplied for pwszLocalName and the value of pwszPrefix is not xmlns, this method returns an error.

Requirements

Header: XmlLite.h

Library: XmlLite.lib

See Also

IXmlWriter Methods