Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] I am new to XOM, can I create and read XML documents that contains Japnese characters? Please reply soon, URGENT!! Thanks!

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Angela Amoateng <angela.amoateng AT kcl.ac.uk>
  • To: xom-interest AT lists.ibiblio.org, Ed Davies <edavies AT nildram.co.uk>
  • Subject: Re: [XOM-interest] I am new to XOM, can I create and read XML documents that contains Japnese characters? Please reply soon, URGENT!! Thanks!
  • Date: Sun, 20 May 2007 18:35:12 +0100

Hi Ed,

Thanks for your advice! I am learning more about attributes and elements and which one would be best, when using methods to retrieve the Japanese word or English word. I am still trying to get the grips with the syntax of XML, but it definitely would be best for me, because of the tree- like structure.

Conveying each set of words how you suggested as elements, seems to be a good idea, since I would want to break down what type of word it is, i.e. verb or noun or a phrase. Would this tree structure be best? :

<words>
<noun>
<english>apple</english>
<japanese>ringo</japanese>
</noun>

...

<noun>
<english>book</english>
<japanese>hon</japanese>
</noun>

<verb>
<english>eat</english>
<japanese>tabemasu</japanese>
</verb>

...

<verb>
<english>see</english>
<japanese>mimasu</japanese>
</verb>

<phrase>
<english>How are you?</english>
<japanese>ogenki desuka</japanese>
</phrase>

...

<phrase>
<english>Good bye</english>
<japanese>sayonara</japanese>
</phrase>
</words>

Would XOM be able to read this and return the content in the elements, so that I could display it in a JTextfield? Will it also be able to read Japanese characters (unicode) too? I am using romanised Japanese in the Japanese tags.

Thanks again in advance!

Angela

Quoting Ed Davies <edavies AT nildram.co.uk>:

Angela Amoateng wrote:
2) Can I create an XML document using XOM model, that will enable me to have an "EqualsTo" function for each word. For example, "apple" in Japanese is "ringo" so:

<word>apple = ringo <word>

Expanding on what Grzegorz said, XML is only really a syntax
for data. It doesn't have any "understanding" of the meaning
so if you chose to use the "=" sign to delimit the words in
the two languages that would be fine but XML will just treat
the sequence of characters between the "<word>" start and end
tags (I assume you meant the second "<word>" to be an end tag,
"</word>") as just that, a sequence of characters with no
additional meaning.

On the other hand, XML is intended to convey the structure
of the data using its own syntax. Adding your own delimiters
(e.g., your "=" symbol) is rather missing the point. To
make slightly better use of XML in this sort of case you
might choose a form like:

<word>
<english>apple</english>
<japanese>ringo</japanese>
</word>

Alternatively, you could use:

<word english="apple" japanese="ringo"/>

There are all sorts of reasons for choosing elements and/or
attributes. In a case like this, you'd use elements if
there is any need to add mark up within the words. E.g..,
you might want to mark word stems the way dictionaries do.

Well, I think that's plenty on XML generalities for a XOM
specific list. I suggest you have a read up on XML before
deciding if it's appropriate for your project.

Ed.





--
Angela Amoateng
angela.amoateng AT kcl.ac.uk





Archive powered by MHonArc 2.6.24.

Top of Page