ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Atherton <br...@callenish.com>
Subject Re: xmlproperties task
Date Fri, 22 Feb 2008 22:56:45 GMT
What I think you are missing is that the XML hierarchy translates into 
the name of the property. This is true whether you use Semantic 
Attributes or not, since they do not alter the name.

Your XML file actually defines the same property name over and over 
again. If keepRoot were set to true, this would be 
"properties.property", but since you specify that the root tag should be 
ignored, the one property name is named "property".

What your XML should look like to get the results you want is:

<properties>
    <dispatcher>
        <theme>pelt</theme>
        <theme-ext>.fv</theme-ext>
    </dispatcher>
</properties>

Leave keepRoot set to false, and you don't need semanticAttributes 
unless you prefer using the value attribute instead of the contents of 
the tag or if you want to use Ant references inside the configuration file.

Thorsten Scherler wrote:
> Hi all,
>
> we at forrest are in the middle to harmonize the definition of our
> properties system and we want to switch to an xml based on
> (forrest.properties.xml).
>
> We already use this file in the rest of our application. The format is
> as follow:
>
> <properties>
>   <property name="dispatcher.theme" value="pelt"/>
>   <property name="dispatcher.theme-ext" value=".fv"/>
> </properties>
>
> Doing a change in our core ant build did not brought the expected
> result.
>
> Index: forrest.build.xml
> ===================================================================
> --- forrest.build.xml   (revision 629705)
> +++ forrest.build.xml   (working copy)
> @@ -77,6 +77,9 @@
>  <!-- people should use -D switch, or <ant><property>s to override these
> -->
>      <property name="project.home" location="." />
> -    <property file="${project.home}/forrest.properties" />
> +    <xmlproperty file="${project.home}/forrest.properties.xml" 
> +      semanticAttributes="true" keepRoot="false"/>
> +    <echoproperties destfile="${project.home}/filter.properties"/>
>
> The last line is for debugging, but till now I did not get the
> properties as I want them.
>
> It will result in something like:
> property=pelt,.fv,group,project
> property.name=dispatcher.theme,dispatcher.theme-ext,group-name,project-name
>
> However regarding
> http://ant.apache.org/manual/CoreTasks/xmlproperty.html if I enable
> semanticAttributes and use the above file slightly alternated:
> <properties>
> <!--
>     # codename: Dispatcher
>     # Dispatcher is using a fallback mechanism for theming.
>     # You can configure the theme name and its extension here
>     -->
>   <property id="dispatcher.theme" value="pelt"/>
>   <property id="dispatcher.theme-ext" value=".fv"/>
> ...
>
> I expected to find 
> dispatcher.theme=pelt
> but i now only get:
> property=pelt,.fv,group,project
>
> My question is, is this a bug or have I overlooked something?
>
>
> salu2
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message