SetProperty (IXmlReader)

 

Sets the specified property.

  
HRESULT SetProperty ([in] UINT nProperty, [in] LONG_PTR pValue);  

nProperty
The Enum that identifies the property to be set.

pValue
The property value.

Returns S_OK if no error is generated. If an invalid property name is passed, returns E_NOTIMPL.

For information about the properties this method can set, see IXmlReader Properties.

A program should only set properties before parsing starts—that is, before the first call to Read.

The following code sets the XmlReaderProperty_DtdProcessing property to prohibit DTDs.

if (FAILED(hr = pReader->SetProperty(XmlReaderProperty_DtdProcessing, DtdProcessing_Prohibit)))  
{  
    wprintf(L"Error setting XmlReaderProperty_DtdProcessing, error is %08.8lx", hr);  
    return -1;  
}  

Header: XmlLite.h

Library: XmlLite.lib

IXmlReader Methods
GetProperty (IXmlReader)

Show: