Ty again, i must change the DTD since customer gets it. i dont have any decistion if to cahnge it or not, its more then simple validation,
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, April 28, 2005 1:30 PM To: user@ant.apache.org Subject: AW: Looking for task to add text to file. I think you have misunderstood me (or vice versa :-) With a DTD like book : (chapter | comment)+ you could have a comment, but you dont have to. So you could add your "node" to the DTD and the XML would be valid - with or without the <node>. So no change of the DTD would be needed any more. Jan > -----Ursprüngliche Nachricht----- > Von: Nir Geier [mailto:[EMAIL PROTECTED] > Gesendet am: Donnerstag, 28. April 2005 14:24 > An: Ant Users List > Betreff: RE: Looking for task to add text to file. > > Hi again. > i MUST change the DTD. > The xml nodes are list values defined in the DTD, even that i > disslike it this way i must support > it since the product is build this way. > i do use <xmlvalidate> to validate the output i generated but > again all teh manipulation is done using 'replace' task > and appending teh text to the head of the list instead of > doing it in the end. > > Nir. > > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 28, 2005 12:36 PM > To: user@ant.apache.org > Subject: AW: Looking for task to add text to file. > > > For manipulating the xml file I would try the xmltasks [1,2]. > For the DTD - why you have to change the DTD? You can change the DTD > so that it allows the have your <node> (but it dont have to be there). > > > Jan > > [1] http://ant.apache.org/external.html#xmltask > [2] http://www.oopsconsultancy.com/software/xmltask.html > > > -----Ursprüngliche Nachricht----- > > Von: Nir Geier [mailto:[EMAIL PROTECTED] > > Gesendet am: Donnerstag, 28. April 2005 13:10 > > An: Ant Users List > > Betreff: RE: Looking for task to add text to file. > > > > My task is the following: > > > > I have XML file and the corresponding DTD. > > I need to add text <node> to the XMl and to the DTD. > > Since the <node> needs to be added to specific location in the XML, > > The DTD needs to updated accordingly. > > as you all know I don't have too much flexibility in the DTD, > > it must be added to list options - so its needs to be the > > specific list and to the end > > > > At first I used replace to place it at the start of the list > > using simple REPLACE (while "replacing" the head of the list > > with the additional value.) > > The replace/replaceregexp are good but i will need to > > "re-write" the text to the file after modification to the list. > > This means that i have to read the context and change it > > inside the build file (or task class). > > > > > > Ty all for your fast help. > > > > -----Original Message----- > > From: Nir Geier [mailto:[EMAIL PROTECTED] > > Sent: Thursday, April 28, 2005 12:52 PM > > To: Ant Users List > > Subject: RE: Looking for task to add text to file. > > > > > > Thanks alot. > > i will try it all now. > > > > Ty > > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > Sent: Thursday, April 28, 2005 11:49 AM > > To: user@ant.apache.org > > Subject: AW: Looking for task to add text to file. > > > > > > Some possibilities which come into my mind: > > 1) using <replaceregexp> > > 2) using <tail> and <head> filters while <move>ing > > - extract part before > > - extract part after > > using <concat> to combine before, new and after parts > > 3) using your own task, start with > > http://marc.theaimsgroup.com/?l=ant-user&m=110691291123439&w=2 > > 4) the original file is a "template" and you could use a > <filterchain> > > with <expandproperties/> while <move>ing and having a > ${propname} > > inside your "template". > > > > Not any particular order ... > > > > > > Jan > > > > > > > -----Ursprüngliche Nachricht----- > > > Von: Nir Geier [mailto:[EMAIL PROTECTED] > > > Gesendet am: Donnerstag, 28. April 2005 12:42 > > > An: Ant Users List > > > Betreff: RE: Looking for task to add text to file. > > > > > > Ty > > > > > > i need to add it to certain location insid ethe file. > > > not to write log messages. > > > > > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > > > Sent: Thursday, April 28, 2005 11:39 AM > > > To: user@ant.apache.org > > > Subject: AW: Looking for task to add text to file. > > > > > > > > > <echo append="true"> message </echo> > > > > > > > > > Jan > > > > > > > > > > -----Ursprüngliche Nachricht----- > > > > Von: Nir Geier [mailto:[EMAIL PROTECTED] > > > > Gesendet am: Donnerstag, 28. April 2005 12:16 > > > > An: Ant Users List > > > > Betreff: RE: Looking for task to add text to file. > > > > > > > > > > > > Ty Gilbert. > > > > I will look into it in details. > > > > > > > > > > > > > > > > -----Original Message----- > > > > From: Rebhan, Gilbert [mailto:[EMAIL PROTECTED] > > > > Sent: Thursday, April 28, 2005 10:34 AM > > > > To: Ant Users List > > > > Subject: RE: Looking for task to add text to file. > > > > > > > > > > > > > > > > Hi, > > > > > > > > i've had a similar problem > > > > > > > > see = > > > > > > > > http://marc.theaimsgroup.com/?l=ant-user&m=110691291123439&w=2 > > > > > > > > for a solution, if you don't want to use concat/replace ... > > > > > > > > Since i needed to put in a property i changed the example of Jan > > > > to take a property. > > > > > > > > Gilbert > > > > > > > > -----Original Message----- > > > > From: Nir Geier [mailto:[EMAIL PROTECTED] > > > > Sent: Thursday, April 28, 2005 11:18 AM > > > > To: Ant Users List > > > > Subject: Looking for task to add text to file. > > > > > > > > Hi all, > > > > > > > > Im trying to append text to file and I could't find any > > > suitable task > > > > for doing so. > > > > As a workaround im using the 'Replace' task. > > > > (http://ant.apache.org/manual/CoreTasks/replace.html) > > > > > > > > Another option is the 'Concat' ( > > > > http://ant.apache.org/manual/CoreTasks/concat.html ) but it > > > is limited > > > > to the start/end > > > > of file while i need to place the text in a certain place > > > in the file. > > > > > > > > As far as i know there isnt any made task to this problem. > > > > I wonder maybe someone have any other solution. > > > > > > > > in the worst case i will write my own task but I'm > short on time. > > > > > > > > TY all inadvance. > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]