cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neeme Praks" <>
Subject RE: ResourceBundles - was [RT] i18n
Date Wed, 21 Jun 2000 16:13:58 GMT

> -----Original Message-----
> From: Mike Engelhart []
> Sent: Wednesday, June 21, 2000 5:16 PM
> To: Neeme Praks
> Subject: Re: ResourceBundles - was [RT] i18n
> on 6/20/00 3:36 PM, Stefano Mazzocchi at wrote:
> >> And then I could address then like:
> >> 
> >> String role = "forms/contacts-search/desc";
> >> ResourceBundle res = XMLResourceFactory.getResourceBundle(role);
> >> res.getString("searchfor");
> >> 
> >> Is this reasonable?
> is "/forms/contacts-search/desc" a valid XPath to the <group 
> name="desc"> node?
> I'm confused.

well... it is not really an XPath... something simpler. XPath would be 

However... now that I think of it, I could have a special structure for
my application and use real XPath
"/resources/forms/contacts-search/desc/searchfor" for referencing.
This also has the benefit that I can use XSchema to enforce all the
different i18n files to have the same information/structure.

So, something like this:

<resources xml:lang="en">
		    <from-mycontacts>my contacts</from-mycontacts>
		    <from-allmembers>all members</from-allmembers>
			    <firstname>first name</firstname>
			    <lastname>last name</lastname>

instead of 

<resources xml:lang="en">
  <group name="forms">
	  <group name="contacts-search">
		  <group name="desc">
		    <resource name="searchfor">find:</resource>
		    <resource name="field-to-search">what:</resource>
		    <resource name="from">where:</resource>
		    <resource name="from-mycontacts">my
		    <resource name="from-allmembers">all
		  <group name="input">
			  <group name="field-to-search">
			    <resource name="all">all</resource>
			    <resource name="firstname">first
			    <resource name="lastname">last
			    <resource name="phone">phone</resource>
			    <resource name="email">e-mail</resource>
		    <resource name="submit">Search</resource>

Actually, can some more experienced XML specialist comment, what are the
pros and cons of these two approaches? I start to favor the first
one...any con's there? what are the pros/cons of the latter one?


View raw message