If you sent the entire xml file it would be much easier to write the path. The reason you can't close the Product tag, is because I'm sure there is a </Product> later in the document (prolly several). I'm also guessing there are multiple <Product id='something'...> tags in there, which will cause you to have to use the "[EMAIL PROTECTED]'...']/@version" so that it can differentiate between the different Product tags in there.
--- "Kedziora, Rebecca" <[EMAIL PROTECTED]> wrote: > Still does not work. > > Also when you wanted me to chagne the XML file to > close the \> Product > it would say the file is now invalid. If I leave my > file alone it > doesn't complain about it being invalid. > > <target name="version" description="Get and Update > the version in > SMC.WXS file."> > <xmlpeek file="${pwd}\MSI1.wxs" > xpath="/x:Wix/x:Product/@x:Version" > property="xml.property"> > <namespaces> > <namespace prefix="x" uri=" > http://schemas.microsoft.com/wix/2003/01/wi" /> > </namespaces> > </xmlpeek> > <echo message="${xml.property}"/> > </target> > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Guy Metz > Sent: Thursday, October 20, 2005 3:57 PM > To: nant-users@lists.sourceforge.net > Subject: RE: [Nant-users] Xpath guru needed... > > > Because the Wix document has a namespace your Xpath > expression must also > reference the namespace. Remember that xpath matches > on fully qualified > names. Try the following (sorry in advance if I > screwed up the syntax) > <xmlpeek file="${pwd}\MSI1.wxs" > xpath="/x:Wix/x:Product/@x:Version" > property="xml.property"> > <namespaces> > <namespace prefix="x" url=" > http://schemas.microsoft.com/wix/2003/01/wi" /> > > </namespaces> > </xmlpeek> > > -----Original Message----- > > From: Kedziora, Rebecca > [mailto:[EMAIL PROTECTED] > > Sent: Thursday, October 20, 2005 4:44 PM > > To: nant-users@lists.sourceforge.net > > Subject: RE: [Nant-users] Xpath guru needed... > > > > This is what I am using in my build file to get > the Version but it > > doesn't work. > > > > > > <property name="xml.property" value="unknown" /> > > > > <target name="version" description="Get and Update > the version in > > SMC.WXS file."> > > <xmlpeek file="${pwd}\MSI1.wxs" > xpath="/Wix/Product/@Version" > > property="xml.property"> > > </xmlpeek> > > <echo message="${xml.property}"/> > > </target> > > > > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On > Behalf Of Kedziora, > > > Rebecca > > Sent: Thursday, October 20, 2005 3:36 PM > > To: nant-users@lists.sourceforge.net > > Subject: RE: [Nant-users] Xpath guru needed... > > > > > > I opened up this document in IDE and the XML > editor and it looks fine. > > > > Even with this document I get the same erros that > the node is not > valid. > > > > > > > > -----Original Message----- > > From: Martin Gainty [mailto:[EMAIL PROTECTED] > > Sent: Thursday, October 20, 2005 3:28 PM > > To: Eric Fetzer; Kedziora, Rebecca; > nant-users@lists.sourceforge.net > > Subject: Re: [Nant-users] Xpath guru needed... > > > > > > <?xml version="1.0"?> > > <Wix > xmlns="http://schemas.microsoft.com/wix/2003/01/wi"> > > <Product Id="431EB16A" Name="Management Center" > Language="1033" > > Version="3.0.0.100" Manufacturer="Corporation"/> > </Wix> > > > > Note the end tag /> at the end of the <Product Tag > > > > If you want a way to catch malformed XML errors > just open the xml > > document in your IDE > > OR Open your XML document with XML Parser such as > XMLSpy available at > > the > > Altova XMLSpy site > http://www.altova.com/download_spy_enterprise.html > > > > Hope this works for you, > > Martin - > > Etats Unis > > ----- Original Message ----- > > From: "Eric Fetzer" <[EMAIL PROTECTED]> > > To: "Kedziora, Rebecca" > <[EMAIL PROTECTED]>; > > <nant-users@lists.sourceforge.net> > > Sent: Thursday, October 20, 2005 4:03 PM > > Subject: Re: [Nant-users] Xpath guru needed... > > > > > > > /Wix/Product/[EMAIL PROTECTED]'431EB16A']/@Version > > > > > > > > > > > > --- "Kedziora, Rebecca" > > > <[EMAIL PROTECTED]> wrote: > > > > > >> Anyone, > > >> > > >> Trying to use the xmlpeek to retrieve the value > of > > >> an attribute. > > >> > > >> I am trying to get the Version: > > >> > > >> <?xml version="1.0"?> > > >> > > >> <Wix > > >> > xmlns="http://schemas.microsoft.com/wix/2003/01/wi"> > > >> > > >> <Product Id="431EB16A" Name="Management Center" > Language="1033" > > >> Version="3.0.0.100" Manufacturer="Corporation"> > > >> > > >> </Wix> > > >> > > >> I tried several ways to use xpath and it keeps > > >> tellings me "No matching > > >> nodes found for Xpath expression". > > >> > > >> Does anyone know how to get xpath to work here? > > >> > > >> Thanks, > > >> > > >> Rebecca > > >> > > >> > > >> > > >> > > > > > > > > > > > > > > > __________________________________ > > > Yahoo! Music Unlimited > > > Access over 1 million songs. Try it free. > > > http://music.yahoo.com/unlimited/ > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by: > > > Power Architecture Resource Center: Free > content, downloads, > > > discussions, and more. > http://solutions.newsforge.com/ibmarch.tmpl > > > _______________________________________________ > > > Nant-users mailing list > > > Nant-users@lists.sourceforge.net > > > > https://lists.sourceforge.net/lists/listinfo/nant-users > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: > > Power Architecture Resource Center: Free content, > downloads, > discussions, > === message truncated === __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ Nant-users mailing list Nant-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users