Pages: 1
Print
Author Topic: XMAX without XAC  (Read 531 times)
Markus
Member

Posts: 3


« on: September 16, 2016, 05:37:00 AM »

Hi,

we are creating a Windows application with XMAX 11. Is it required that the customizations are provided as an XAC file? Or can we also use the classic approach that is supported in XMetaL Author:
- myfile.xml is referencing mydtd.dtd
- mydtd.dtd, mydtd.css, mydtd.ctm ... reside in the same folder as myfile.xml

In my tryouts this did not work with XMAX.

Thanks,
Markus


Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2463



WWW
« Reply #1 on: September 16, 2016, 04:11:53 PM »

Yes, XMAX supports what you state here.

However, because XMAX does not use catalog files and has no fall-back folder (like the Rules folder in XMetaL Author) you must specify a SYSTEM id in the DOCTYPE declaration in your XML file that must resolve (ie: the DTD is located there). You can specify a PUBLIC id but it will not be used if the path specified in the SYSTEM id portion cannot be located.

Then when you call either LoadFromString() or LoadFromFile() do not specify a path to an XAC file (second parameter).
Depending on which language you are coding in you may need to specify a null value or empty string value for the syntax to be legal.

Here's an HTML / JScript example for use in a web page:

Code:
<html>
<head>
<title>XMAX Test</title>
</head>
<body>
<div>
<button onclick="newFile()">New File (from string)</button>
<button onclick="closeFile()">Close File</button>
<button onclick="showSpellChecker()" accesskey="S"><u>S</u>pell Check</button>
<button onclick="showAbout()">About...</button>
</div>
<div>
<object classid="CLSID:55EC30BE-EA43-45C4-ABD7-DDA7F6943D46" id="xmax" height="90%" width="100%">
<param Name="EnablePlainTextView" Value="true"/>
</object>
</div>

<script>
var xmlStr = '<?xml version="1.0"?><!DOCTYPE doc SYSTEM "C:\\xmax_html\\test.dtd"><doc><title>testing</title><p>testing</p></doc>';
var xmlDoc = xmax.LoadFromString(xmlStr, "", 1);
}

function closeFile() {
xmax.document.close();
}

function showSpellChecker() {
xmax.showSpellChecker();
}

function showAbout() {
xmax.showAbout();
}
</script>
</body>
</html>
Logged
Pages: 1
Print
Jump to: