Looks like the problem is namespaces.  Even though the original XML doesn't
use prefixes, it does have a default namespace declaration so to use xpath
on it you need to declare namespaces and use a prefix in your xpath.  Docs
on xmlpeek talk about namespaces and have a namespaces example.

http://nant.sourceforge.net/release/latest/help/tasks/xmlpeek.html

HTH,

Sam


-------------------------------------------
We're Hiring! Seeking a passionate developer to join our team building Flex
based products. Position is in the Washington D.C. metro area. If interested
contact [EMAIL PROTECTED]
 
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of nick hemsley
Sent: Thursday, February 15, 2007 1:59 AM
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] Problem with xmlpeek & poke & WIX files(Capitalization
of xml tags?)

Hey all,

I have a WIX (http://wix.sf.net) file which looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi";>
        <Product Id="F43DE0AE-204E-48E0-9EDE-BAAB91348025" Name="NAME"
Language="1033" Version="VERSION" Manufacturer="MANUFACTURER">
                <Package Id="????????-????-????-????-????????????"
Description="DESCRIPTION" Comments="COMMENTS" InstallerVersion="200"
Compressed="yes" />
                <Media Id="1" Cabinet="WebModule" EmbedCab="yes" />

                <Directory Id="TARGETDIR" Name="SourceDir">
                        ...
                </Directory>
        </Product>
</Wix>

I am trying to xmlpoke the Name, Version & Manufatcurer etc. values
from my build script. the relevant section is:

<xmlpoke file="${build.dir}/PhoneControl.wxs"
value="${phonecontrol.name.human} ${phonecontrol.version}
${name.human}" xpath="//Wix/Product/@Name" />
                <xmlpoke file="${build.dir}/WixFile.wxs" value="${version}"
xpath="//Wix/Product/@Version" />
                <xmlpoke file="${build.dir}/WixFile.wxs" value="${company}"
xpath="//Wix/Product/@Manufacturer" />
                <xmlpoke file="${build.dir}/WixFile.wxs"
value="${description}"
xpath="//Wix/Product/Package/@Description" />
                <xmlpoke file="${build.dir}/WixFile.wxs" value="${comments}"
xpath="//Wix/Product/Package/@Comments" />

nant outputs with the following (but doesnt error):
[xmlpoke] No matching nodes were found with XPath expression
'//Wix/Product/@Name'.
etc.

I have tried
                <xmlpeek property="testpeek"
file="${build.dir}/PhoneControl.wxs"
xpath="//Wix" verbose="true" />
to debug & this doesnt work as well. (neither does lowercasing the
<wix> & xmlpeeking for //wix) can anyone point me on what is wrong
with this?

Cheers Nick


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to