Christoph Jahn | 14 Apr 2013 12:22
Picon
Picon
Gravatar

Getting source from property and not file

Hi,

I have written a minor extension that allows me to retrieve the input to act upon from a property and not a file. How does this project, assuming there is interest, handle such "contributions"?

Bets regards,
Christoph

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Xmltask-users mailing list
Xmltask-users@...
https://lists.sourceforge.net/lists/listinfo/xmltask-users
Cool The Breezer | 10 Mar 2013 14:27
Picon
Favicon

Breaking news

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Xmltask-users mailing list
Xmltask-users@...
https://lists.sourceforge.net/lists/listinfo/xmltask-users
Shiran Shem-Tov | 8 Nov 2012 10:27

Help replacing text in XML file

I have an XML file:

 

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

<Settings>

   <Sdl>

        <sdlserver_ip>SERVER</sdlserver_ip>

        <sdlserver_port>1111</sdlserver_port>

        <version>1.0</version>

        <service_packs>sp1=2</service_packs>

        <updates></updates>

        <write2log>true</write2log>

   </Sdl>

</Settings>

 

I want to change the string inside the node <service_packs>, and I don’t know what is the current string there.

 

For example:

<service_packs>sp1=2</service_packs>

Will be change to

 <service_packs>sp2=1</service_packs>

 

I tried using:

 

<xmltask source="/Users/Shared/sdl.xml" dest="/Users/Shared/sdl1.xml">

 <replace path="/Settings/Sdl/service_packs/text()" withXml="sp2=1"/>

</xmltask>

 

And the output is:

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

<Settings>

   <Sdl>

        <sdlserver_ip>SERVER</sdlserver_ip>

        <sdlserver_port>1111</sdlserver_port>

        <version>1.0</version>

        <service_packs>sp2=1</service_packs>

        <updates/>

        <write2log>true</write2log>

   </Sdl>

</Settings>

 

Why it changes the red line in the file?

 

Thanks,

Shiran

 

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
Xmltask-users mailing list
Xmltask-users@...
https://lists.sourceforge.net/lists/listinfo/xmltask-users
Farzad Valad | 5 Oct 2012 07:13

Fwd: More Error Details


When I run XMLTask against a directory, it is detecting an erroneous
file.  However it is very difficult to figure out which file.  I did
turn report on (report="true") but the output detail level remains the
same.  I'm trying to figure out which file and/or which line is causing the issue.

Searched the archive and could not find any useful prior mail.
Appreciate your help.  Here is the output I'm getting when I run the
following block:

         <xmltask todir="${dir.processed.xml}" outputter="simple:4"
report="true">
             <fileset dir="${dir.raw.xml}">
                 <include name="**/*.xml"/>
             </fileset>
         </xmltask>

[xmltask] [Fatal Error] :63:52: Element type "parm" must be followed by
either attribute specifications, ">" or "/>". [xmltask]
org.xml.sax.SAXParseException: Element type "parm" must be followed by
either attribute specifications, ">" or "/>". [xmltask] at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:246)
[xmltask] at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
[xmltask] at
com.oopsconsultancy.xmltask.ant.XmlTask.documentFromStream(XmlTask.java:343)
[xmltask] at
com.oopsconsultancy.xmltask.ant.XmlTask.documentFromFile(XmlTask.java:387)
[xmltask] at
com.oopsconsultancy.xmltask.ant.XmlTask.access$000(XmlTask.java:27)
[xmltask] at
com.oopsconsultancy.xmltask.ant.XmlTask$InputFile.getDocument(XmlTask.java:203)
[xmltask] at
com.oopsconsultancy.xmltask.ant.XmlTask.execute(XmlTask.java:638)
[xmltask] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[xmltask] at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
[xmltask] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[xmltask] at java.lang.reflect.Method.invoke(Method.java:597) [xmltask]
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[xmltask] at org.apache.tools.ant.Task.perform(Task.java:348) [xmltask]
at org.apache.tools.ant.Target.execute(Target.java:392) [xmltask] at
org.apache.tools.ant.Target.performTasks(Target.java:413) [xmltask] at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[xmltask] at
org.apache.tools.ant.Project.executeTarget(Project.java:1368) [xmltask]
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[xmltask] at
org.apache.tools.ant.Project.executeTargets(Project.java:1251) [xmltask]
at org.apache.tools.ant.Main.runBuild(Main.java:811) [xmltask] at
org.apache.tools.ant.Main.startAnt(Main.java:217) [xmltask] at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) [xmltask] at
org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
Horacio Hoyos Rodriguez | 18 Sep 2012 14:13
Picon
Favicon

Xmltask replaces > in strings

Hello,

 

I have the following Xmltask:

 

<xmltask

       source="${ivy.repo}/${module.module}/${module.revision}/ivy-${module.revision}.xml"

       dest="${ivy.repo}/${module.module}/${module.revision}/ivy-${module.revision}.xml">

       <insert path="/ivy-module/dependencies/dependency"

              position="under">

                    <![CDATA[

                           <dependency org="" name="]]>${dependency.module}"<![CDATA[rev="]]>${dependency.revision}<![CDATA[" conf="compile->default"/>

                    ]]>

</insert>

</xmltask>

 

In the CDATA inserted I need the conf=”compile->default” as it is (Ivy repository file), however after running the task, the insert is done correctly, but the > character is replaced (the result):

 

<dependency conf="compile-&gt;default" name="org.eclipse.emf.ecore" org="" rev="2.8.0"/>

 

I guess by default you scape < and > to enforce well formatted xml’s, but I think they should not be replaced if inside a string.

 

Is there any workaround or fix? Do I have to provide my own outputter ??!!??

 

Regards,

 

Horacio Hoyos Rodríguez

EngD Student

University of York

 

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Xmltask-users mailing list
Xmltask-users@...
https://lists.sourceforge.net/lists/listinfo/xmltask-users
Dan Kilburn | 19 Jul 2012 21:04
Picon
Favicon

problem with using uncomment

Hi, I am having an issue where I want to make use of the xmltask uncomment feature.

I have something of the following:


<code>

web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="someId" blah blah blah>

<!-- Uncomment this filter when deploying to an SSO environment 
<filter>
<filter-name>authFilter</filter-name>
<filter-class>blah</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
-->
</web-app>

build.xml:


<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask" />
<target name="alterWebXml">
<xmltask source="WebContent/WEB-INF/web.xml" dest="D:/deployment/web.xml" report="true">
<uncomment path="/web-app/comment()[4]" />
</xmltask>
</target>

</code>


I am able to successfully generate the new web.xml file in the given directory. It reads the old one in, and writes the new one to the given dest directory.
The problem is, it's not removing the comments where I said to remove them at. I know it has something to do with the path of the uncomment itself. I 
get no error, it simply never removes the comment. It is coming off of the root 'web-app' element inside of the web.xml file but according to the documentation, 
I should be able to identify which comment in the document that I want to remove by comment()[index].

Any and all help that anyone could suggest as to what I am doing wrong would greatly be appreciated...

Thank you, dan 










------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Xmltask-users mailing list
Xmltask-users@...
https://lists.sourceforge.net/lists/listinfo/xmltask-users
Ronald Perich | 29 Jun 2012 20:55
Picon
Favicon

(no subject)

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Xmltask-users mailing list
Xmltask-users@...
https://lists.sourceforge.net/lists/listinfo/xmltask-users
Ronald Perich | 29 Jun 2012 12:19
Picon
Favicon

(no subject)

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Xmltask-users mailing list
Xmltask-users@...
https://lists.sourceforge.net/lists/listinfo/xmltask-users
Troy Harris | 17 May 2012 16:35
Picon
Favicon

Use of internal XPath API

We recently ran into the problem described below while trying to run <xmltask> on AIX.
 
 
Rather than importing the org.apache API mentioned at the link above it seems the better plan of action would be to remove the dependency on internal API and re-write the code to use Public API:
 
 
Is there a specific reason that the internal classes had to be used that would prevent such a re-write?
Thanks,
Troy Harris
 
 
 
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Xmltask-users mailing list
Xmltask-users@...
https://lists.sourceforge.net/lists/listinfo/xmltask-users
Maarten Coene | 19 Jan 2012 21:47
Picon
Favicon

warning when appending properties

Hi,

I want to select all attribute values of some element. To do this, I do the following (the property 'actions' doesn't exist yet):

<xmltask source=" <at> {file}">
    <copy path="/actions/action/ <at> name" property="actions" append="true" propertySeparator="," />
</xmltask>

It works, but it produces also a lots warning messages:

[xmltask] Cannot append values to properties
[xmltask] Cannot append values to properties
[xmltask] Cannot append values to properties
...

Is there a way to suppress these warnings?

regards,
Maarten

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Xmltask-users mailing list
Xmltask-users@...
https://lists.sourceforge.net/lists/listinfo/xmltask-users
Markus Kilås | 27 Dec 2011 16:32
Favicon
Gravatar

xmltask package

Thanks for the great xmltask library!

If you are interested I have created an ubuntu/debian package for it.
Source and binary packages are available here:
https://launchpad.net/~markuskilas/+archive/ppa/+packages

Best regards,
Markus

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev

Gmane