You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2004/01/20 17:55:06 UTC

DO NOT REPLY [Bug 26286] New: - XmlProperty: empty element semantic problems

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26286>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26286

XmlProperty: empty element semantic problems

           Summary: XmlProperty: empty element semantic problems
           Product: Ant
           Version: 1.5.4
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Optional Tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: jraymond@accelerantmobile.com


Problem #1: There is no way to set a property to empty using XmlProperty.
 
Example: Ant (1.5.4) believes 'a' has not been set, but in fact 'a' has been 
set to an empty value. 

test.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <a></a>

build.xml:
    <?xml version="1.0"?>
    <project default="default">

        <target name="-setup">
	    <xmlproperty file="test.xml"/>
        </target>

        <target name="-a-set" if="a" depends="-setup">
            <echo message="a is set to:'${a}'"/>
        </target>

        <target name="-a-not-set" unless="a" depends="-setup">
            <echo message="a is not set"/>
        </target>

        <target name="default" depends="-a-set,-a-not-set"/>
    </project>

Results:

    Buildfile: build.xml

    -setup:

    -a-set:

    -a-not-set:
         [echo] a is not set

    default:



Problem #2: A tag that has been set to empty, is not recognized within Ant. 
One implication resulting from this is that composite objects can not be 
properly modelled within the XmlProperty file. 

Example: In this example, 'a' is an element composed of a 'b' element.  
While 'a' is clearly declared by the user, Ant says it has not been set. 

test.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <a><b attr="attr"/></a>

build.xml:
    (same as above)

result:
    (same as above)

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