publicId Property (IXMLDOMEntity)

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - DOM Reference

publicId Property (IXMLDOMEntity)

Contains the public identifier associated with the entity.

[Script]

Script Syntax

strValue = oXMLDOMEntity.publicId;
[Visual Basic]

Visual Basic Syntax

strValue = oXMLDOMEntity.publicId
[C/C++]

C/C++ Syntax

HRESULT get_publicId(
    BSTR *publicID);

Parameters

publicID [out, retval]
The 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
The value returned if successful.
S_FALSE
The value returned if no public ID is specified.
E_INVALIDARG
The value returned if the publicID parameter is Null.

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();
}

Remarks

String. The property is read-only. If the public identifier is not specified, the property contains the empty string.

To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

Applies to: IXMLDOMEntity