anshuwap / glossword

Automatically exported from code.google.com/p/glossword
0 stars 0 forks source link

Cannot import terms #170

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
= What steps will reproduce the problem?
1. Go to the import terms page
2. Select any of the options (CSV, Glossword XML, or XML
3. Either upload a CSV or XML file, or enter terms directly, as follows 
(according to instructions found online for format):

Glossword XML:
<line><term t1="T" t2="TE" is_active="1" 
id="1"><![CDATA[term]]>AAL</term><defn>aircraft approach light 
<trsp><![CDATA[trsp]]></trsp><abbr><![CDATA[abbr]]></abbr><trns><![CDATA[trns]]>
</trns><![CDATA[defn]]><usg><![CDATA[usg]]></usg><syn><![CDATA[syn]]></syn><anto
nym><![CDATA[antonym]]></antonym><see><![CDATA[see]]></see><src><![CDATA[src]]><
/src><address><![CDATA[address]]></address><phone><![CDATA[phone]]></phone></def
n></line>

Other XML:
<entry><term>AZFW</term><definition>actual zero-fuel weight 
</definition></entry>

= What is the expected output? What do you see instead?

Expected outcome: Terms imported.

My outcome: 

Unable to complete operation.
Extra content at the end of the document 

= What version of the product are you using?
1.9.3

= Please provide any additional information below.

Original issue reported on code.google.com by jeanpaul...@gmail.com on 16 Nov 2011 at 8:20

GoogleCodeExporter commented 9 years ago
Please check syntax in XML-file. Try
<?xml version="1.0" encoding="utf-8"?>
<entry><term>AZFW</term><definition>actual zero-fuel weight
</definition></entry>

Original comment by dmitry.s...@gmail.com on 17 Nov 2011 at 4:34

GoogleCodeExporter commented 9 years ago
Thanks... I tried that, but I still get the "Extra content at the end of the 
document" error. Is there something at the end I need to add to close off the 
document?

Original comment by jeanpaul...@gmail.com on 17 Nov 2011 at 1:28

GoogleCodeExporter commented 9 years ago
All right... following some advice online 
(http://www.phphaven.com/article.php?id=14) I got passed the "end of the 
document" error, but now that I've added a root element 
(<document></document>), a new error comes up:

Unable to complete operation.

Input is not proper UTF-8, indicate encoding ! Bytes: 0xAE 0x20 0x43 0x52
xmlParseEntityRef: no name
xmlParseEntityRef: no name
xmlParseEntityRef: no name
xmlParseEntityRef: no name
xmlParseEntityRef: no name
xmlParseEntityRef: no name
xmlParseEntityRef: no name
xmlParseEntityRef: no name
xmlParseEntityRef: no name
EntityRef: expecting ';'
xmlParseEntityRef: no name
xmlParseEntityRef: no name
EntityRef: expecting ';'
xmlParseEntityRef: no name
EntityRef: expecting ';'
EntityRef: expecting ';' 

etc.

Original comment by jeanpaul...@gmail.com on 17 Nov 2011 at 1:49

GoogleCodeExporter commented 9 years ago
Fixed it!

Two issues:

1. Instead of utf-8, it needed to be <?xml version="1.0" 
encoding="iso-8859-1"?> (no idea why)

2. There were apparently some unescaped ampersands in the document. I replaced 
these all with &, and everything was fine.

Original comment by jeanpaul...@gmail.com on 17 Nov 2011 at 2:03