Looking at your DTD the default values you're getting are the default enumerated values as specified in the DTD. e.g. in the DTD there's

<!ATTLIST bean singleton (true | false) "true">


and hence you're getting a default value "true" for "singleton". See http://www.w3schools.com/dtd/dtd_attributes.asp for a discussion on DTD attribute values.

I suspect that xmltask is adding these default values on reading the XML document - since the DTD is specified in the XML input document. Some thoughts:

a) I assume that your output document is supposed to conform to the same DTD. If this is the case then your defaulted values will not cause a problem (if this is the case then you should probably set the public/system attributes in <xmltask> to set the output DTD).

b) you can remove these defaulted values using the <attr> subtask. e.g.

<attr path="....." attr="singleton" remove="true">

In brief, I wouldn't worry about the behaviour you're seeing. The XML generated conforms to the DTD, albeit in a somewhat more 'explicit' fashion.

Brian

I Wayan Saryada wrote:
Dear All,

I am starting to use XmlTask to update some of my
configuration files, but I
found that XmlTask is adding attribute to my
configuration with a default
value defined in the DTD. Here is the input and the
result:

Input:
-----------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd";>

<beans>
    <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="mappingResources">
            <list>
            </list>
        </property>
    </bean>
</beans>

Output:
-----------------------------------------

<?xml version="1.0" encoding="UTF-8"?>

<beans default-autowire="no"
default-dependency-check="none"
default-lazy-init="false">
    <bean abstract="false" autowire="default"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"
dependency-check="default" id="sessionFactory"
lazy-init="default"
singleton="true">
        <property name="dataSource"
ref="dataSource"></property>
        <property name="mappingResources">
            <list>
            </list>
        </property>
    </bean>
</beans>



What I don't understand is why xmltask adding the
attribute like:

abstract="false" autowire="default" lazy-init="default" singleton="true"

Which doesn't exist in the xml source file, so how do
I turn-off this
feature in the XmlTask?

--
I Wayan Saryada
http://www.saryada.com
y!msgr : saryada


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Xmltask-users mailing list
Xmltask-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xmltask-users

--
Brian Agnew                  http://www.oopsconsultancy.com
OOPS Consultancy Ltd         brian @ oopsconsultancy.com
Tel: +44 (0)7720 397526
Fax: +44 (0)20 8682 0012




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Xmltask-users mailing list
Xmltask-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xmltask-users

Reply via email to