@ dmaryakh- need more help

hi again,
i need to know what to do for special characters like % # " or even space  
i made a text file with what i made for convert.xom :
and should i keep that bottom part that came from unimap.xin??
thanks for all your help.





Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I am curious, did you just posted a trunkated version of the unimap.xim or you deleted the mapping for hte character entities? Ther bottom part is a functions declarations. In my sample I do use at least one function 'get-unicode-values' so you do need to keep this section.
As for the 'special character', you should be fine.

Here is what you have to have in your converter.xom
NOTE: the second find rule will take care of all characters that were not matched in the first rule. If you analize the first rule it looks for anything that start with '&' ends with ';' and have at least one(ANY) character which is not a word-end. when the first find rule failes, the second find rule (catch all) will grab any one character in the data stream and run it thought the conversion, thus all your spaces, colons, semo-colons, etc would get converted.

include "unimap.xin"

find "&" ((LOOKAHEAD NOT WORD-END)ANY)+  => temp ";"
     local counter tester
     local counter unicode-values variable initial-size 0
     set tester to get-unicode-values for "%x(temp)" into unicode-values
     output "&#%d(unicode-values);"

find any=>tmp
     local counter tester
     local counter unicode-values variable initial-size 0
     set tester to get-unicode-values for "%x(tmp)" into unicode-values
     output "&#%d(unicode-values);"

Ok I just modified my version of the unimap.xin to include numerical character references from ISO8859-1 (commonly known as Latin-1). You were on the right track, however there was a tiny error in your code which  is easily fixed, namely codes for double-quote and percent sign have to be escaped in omnimark. Here is correct shelve entries:

    "34" with key "%"",
    "37" with key "%%",

I would also advise coding the exdended ascii as well. I would also advice to keep all the character entities declarations in the shelves, so your code should come before the one that is already there in the folowing manner:

    "121" with key "y",
    "122" with key "z",
    "57928" with key "angzarr",
    "57936" with key "cirmid",

If you dont care about the character entities, then unimap.xin is an overkill for your purposes.

Also I wound a minor problem when we try to process the lin-end character since it is not on the shelve that causes the script to crash.

Here is what you have to do to avoid that, modify the second find rule in the converter.xom to read:
        find [any except "%n"]=>tmp

this will exclude new lines from being converted and they just be left alone in your output

here are results of my test:
input (I used russian character entities):

Hello &
Привэт &


Hello &
Привэт &

sayhiAuthor Commented:
From Omnimark C/VM
OmniMark Error 3023 on line 95 in file htmlentities.xin:
Syntax Error.

From Omnimark IDE
Expecting a value, but received '}'.
OmniMark Error:
Syntax Error.
Expecting a numeric expression, but received '}'.
highlights  "122" with key "z",

To get the command line running what i do is go start>run>command then type something like: omnimark.exe convert.xom index.html -of output.txt -l log.txt

am i doing this correctly?
then when combining the htmlentities.xin with unimap.xin how would it look like? Like this http://uffstay.virtualave.net/both.txt ?
i kinda understand what i'm doing... right now i'm just trying to follow directions :) i haven't gotten this to work yet ;)
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

this is because you have a colon after the "z" and before the "}". Remove the colon and this error should go away.
as for command line here is what you have to type:
path_to_omni/omnimark -s converter.xom your_file.in -of your_file.out

I checked your link and the second version is correct, you have to merge entries for the ASCII chars and character entities together on the same shelve (that is how this structure called in OmniMark), also you only need unicode-entities shelve to be updated, since you are not using the back translation.

you might consider downloading OmniMark IDE for Home&School (free) if you are interested in the language at all. It eliminates those error that you are having right now.
sayhiAuthor Commented:
i think i'm almost there (i have both Omnimark C/VM  and OmniMark IDE for Home&School) but now i get this error:
 OmniMark Erro 6077 on line 15 in file converter.xom:
Attempting to use out-of-range shelf item selector.
For COUNTER 'UNICODE-VALUES', size is 0 and item selector is 0.

There was 1 error detected.

Thank you soo much for all your assistance!
Looks like you might have a typo.

Here is an URL for you to check. It has all of the programs


If you need those file separated, here where wo the each one of them

http://free.prohosting.com/~dmaryakh/unimap/test.txt - the file for input
http://free.prohosting.com/~dmaryakh/unimap/unimap2.xin modified unimap
http://free.prohosting.com/~dmaryakh/unimap/mytester.xom  - program to convert files


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sayhiAuthor Commented:
Adjusted points to 160
sayhiAuthor Commented:
You're probably right about the typo... but THANK YOU VERY MUCH! It all works fine now, i appreciate you patience with me. Thank you again.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.