Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

ACL code not working


ACL code not working

Using acl scripting in Arbortext Editor 6, How can an sgml file be opened and then save it as xml?

The doc_open method below returns a document identifier.

Providing this document identifier to the doc_save function saves an empty xml file.

Sample ACL Code:

#Open a sgml file

#0x200 - Open the document without loading a stylesheet.

$sgml_doc = doc_open("file.sgml", 0x200)

#save as xml

#0x0020 - Write the document as an XML document

doc_save($sgml_doc, 0x0020, "file.xml")

What should be done differently?


Did you not see my reply to your earlier thread?

There is a different ACL command that converts SGML to XML.

We are executing ACL files via Arbortext Editor Command Line (ex: “source acl_file.acl”).

A document identifier had to be provided to doc_kind() function to allow it to function for the document opened by doc_open().

The following code sample produces an empty xml file. What are we missing?

Sample Code:

cd "c:/folder_to_sgml/"

$sgml_doc = doc_open("sgmlfile.sgm", 0x200)

message "sgml document identifier: $sgml_doc"

$xmlName = "xmlfile.xml"

if (doc_kind($sgml_doc) == "sgml") {

message "document type is: sgml"

save_as -xml "$xmlName"


# Close SGML File


Why did you switch from using doc_save to using save_as?


Did you get this issue resolved?

Was one of the posts helpful or did one answer your question?

Top Tags