Description
Sets the public ID of an externally referenced DTD.
Syntax
pbdom_doctype_name.SetPublicID(string strPublicID)
Argument |
Description |
---|---|
pbdom_doctype_name |
The name of a PBDOM_DOCTYPE object |
strPublicID |
A string that specifies the new public ID |
Return value
PBDOM_DOCTYPE.
Examples
Suppose you have the following DTD declaration:
<!DOCTYPE abc [<!ELEMENT abc (#PCDATA)> <!ELEMENT data (#PCDATA)> <!ELEMENT inner_data (#PCDATA)>]>
The following PowerScript sets the public ID, and then gets it and displays it in a message box:
PBDOM_DOCUMENT pbdom_doc pbdom_doc.GetDocType().SetPublicID & ("-//MyCompany//DTD//EN") MessageBox ("Get Public ID", & pbdom_doc.GetDocType().GetPublicID())
The returned string from the GetPublicID call is:
"-//MyCompany//DTD//EN"
The final DOCTYPE definition in the document is:
<!DOCTYPE abc PUBLIC "-//MyCompany//DTD//EN" [<!ELEMENT abc (#PCDATA)> <!ELEMENT data (#PCDATA)> <!ELEMENT inner_data (#PCDATA)>]>
About Public ID
The PUBLIC ID is usually accompanied by a SYSTEM ID, so the DOCTYPE declaration in this example (with a PUBLIC ID but no SYSTEM ID) might be considered invalid by some parsers.
See also