That was meant to say "This zip file has the updated source and NAnt.Core.dll"  :/

John

On 07/02/06, John Ludlow < [EMAIL PROTECTED]> wrote:
This zip file has the


On 07/02/06, John Ludlow < [EMAIL PROTECTED]> wrote:
The updated task (using the code from Dries) is at home :(  I'll email it tonight (I meant to copy it to my MP3 player or my GMail drive, but forgot. Sorry)

Wouldn't the NamespaceManager on Project be a different instance to the one on the Task, therefore have a different set of namespaces?

John


On 07/02/06, Martin Aliger < [EMAIL PROTECTED]> wrote:
Namespacemanager on Element should be there for namespace handling of nant build file itself. I do not test this funcionality, but we're solving this issue some time ago.
 
I'm looking forward to get a look into your changed tasks. Is it on nightlies already or have you a patch somewhere?
 
Thanks,
Martin
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of John Ludlow
Sent: Tuesday, February 07, 2006 12:21 AM
To: Dries Verbeke; nant-developers@lists.sourceforge.net
Subject: Re: [nant-dev] New XML tasks and functions

Ok, I've integrated your changes into my copy, Dries.  I can forward you the binaries if you want to test it, but I'm not sure what kind of a difference this will make.  As far as I know, the updated XmlPoke I did should support namespaces.  Probably the XmlPoke2 task doesn't, but that was probably why Ian asked if I could merge my task with the existing one.

There is the Xml-Foreach task which this might come in handy for, but I haven't submitted that.  The functions still don't support namespaces because they're not element-aware, and I think the original question was could they support namespaces.  I think it might be an idea if the functions could find out where they were called from, and get the namespacemanager that way. 

(BTW, there is a namespacemanager in the Element class, so it's possible that we could just get that rather than needing a base class for XmlTask.  Having said that, there's a case for having an XmlTask base anyway as there's some common functionality there.)

I get the feeling I'm missing something fairly obvious.  Anyway, I'm off to bed since I'm tired and I have an interview tomorrow. :)  See ya later.

John

On 06/02/06, John Ludlow <[EMAIL PROTECTED]> wrote:
I'm pretty new to it myself ;)  I'll take a look at the changes and see if I can get it built and tested, and I'll let you know what happens.

Cheers

John


On 06/02/06, Dries Verbeke <[EMAIL PROTECTED]> wrote:
Hi John,
i re-read the original thread and concluded that what they wanted was just the same behaviour as the xmlpeek and xmlpoke task so I refactored the functionality out of those task and put it in an abstract base class 'XmlTask'.  Nowyour new tasks can easily inherit from this task and have the same functionality (read multiple namespaces).

In the attachments a cvs patch file.  Keep in mind that I'm new to this opensource thing and didn't add a lot of comments to the changes.  I also placed the abstract class in the same namespace as the other default task. 

So check it out and let me know what you think of it


Dries

John Ludlow < [EMAIL PROTECTED]> wrote:
Hi,

Unless I'm missing something, it's a slightly larger job than that.  I've added a property into my copy of the NAnt source, but I can't see how to make the _expression_ evaluator care about that property.  It doesn't reference Task at all, so I don't think it could (in its current implementation) know that a namespace has been specified on the task and it should apply that namespace.

I'll see if I can get it to work out the task instance that has been run and from there whether or not to apply a namespace.  If anyone has any ideas, please email me.

Cheers

John

On 03/02/06, John Ludlow <[EMAIL PROTECTED]> wrote:
Ok, wasn't sure if that's what you meant.  I'm working on something else at the moment but I'll take a look when I get the chance.


On 03/02/06, Dries Verbeke < [EMAIL PROTECTED]> wrote:
That 's correct it needs to be added to the Abstract Task class so we can add it as a default property and (but this needs to be checked out) I think it doesn't matter where you put the namespace references the NamespaceManager will contain all namespace declarations of an xml document it's associated to.

In the microsoft doc's there is something mentioned as scope management.  It could be that only the  task tag or any parent tags are useable ...

At the moment I don't have a compilable version of the Nant source as soon as can I'll check this or if you have some time ...

the only thing we need to agree is the name of the Property ... it may not conflict with existing properties in any subclass ...

so let me know what you can find out
Dries

John Ludlow <[EMAIL PROTECTED]> wrote:
Hmmm...  It would have to be implemented on more than just the echo task - I just included that as an example, but I think that useage  wouldn't be as useful as, say, the <property> task.  You could do something like that for the <property> task, I guess, but there's other situations where properties are useful.  If you wanted to take the values of an XML document and post them to a database, for example, ou could use the XML functions within the nantcontrib <sql> tasks.  Similarly, to append to a document or merge the contents of a document into another, you can (with my patch to the xmlpoke task, or with my xmlpoke2 task) do something like this:

<xmlpoke file="xmlfile.xml" xpath"//data">
   <![CDATA[
      ${xml::get-xml(other.xml, '//data[test = 'true']')}
      <myothertag value="123"/>
   ]]>
</xmlpoke>

I'm not sure where you'd put the xmlns:x definition in this case.  I suppose you could put them as attributes of the <xmlpoke> task:

<xmlpoke file=" xmlfile.xml" xpath"//x2:data" xmlns:x=" http://www.gordic.cz/shared/project-config/v_1.0.0.0" xmlns:x2=" http://www.gordic.cz/shared/project-config/v_2.0.0.0 ">
   <![CDATA[
      ${xml::get-xml(other.xml, '//x:data[test = 'true']')}
      <myothertag value="123"/>
   ]]>
</xmlpoke>

Would this work?  If so, I'd suggest these modifications to the base Task class, so that this can be used in any task.

John

On 03/02/06, Dries Verbeke < [EMAIL PROTECTED]> wrote:
Hi,
maybe a stuppid idee but why cant we have some kind of mechanisme to add the NamespaceManager of our nant build xml file to the task so you can add multiple Namespace in an xml fashioned way ...

<echo message="${xml::get-value-using-ns(' test.xml', '/x:configuration/x:appSettings/x:[EMAIL PROTECTED] = ''server'']/@value')}"
xmlns:x=" http://www.gordic.cz/shared/project-config/v_1.0.0.0 "
xmlns:x2=" http://www.gordic.cz/shared/project-config/v_2.0.0.0"/>

To do this we only need to add an extra property to the abstract Task class and fill it with the NamespaceManager available at that moment ... and from their on every task can use this extra property.

just brain storming ...
Dries



Get the latest photos from your camera to your friends & family fast and easy with PhotoMail from Yahoo! Mail.




Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars.








Reply via email to