Thanks, I'll review (I might change the namespace element from array to collection) and commit it later ...
 
Gert
----- Original Message -----
Cc: ! nant
Sent: Monday, February 23, 2004 9:54 AM
Subject: Fw: [nant-dev] xmlpeek and namespaces

Here is patch to implement that.
 
Regards,
Martin
 
----- Original Message -----
To: ! nant
Sent: Wednesday, February 18, 2004 3:47 PM
Subject: [nant-dev] xmlpeek and namespaces

Hello all,
 
I find one problem with xmlpeek task:
 
<xmlpeek
      file="${prjconfig}"
      xpath="Project/ExeName"
      property="newexe"
      failonerror="false"/>
fails on XML like:
 
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="
http://www.gordic.cz/shared/project-config/v_1.0.0.0">
  <ExeName>foo</ExeName>
</Project>
 
The reason is namespace associated with XML file (see MSDN KB Q318545). To enable this we have to extend xmlpeek task to be namespace-aware. I suggest this syntax:
 
<xmlpeek
      file="${prjconfig}"
      xpath="x:Project/x:ExeName"
      property="newexe"
      failonerror="false">
 
      <namespace name="x" ns="http://www.gordic.cz/shared/project-config/v_1.0.0.0"/>
</xmlpeek>
There, of course, could be more then one namespace...
 
Regards,
Martin
 

Reply via email to