Microsoft XML 2.5 SDK


 

IXMLDOMEntity::get_publicId Method

[This is preliminary documentation and subject to change.]

Contains the public identifier.

Visual Basic Syntax

strValue = oXMLDOMEntity.publicId

C/C++ Syntax

HRESULT get_publicId(

    BSTR *publicID);

Parameters

publicID

[out]
Public identifier associated with the entity, if specified. If the public identifier is not specified, contains the empty string.

C/C++ Return Values

S_OK

Value returned if successful.

S_FALSE

Value when returning null.

E_INVALIDARG

Value returned if publicID is null.

C/C++ Example

IXMLDOMEntity *pIXMLDOMEntity = NULL;
VARIANT varName ;
HRESULT hr;

try
{
   // see help on IXMLDOMEntity::get_notationName Method for definition of the GetFirstEntity() method
   pIXMLDOMEntity = GetFirstEntity();

   if(pIXMLDOMEntity)
   {
      hr = pIXMLDOMEntity->get_publicId(&varName);
   if(SUCCEEDED(hr))
         ::MessageBox(NULL, _bstr_t(varName), _T("Public ID"), MB_OK);
      pIXMLDOMEntity->Release();
   }
}
catch(...)
{
   if(pIXMLDOMEntity)
      pIXMLDOMEntity->Release();
   DisplayErrorToUser();
}