General XMetaL Discussion
sapraaman August 21, 2010 at 7:38 am
entities issueAugust 21, 2010 at 7:38 amParticipants 1Replies 2Last Activity 11 years, 10 months ago
We are facing a weird issue with xmetal. Our xml file has entities in hex format. One specific entity”&” occurs both in element content and in attribute values.
When such an xml file is opened by xmetal, the above entity is successfully converted into “∓” in element content but is converted into “&” in attribute values. This causes an invalid document to exist in xmetal.
1. It seems like a bug with xmetal. How can we get it fixed?
2. Any workarounds we can do in xmetal for this issue. The modification of the file outside xmetal is not a possibility.
3. I tried writing an application level macro “On_Application_Before_Document_Open”, and thought of changing the file before it is processed by xmetal. However
a. The above macro seems to be getting called after the document has been opened. I figured that out by showing an alert. The alert was displayed after the document was displayed
b. Even if the above is not correct, I could not find an API to write a file, though there is an API to read the file.
4. I wrote On_Document_Open_Complete macro for the specific DTD and tried fixing all such attributes. However, for a file size of 2 MB, this pre-processing takes more than 20 minutes. So this solution is also not acceptable.
We are using XMetal 5.5 Any help with the above will be great.
AmanDerek Read August 23, 2010 at 10:21 pm
Reply to: entities issueAugust 23, 2010 at 10:21 pm
I'm surprised your script takes so long. 2MB is pretty large but I think I have a script that will work faster (I'm talking at most seconds, not a 1/3 of an hour). However, if you have many of these files it may ultimately be best to address this issue as a batch process outside of XMetaL Author.
Please try the scripting workaround provided as an MCR file located here:
- You must be logged in to reply to this topic.