OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

xliff message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [xliff-comment] Comment on XLIFF 1.2 Representation Guide forJava Resource Bundles


Hi,

The representation guide recommends to preserve the order of key/value pairs, but it does not tell you to rely on java.util.Properties.

It is possible to write filters for .properties files using many languages, not only Java. And when using Java, it is also possible to use different methods for reading .properties files.

In http://xliff-tools.freedesktop.org/wiki/Projects/XliffToolsJava you can find a filter for XLIFF 1.1 written in Java. You can use it as an example and adapt the code for supporting XLIFF 1.2 and the new representation guide.

Best regards,
Rodolfo M. Raya
Heartsome

On Thu, 2007-01-18 at 13:22 +0800, Jia Zeng Wang wrote:
Hi, I'm reading XLIFF 1.2 draft spec and have a comment on its
representation guide for Java Resource Bundles:

In 2.4, Extraction Techniques, it recommends to use java.util.Properties to
extract resources. In 2.5, Order of Extraction, it says filters should keep
key/value order defined in property files. But java.util.Properties uses
HashTable as its internal data structure, so it can't guarantee the order
of key/value pairs.

Following is my test program and data:

LoadProp.java
========================================================================================
import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;

public class LoadProp {
      public static void main(String[] args) throws Exception {
            Properties props = new Properties();
            props.load(new FileInputStream(new File("test.properties")));
            props.storeToXML(System.out, "test");
      }
}

test.properties
=========================================================================================
key0=key0
key1=key1
key2=key2
akey1=akey1
akey2=akey2

program output
========================================================================================
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>test</comment>
<entry key="akey2">akey2</entry>
<entry key="akey1">akey1</entry>
<entry key="key2">key2</entry>
<entry key="key1">key1</entry>
<entry key="key0">key0</entry>
</properties>


I recommend to add this point in 2.4 or 2.5 to notify future readers.



====================================================
Best Regards,
Charles Wang
China Development Laboratory
8/F Shui On Plaza, 333 HuaiHai Zhong Road, Shanghai
--
The information in this e-mail is intended strictly for the addressee, without prejudices, as a confidential document. Should it reach you, not being the addressee, it is not to be made accessible to any other unauthorised person or copied, distributed or disclosed to any other third party as this would constitute an unlawful act under certain circumstances, unless prior approval is given for its transmission. The content of this e-mail is solely that of the sender and not necessarily that of Heartsome.


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]