Lexicon XHTML file - Parsing Error

I don’t build a lot of Dictionary apps. I’ve been given a couple of FLEx files that were not working out as the app requestor wanted so they sent some xhtml files to try. Now I am not able to get past the first screen of starting a new app. I choose the xhtml file and clicking next receive the message:

Failed to load lexicon.
Error parsing LIFT file:
Line 10 Column 3: The element type “meta” must be terminated by the matching end-tag “”.

I have opened the xhtml with a text editor and all that shows on line 10 is:

This is preceded by a number of lines defining things like:

Not sure what to do or try next.

Hello DNev,
I probably won’t be able to help you but I’m curious about this problem. So, you yourself don’t have the FLEx project? And what were you given for import into DAB, a LIFT or an XHTML file? What was the exact export method used in FLEx?

Also, I’m afraid whatever you wanted to quote or upload, it didn’t work and leaves your message a little cryptic.

Hi Rhina,
Yes, you are correct, I don’t have the FLEx project. I was originally given a LIFT file which I used to build the DAB. It worked, but the requestor noted the app was presenting English in some of the word definitions where Spanish or Lacandon was expected. He then spoke with someone who said he needed to export to xhtml, which he did and sent to me.

When I tried to use the xhtml in the current app, I was not able to add it. Starting a new app, the first step is to select a LIFT or XHTML file. When I chose the XHTML file the message I see is the following lines between the lines.

Failed to load lexicon.
Error parsing LIFT file:
Line 10 Column 3: The element type “meta” must be terminated by the matching end-tag

On line 10 all I see is, <"/head> without the quote, which I had to include to show the leading <.

Line 1 defines the <html lang…
Line 2 shows <"head> - again without the quote mark.
Lines 3-9 show other <meta name=… definitions

I don’t know what method is used to get the files from the FLEx program. I will send a copy of your message to the original one wanting the app and see what sort of reply I receive. Thanks for your interest and any suggestions.

Interesting, that DAB talks of a LIFT file when you clearly try to import XHTML. Anyway, maybe your contact chose the wrong XHTML export option. I quote the manual:

DAB supports XHTML files which have been exported from FieldWorks Language
Explorer (FLEx). XHTML files generated from other sources are not supported.
In FLEx, select File > Export, then choose ‘Configured Dictionary (XHTML)’.
You will also need to export a Reversal XHTML file for each index language. To do
this, select File > Export, then choose ‘Reversal Index (XHTML)’.

In my Fieldworks 9.0 the options needed are called Configured Dictionary (Format: XML) and Reversal Index (Format: XML).

It seems like your XHTML file has been converted to HTML that is not acceptable as XHTML.

This is a meta tag for HTML

<meta http-equiv="content-type" content="text/html; charset=utf-8">

And this is the one for XHTML. Spot the difference?

<meta http-equiv="content-type" content="text/html; charset=utf-8"/>

The XHTML has a closed meta element. it is closed by the / as the second last character.

HTML parsing is very permissive. XHTML is very precise.

I’d guess someone opened the XHTML in a HTML editor and it was saved as HTML thus losing the critical small change.

Wow, Ian! Good catch and nice sleuthing.

Interestingly, I received a new XHTML from the source today and it let me build the dictionary app so something on their end changed. I’ll pass on your comments, so this is a lesson learned for all of us.