Pages: 1
Print
Author Topic: Script error in XMetaL 8.0  (Read 5191 times)
tmakita
Member

Posts: 26



WWW
« on: April 06, 2013, 12:54:02 PM »

Dear Support,

I'm using XMetaL 8.0 on Windows 7 and DITA map editor seems to have some difficulties.

When I opened some bookmap and tried to switch to XML view using File > Switch to XML View of Map, XMetaL displays following dialog.



If I click "(Y)", following dialog appears telling that there is error in script.



In another case if I open a bookmap and tried to close it using FIle > Close Map menu, XMetaL asks to me whether to save changes. If I respond "Yes", following error dialog appears that also reports the script error:



In both cases the XMetaL windows become hidden and I cannot invoke XMetaL never again because it still alive as process. Here is a Windows task manager snap shot. You can see that xmetal80.exe exists. If I terminate xmetal80.exe, I can invoke XMetaL.



Please tell me how to avoid this error. If support team needs the sample data, I can send it.

Regards,


* save_change.png (20.19 KB, 377x191 - viewed 757 times.)

* map_error.png (24.08 KB, 513x326 - viewed 772 times.)

* map_errror2.png (23.76 KB, 513x326 - viewed 803 times.)

* task_manager.png (40.39 KB, 478x430 - viewed 796 times.)
« Last Edit: April 07, 2013, 07:50:32 PM by tmakita » Logged

Toshihiko Makita
Development Section
Antenna House, Inc.
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: April 08, 2013, 03:32:51 PM »

You may wish to try one of the samples included with 8.0. The files that are DITA samples are listed in Help > Samples with (DITA) at the end. Open one of those and test.

If the issue occurs then we can assume this is an installation issue or something specific to your environment. Repairing or reinstalling the software will typically fix these types of problems (one or more files in your installation may have been modified or removed).

If the issue does not occur then your "boomap_sample.ditamap" might be triggering the problem. In that case please submit the file needed to reproduce this issue to XMetaL Support.
Logged
XMetaLOldTimer
Administrator
Member

Posts: 57


« Reply #2 on: April 08, 2013, 05:55:18 PM »

It looks like you have hit upon a script error in the XMetaL MapEditor code.  Please extract the attachment into the Author\Startup folder and try again.

Thanks,
Addam

* xmee_80_20130408.zip (1.27 KB - downloaded 223 times.)
« Last Edit: April 08, 2013, 06:36:44 PM by XMetaLOldTimer » Logged

Addam Smith, XMetaL Project Lead & Architect
JustSystems Canada Inc.
tmakita
Member

Posts: 26



WWW
« Reply #3 on: April 08, 2013, 11:45:01 PM »

Dear Addam,

I applied the .mcr patch to XMteaL 8.0.
But the error still occures. I have tested this data in 2 PC (Both Windows 7 32bit/64bit Japanese version). The results are the same.
I think this is data dependent difficulty. So I attached the test data (20130409-edit-test.zip).

If I open bookmap_sample.ditamap via MapEditor and select File > Switch to XML View of Map, XMetaL displays following dialog.



If I click "(Y)", the script error dialog appears.



Please verify this phenomenon in your PC environment.

Regards,

* 20130409-edit-test.zip (36.1 KB - downloaded 195 times.)

* switch_to_xml_view.png (19.37 KB, 384x191 - viewed 699 times.)

* script_error_document_element.png (22.08 KB, 513x326 - viewed 716 times.)
« Last Edit: April 08, 2013, 11:48:06 PM by tmakita » Logged

Toshihiko Makita
Development Section
Antenna House, Inc.
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #4 on: April 09, 2013, 04:13:42 PM »

The map editor has some code that is attempting to preserve the encoding attribute in your XML declaration and it is having issues with the UTF-16 encoding in your bookmap_sample.ditamap, which is why the other maps you are trying don't trigger this issue, because they use UTF-8 encoding.

As we look at what it will take to actually resolve this issue the quickest solution would be to use UTF-8 encoding. I suspect you must have created these maps using some other tool as XMetaL uses UTF-8 encoding as its default (the W3C recommended encoding for XML).
Logged
XMetaLOldTimer
Administrator
Member

Posts: 57


« Reply #5 on: April 09, 2013, 04:54:28 PM »

I was able to verify this phenomenon on my PC.  You have uncovered two separate issues.  I have attached an updated patch that should fix this 2nd issue.  The issue occurred because we duplicated the encoding='UTF-16" declaration.

Regards

* xmee_80_20130408.zip (1.68 KB - downloaded 245 times.)
« Last Edit: April 09, 2013, 06:18:43 PM by XMetaLOldTimer » Logged

Addam Smith, XMetaL Project Lead & Architect
JustSystems Canada Inc.
tmakita
Member

Posts: 26



WWW
« Reply #6 on: April 09, 2013, 07:41:04 PM »

Dear Derek and Addam,

Thank you for your effort. I applied your newest patch to XMetaL 8.0. But another error occurs if I swiched from Map Editor to XML View or Exit without any editing after opening the .ditamap. Following is the error dialog:



However I surely applied your newest patch:



Quote
As we look at what it will take to actually resolve this issue the quickest solution would be to use UTF-8 encoding.
I suspect you must have created these maps using some other tool as XMetaL uses UTF-8 encoding as its default
 (the W3C recommended encoding for XML).

Yes, originally this bookmap was authored by XMetaL by my user. After editing it is stored in their CMS. It seems that UTF-16 is the default encoding that CMS outputs.

Please test the attached bookmap_sample_utf8_with_bom.ditamap, bookmap_sample_utf8_wo_bom.ditamap, bookmap_sample_utf16le_with_bom.ditamap in 20130410-edit-test.zip. In my PC environment above error dialog appers for all of these ditamaps when opened with patched XMetaL 8.0.

Regards,
 





* script_error_after_patch_20130408_2nd.png (21.98 KB, 513x326 - viewed 713 times.)

* xm8_startup.png (107.53 KB, 1043x496 - viewed 682 times.)
* 20130410-edit-test.zip (37.79 KB - downloaded 198 times.)
« Last Edit: April 09, 2013, 07:42:40 PM by tmakita » Logged

Toshihiko Makita
Development Section
Antenna House, Inc.
XMetaLOldTimer
Administrator
Member

Posts: 57


« Reply #7 on: April 10, 2013, 07:59:38 PM »

The MapEditor feature doesn't support editing ditamaps containing the BOM character.  The only workaround is to remove the BOM character before opening the file with the MapEditor or use only the XML view for editing ditamaps with the BOM character. 

Part of this limitation in the MapEditor is due to the scripting technologies underneath, namely FileSystemObject and MSXML.  We load the XML from file into a string (BSTR object) before passing it to  MSXML.  But, the MSXML loadXML API has limitations as noted in the following MSDN KB article:

http://support.microsoft.com/kb/247708


Regards,
Addam
Logged

Addam Smith, XMetaL Project Lead & Architect
JustSystems Canada Inc.
tmakita
Member

Posts: 26



WWW
« Reply #8 on: April 16, 2013, 07:47:47 PM »

Finally I removed all the patch which you supplied to me. Here are my test results:

bookmap_sample_utf8_wo_bom.ditamap: No problem.
bookmap_sample_utf8_with_bom.ditamap: No problem.
bookmap_sample_utf16le_with_bom.ditamap: Error dialog appears when I switch to XML View of Map. This problem was fixed when changing encoding to UTF-8 (No BOM).

So as you said it is the best solution to change the map encoding fro UTF-16 to UTF-8.

Regards,

Toshihiko Makita
Logged

Toshihiko Makita
Development Section
Antenna House, Inc.
Pages: 1
Print
Jump to: