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

 


Help: OASIS Mailing Lists Help | MarkMail Help

xliff-comment message

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


Subject: Comment on XLIFF 1.2 Representation Guide for Java Resource Bundles



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


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