From: msacks <nt...@gm...> - 2010-11-19 20:59:21
|
Hello, I am having trouble doing some really basic things using xmlstar. I am executing this command /usr/bin/xmlstarlet sel -t -c "category/structure/property[@name='productNumber']" -v "@value" ~user/Downloads/hp.USE808N6DS.xml against this xml file https://docs.google.com/leaf?id=0B6C4Iz1C9X9HMzVjNjRiMTYtZWM3YS00ODljLTgyM2EtMDNjYzIzZjVhYTE2&sort=name&layout=list&num=50 Can someone clue me in as to what I am doing wrong? |
From: Noam P. <npo...@us...> - 2010-11-19 22:17:00
|
On Fri, Nov 19, 2010 at 3:59 PM, msacks <nt...@gm...> wrote: > Hello, > I am having trouble doing some really basic things using xmlstar. > I am executing this command /usr/bin/xmlstarlet sel -t -c > "category/structure/property[@name='productNumber']" -v "@value" > ~user/Downloads/hp.USE808N6DS.xml > > against this xml file > https://docs.google.com/leaf?id=0B6C4Iz1C9X9HMzVjNjRiMTYtZWM3YS00ODljLTgyM2EtMDNjYzIzZjVhYTE2&sort=name&layout=list&num=50 > > Can someone clue me in as to what I am doing wrong? You didn't explain exactly what your intention is, but I suppose you meant @value to refer to the property element that you matched in the previous argument. Unless you use -m (or --match) arguments are relative to the root, I would guess you want this: /usr/bin/xmlstarlet sel -t -m \ "category/structure/property[@name='productNumber']" \ -c . -v "@value" ~user/Downloads/hp.USE808N6DS.xml Noam PS I was unable do download your xml file, I got: Sorry, the page (or document) you have requested is not available. |
From: André K. <ak...@la...> - 2010-11-20 00:17:41
|
> On Fri, Nov 19, 2010 at 3:59 PM, msacks <nt...@gm...> wrote: >> Hello, >> I am having trouble doing some really basic things using xmlstar. >> I am executing this command /usr/bin/xmlstarlet sel -t -c >> "category/structure/property[@name='productNumber']" -v "@value" >> ~user/Downloads/hp.USE808N6DS.xml >> >> against this xml file >> https://docs.google.com/leaf?id=0B6C4Iz1C9X9HMzVjNjRiMTYtZWM3YS00ODljLTgyM2EtMDNjYzIzZjVhYTE2&sort=name&layout=list&num=50 >> >> Can someone clue me in as to what I am doing wrong? > > You didn't explain exactly what your intention is, but I suppose you > meant @value to refer to the property element that you matched in the > previous argument. Unless you use -m (or --match) arguments are > relative to the root, I would guess you want this: > > /usr/bin/xmlstarlet sel -t -m \ > "category/structure/property[@name='productNumber']" \ > -c . -v "@value" ~user/Downloads/hp.USE808N6DS.xml > Hi msacks, Well the two things to check since I also haven't been able to download the xml file: - I guess xmlstarlet sel -t -m "/category/..." or xmlstarlet sel -t -m "//category/..." (note the staring slash(es)) would match something - Is there a namespace, in which case you'd have to use the -N option and update the XPath accordingly? Regards, André |
From: msacks <nt...@gm...> - 2010-11-20 02:12:56
|
Try this link https://docs.google.com/leaf?id=0B6C4Iz1C9X9HMzVjNjRiMTYtZWM3YS00ODljLTgyM2EtMDNjYzIzZjVhYTE2&hl=en&authkey=CNfli4oJ On Fri, Nov 19, 2010 at 4:17 PM, André Kaplan <ak...@la...> wrote: >> On Fri, Nov 19, 2010 at 3:59 PM, msacks <nt...@gm...> wrote: >>> Hello, >>> I am having trouble doing some really basic things using xmlstar. >>> I am executing this command /usr/bin/xmlstarlet sel -t -c >>> "category/structure/property[@name='productNumber']" -v "@value" >>> ~user/Downloads/hp.USE808N6DS.xml >>> >>> against this xml file >>> https://docs.google.com/leaf?id=0B6C4Iz1C9X9HMzVjNjRiMTYtZWM3YS00ODljLTgyM2EtMDNjYzIzZjVhYTE2&sort=name&layout=list&num=50 >>> >>> Can someone clue me in as to what I am doing wrong? >> >> You didn't explain exactly what your intention is, but I suppose you >> meant @value to refer to the property element that you matched in the >> previous argument. Unless you use -m (or --match) arguments are >> relative to the root, I would guess you want this: >> >> /usr/bin/xmlstarlet sel -t -m \ >> "category/structure/property[@name='productNumber']" \ >> -c . -v "@value" ~user/Downloads/hp.USE808N6DS.xml >> > > Hi msacks, > > Well the two things to check since I also haven't been able to > download the xml file: > - I guess xmlstarlet sel -t -m "/category/..." or xmlstarlet sel -t -m > "//category/..." (note the staring slash(es)) would match something > - Is there a namespace, in which case you'd have to use the -N option > and update the XPath accordingly? > > Regards, > André > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today > http://p.sf.net/sfu/msIE9-sfdev2dev > _______________________________________________ > xmlstar-devel mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlstar-devel > |
From: msacks <nt...@gm...> - 2010-11-20 23:42:14
|
I did try the various combinations you recommended. i.e. xmlstarlet sel -t -c "//category/.... "/category "category So there must be something else I'm missing here. On Fri, Nov 19, 2010 at 4:17 PM, André Kaplan <ak...@la...> wrote: >> On Fri, Nov 19, 2010 at 3:59 PM, msacks <nt...@gm...> wrote: >>> Hello, >>> I am having trouble doing some really basic things using xmlstar. >>> I am executing this command /usr/bin/xmlstarlet sel -t -c >>> "category/structure/property[@name='productNumber']" -v "@value" >>> ~user/Downloads/hp.USE808N6DS.xml >>> >>> against this xml file >>> https://docs.google.com/leaf?id=0B6C4Iz1C9X9HMzVjNjRiMTYtZWM3YS00ODljLTgyM2EtMDNjYzIzZjVhYTE2&sort=name&layout=list&num=50 >>> >>> Can someone clue me in as to what I am doing wrong? >> >> You didn't explain exactly what your intention is, but I suppose you >> meant @value to refer to the property element that you matched in the >> previous argument. Unless you use -m (or --match) arguments are >> relative to the root, I would guess you want this: >> >> /usr/bin/xmlstarlet sel -t -m \ >> "category/structure/property[@name='productNumber']" \ >> -c . -v "@value" ~user/Downloads/hp.USE808N6DS.xml >> > > Hi msacks, > > Well the two things to check since I also haven't been able to > download the xml file: > - I guess xmlstarlet sel -t -m "/category/..." or xmlstarlet sel -t -m > "//category/..." (note the staring slash(es)) would match something > - Is there a namespace, in which case you'd have to use the -N option > and update the XPath accordingly? > > Regards, > André > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today > http://p.sf.net/sfu/msIE9-sfdev2dev > _______________________________________________ > xmlstar-devel mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlstar-devel > |
From: André K. <ak...@la...> - 2010-11-21 01:16:31
|
> Le 21 nov. 10 à 00:42, msacks a écrit : > > > I did try the various combinations you recommended. i.e. > > xmlstarlet sel -t -c "//category/.... > "/category > "category > > So there must be something else I'm missing here. > > > On Fri, Nov 19, 2010 at 4:17 PM, André Kaplan <ak...@la...> > wrote: >>> On Fri, Nov 19, 2010 at 3:59 PM, msacks <nt...@gm...> wrote: >>>> Hello, >>>> I am having trouble doing some really basic things using xmlstar. >>>> I am executing this command /usr/bin/xmlstarlet sel -t -c >>>> "category/structure/property[@name='productNumber']" -v "@value" >>>> ~user/Downloads/hp.USE808N6DS.xml >>>> Yes, there are no name attribute with 'productNumber' as value in your example. There are 'productName', there are 'serialNumber', so you have to make a choice! $ xmlstarlet sel \ --text \ -t \ -m "//category/structure/property[@name='productName']" \ -v '@value' -n \ -b \ -b \ hp.USE808N6DS.xml ProLiant DL580 G5 ProLiant DL580 G5 ProLiant DL580 G5 Regards, André |
From: msacks <nt...@gm...> - 2010-11-22 18:34:45
|
This does the trick. Thank you. On Sat, Nov 20, 2010 at 5:16 PM, André Kaplan <ak...@la...> wrote: > >> Le 21 nov. 10 à 00:42, msacks a écrit : >> >> >> I did try the various combinations you recommended. i.e. >> >> xmlstarlet sel -t -c "//category/.... >> "/category >> "category >> >> So there must be something else I'm missing here. >> >> >> On Fri, Nov 19, 2010 at 4:17 PM, André Kaplan <ak...@la...> >> wrote: >>>> On Fri, Nov 19, 2010 at 3:59 PM, msacks <nt...@gm...> wrote: >>>>> Hello, >>>>> I am having trouble doing some really basic things using xmlstar. >>>>> I am executing this command /usr/bin/xmlstarlet sel -t -c >>>>> "category/structure/property[@name='productNumber']" -v "@value" >>>>> ~user/Downloads/hp.USE808N6DS.xml >>>>> > > > Yes, there are no name attribute with 'productNumber' as value in your > example. > There are 'productName', there are 'serialNumber', so you have to make > a choice! > > $ xmlstarlet sel \ > --text \ > -t \ > -m "//category/structure/property[@name='productName']" \ > -v '@value' -n \ > -b \ > -b \ > hp.USE808N6DS.xml > ProLiant DL580 G5 > ProLiant DL580 G5 > ProLiant DL580 G5 > > Regards, > André > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today > http://p.sf.net/sfu/msIE9-sfdev2dev > _______________________________________________ > xmlstar-devel mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlstar-devel > |