From: Stéphane S. <ste...@ep...> - 2012-04-20 08:54:06
|
Hi, I would like to manage multilingual resources in a web application done with eXist and I am seeking for an advice on how to organize the database resources and collections, please apologize me if this list is the wrong place for such discussions. Basically, if there is a resource "mydoc.xml" inside a collection /db/data containing a <Doc>...</Doc> to be stored in two languages, I see two options : Option 1 : create a single resource with two "forks" under a common root (e.g. AnyLanguage) <AnyLanguage> <Doc xml:lang="en">...</Doc> <Doc xml:lang="fr">...</Doc> </AnyLanguage> Option 2: create two collections (en and fr) and store two documents (this also applies to full hierarchies of multilingual resources) collection /db/data/en contains mydoc.xml that contains <Doc xml:lang="en">...</Doc> collection /db/data/fr contains mydoc.xml that contains <Doc xml:lang="fr">...</Doc> Simply considering querying data, I guess with option 1 one would have to write : let $lang := 'en' return collection('/db/data')/AnyLanguage/Doc[@xml:lang = $lang]//{my-path-expression} whereas using option 2 that would be something like: let $lang := 'en' return collection(concat('/db/data/', $lang)//{my-path-expression} I am wondering if there are some hidden drawbacks in using one option or the other (performance, sustainability, etc.) ? Can anybody with experience in this regards could give me an advice ? How do you manage this in your applications ? Thanks in advance, Stéphane S. --- |