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
 

Attachment: XmlPeekTask.cs.patch
Description: Binary data

Reply via email to