How can I change the doctype, which an open document is validated against?

Answered by: Paul Grosso (PTC) Last Updated: 2006-09-23

See the doc_open function (help 696).

In $aptpath/packages/tools/pub_xslfo.acl (near the bottom) is a function called reopen that allows you to pass in the public identifier of the desired doctype and have the current document reopened against that doctype.

The code is something like:

function reopen(publicid) {       local sysid = , flags = 64+256, name = ; # Get current doc info local doc = current_doc, win = doc_window(doc); local path = doc_path(doc); # Close current doc... doc_close(doc); # ...then reopen it using the given publicid doc = doc_open(path, flags, name, publicid, sysid); doc_show(doc, win); }
 * 1) Reopen the current document using the specified public id

You may want to experiment with different flags depending on what you want to happen when the document is reopened.