There's no existing option to do that - unless you disable the DTD via
<xmlcatalog> (note:- if you're not using a local copy of the DTD
it'll be loading it across the net). If you want to disable the DTD
then you can use something like: <xmlcatalog id="dtds"> <dtd publicId="-//OOPS Consultancy//DTD Test 1.0//EN" location=""/> </xmlcatalog> Note that xmltask doesn't validate using DTDs but simply uses them for entity resolution. So if your DTD is providing entities then you won't be able to do the above. Brian I Wayan Saryada wrote: Thanks Brian, I now understand that the XmlTask is following the specified DTD, and actually the xml file is work just fine.Another one, is it posible to tell XmlTask not to add the attribute with defaulted value instead of removing it? -- I Wayan Saryada http://www.saryada.com y!msgr : saryada-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On BehalfOf Brian Agnew Sent: Tuesday, April 18, 2006 4:53 PM To: I Wayan Saryada Cc: xmltask-users@lists.sourceforge.net Subject: Re: [Xmltask-users] Disabling a not needed attributes in xml file Looking at your DTD the default values you'regetting are thedefault enumerated values as specified in the DTD.e.g. inthe 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 foradiscussion on DTD attribute values. I suspect that xmltask is adding these defaultvalues onreading the XML document - since the DTD isspecified in theXML input document. Some thoughts: a) I assume that your output document is supposed toconformto the same DTD. If this is the case then yourdefaultedvalues will not cause a problem (if this is the casethen youshould 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 behaviouryou're seeing.The XML generated conforms to the DTD, albeit in asomewhatmore 'explicit' fashion. Brian I Wayan Saryada wrote:Dear All, I am starting to use XmlTask to update some of myconfiguration files,but I found that XmlTask is adding attribute to myconfiguration witha default value defined in the DTD. Here is theinput and theresult: Input: ----------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPEbeans 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 theattribute like:abstract="false" autowire="default" lazy-init="default" singleton="true" Which doesn't exist in the xml source file, so howdo Iturn-off thisfeature in the XmlTask? -- I Wayan Saryada http://www.saryada.com y!msgr : saryada __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spamprotection aroundhttp://mail.yahoo.com-------------------------------------------------------This SF.Net email is sponsored by xPML, agroundbreaking scriptinglanguage that extends applications into web andmobilemedia. Attendthe live webcast and join the prime developergroupbreaking 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.nethttps://lists.sourceforge.net/lists/listinfo/xmltask-users-- Brian Agnewhttp://www.oopsconsultancy.comOOPS Consultancy Ltd brian @oopsconsultancy.comTel: +44 (0)7720 397526 Fax: +44 (0)20 8682 0012-------------------------------------------------------This SF.Net email is sponsored by xPML, agroundbreakingscripting language that extends applications intoweb andmobile media. Attend the live webcast and join theprimedeveloper group breaking into this new codingterritory!http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Xmltask-users mailing list Xmltask-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/xmltask-users__________________________________________________ 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 |
- [Xmltask-users] Disabling a not needed attributes in xml f... I Wayan Saryada
- Re: [Xmltask-users] Disabling a not needed attributes... Brian Agnew
- RE: [Xmltask-users] Disabling a not needed attributes... I Wayan Saryada
- Re: [Xmltask-users] Disabling a not needed attrib... Brian Agnew