Error -619 using XML Tools, but only in an applet
Error -619 using XML Tools, but only in an applet
- Subject: Error -619 using XML Tools, but only in an applet
- From: Scott Norton <email@hidden>
- Date: Wed, 25 Jul 2001 23:08:06 -0400
I'm using XML Tools 2.2, and getting an error that only occurs when my
script is running as an applet. Here's a simplified script that illustrates
the error. (Mind the line wrap on the first property declaration. The
property and URL should all be on one line.)
property XMLroot : "file:///Utilities/ListSTAR/SMTP/AppleScripts/
DTI Package/XML Parsing Rules/"
property testXML : "<?xml version=\"1.0\" ?>
<!-- Processing rule for xxxx E-mail parser -->
<!DOCTYPE Rule SYSTEM \"" & XMLroot & "Rule.dtd\"
[ <!ENTITY % FormFields SYSTEM
\"" & XMLroot & "Test Worksheet.dtd\" >
%FormFields; ] >
<Rule>
<verify title = \"Test verify and symbol substitution\"
search = \"XY[here]Y\" abort = \"yes\" />
<replace title = \"Do an arbitrary change\" when = \"always\"
search = \"XY\" replace= \"YX\" />
</Rule>
"
parse XML testXML with expanding external entities
The XML I've put together references two external entities: the Rule DTD
(which describes the rules like <verify> and <replace>) and the Worksheet
DTD, which has entities that describe components that are present in a
specific worksheet. (The application is a rule-based parser for worksheets
submitted by e-mail. The rules are described using XML.) I trimmed down
the DTD files to their essentials while still causing the error. The
external entities that were used when the error occurred were as follows:
The Rule DTD (name "Rule.dtd") is this:
<!-- Output and processing entity definitions for xxxx E-mail parser.
This file defines the syntax of a rule file for the xxxx Parser -->
<!-- Entities for output and processing of xxxx -->
<!ENTITY FS "§">
<!ENTITY R "¶">
<!ENTITY T "†">
<!ENTITY OB "≤">
<!ENTITY CB "≥">
<!-- Element definitions for rules -->
<!ELEMENT Rule ( ( verify | replace | annotate )* ) >
<!ENTITY % yesNo "( yes | no )" >
<!ELEMENT verify EMPTY>
<!ATTLIST verify
title CDATA #IMPLIED
abort %yesNo; "no"
search CDATA #REQUIRED
error CDATA #IMPLIED
mark CDATA #IMPLIED
markup CDATA #IMPLIED >
<!ELEMENT replace EMPTY>
<!ATTLIST replace
title CDATA #IMPLIED
when ( always | clean ) #REQUIRED
search CDATA #REQUIRED
replace CDATA #REQUIRED >
<!ELEMENT annotate EMPTY>
The Worksheet DTD normally has a lot of entities defined, but the test
doesn't use any of them. I created a test version with just one entity
definition (named "Test Worksheet.dtd").
<!ENTITY Year2digit "01" >
When I run the script in Script Editor or Smile, the parse XML command works
correctly, returning the record structure I expect. But if I save it as an
applet (from either Script Editor or Smile), I get an "error -619" on the
'parse XML...' line. That error number has no associated message, and isn't
listed in _Inside Macintosh: Result Codes_.
Once this error occurs, the system can become unstable, and starts dropping
into MacsBug with illegal memory references on subsequent calls to XML Tools
(from Script Editor or Smile, or from the applet).
Does anyone have any thoughts on what might be causing this error (and only
causing it in an applet?) I've made sure the script has enough memory (I
gave this example 8 meg). The problem seems to be associated with the
absolute paths I'm using in the <!DOCTYPE> string; I haven't seen the
problem when I pass the base URL separately and use a relative path for the
DTD. But at one point, I need to use absolute paths.
I'm using MacOS 9.1 with CarbonLib 1.3.1, and AppleScript 1.6, using Script
Editor 1.6, and Smile 1.7.5. XML Tools is version 2.2.
--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden