Re: [NAnt-users] xmlpeek and multiple nodes
That's all I want to do, find a node and update it. From: Bob Archer [mailto:bob.arc...@amsi.com] Sent: Friday, April 20, 2012 9:36 AM To: Chris Fouts; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes For more than a simple find a node and update it I would recommend you write you own code using the script task. Or write your own task. BOb From: Chris Fouts [mailto:chris.fo...@caemilusa.com] Sent: Friday, April 20, 2012 9:02 AM To: nant-users@lists.sourceforge.net Subject: [NAnt-users] xmlpeek and multiple nodes How can I use xmlpeek/xmlpoke to recursively peruse all the similarly named nodes in a file, the the test node below. tests test.../test test.../test test.../test /tests This didn't help, http://nant.sourceforge.net/release/0.85/help/tasks/xmlpeek.html And I found this http://old.nabble.com/xmlpeek---Multiple-nodes-found-with-the-XPath-expression-td20017190.html Per that page, do I really have to do this, that is hard code the indices? So if I add a 16th node, I'll have to change the script to add a 16th index? foreach item=String in=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 delim=, property=index xmlpeek file=${somefile} nodeindex=${index} / /foreach So I found this http://www.mail-archive.com/nant-users@lists.sourceforge.net/msg11179.html But my nant version 0.91 complains about xmllist being an unknown task or data type. -chris ***This e-mail message is intended only for the above named recipient(s) and may contain information that is sensitive or proprietary. If you have received this message in error or are not the named recipient(s), please immediately notify the sender, delete this e-mail message without making a copy and do not disclose or relay this e-mail message to anyone.*** -- For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2___ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users
Re: [NAnt-users] xmlpeek and multiple nodes
But, is there something unique in the node that you want to update? I assume no since you are looping through them all? BOb From: Chris Fouts [mailto:chris.fo...@caemilusa.com] Sent: Friday, April 20, 2012 9:48 AM To: Bob Archer; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes That's all I want to do, find a node and update it. From: Bob Archer [mailto:bob.arc...@amsi.com] Sent: Friday, April 20, 2012 9:36 AM To: Chris Fouts; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes For more than a simple find a node and update it I would recommend you write you own code using the script task. Or write your own task. BOb From: Chris Fouts [mailto:chris.fo...@caemilusa.com] Sent: Friday, April 20, 2012 9:02 AM To: nant-users@lists.sourceforge.net Subject: [NAnt-users] xmlpeek and multiple nodes How can I use xmlpeek/xmlpoke to recursively peruse all the similarly named nodes in a file, the the test node below. tests test.../test test.../test test.../test /tests This didn't help, http://nant.sourceforge.net/release/0.85/help/tasks/xmlpeek.html And I found this http://old.nabble.com/xmlpeek---Multiple-nodes-found-with-the-XPath-expression-td20017190.html Per that page, do I really have to do this, that is hard code the indices? So if I add a 16th node, I'll have to change the script to add a 16th index? foreach item=String in=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 delim=, property=index xmlpeek file=${somefile} nodeindex=${index} / /foreach So I found this http://www.mail-archive.com/nant-users@lists.sourceforge.net/msg11179.html But my nant version 0.91 complains about xmllist being an unknown task or data type. -chris ***This e-mail message is intended only for the above named recipient(s) and may contain information that is sensitive or proprietary. If you have received this message in error or are not the named recipient(s), please immediately notify the sender, delete this e-mail message without making a copy and do not disclose or relay this e-mail message to anyone.*** -- For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2___ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users
Re: [NAnt-users] xmlpeek and multiple nodes
If I can find out how to loop through them all, I can do the rest. From: Bob Archer [mailto:bob.arc...@amsi.com] Sent: Friday, April 20, 2012 9:54 AM To: Chris Fouts; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes But, is there something unique in the node that you want to update? I assume no since you are looping through them all? BOb From: Chris Fouts [mailto:chris.fo...@caemilusa.com] Sent: Friday, April 20, 2012 9:48 AM To: Bob Archer; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes That's all I want to do, find a node and update it. From: Bob Archer [mailto:bob.arc...@amsi.com] Sent: Friday, April 20, 2012 9:36 AM To: Chris Fouts; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes For more than a simple find a node and update it I would recommend you write you own code using the script task. Or write your own task. BOb From: Chris Fouts [mailto:chris.fo...@caemilusa.com] Sent: Friday, April 20, 2012 9:02 AM To: nant-users@lists.sourceforge.net Subject: [NAnt-users] xmlpeek and multiple nodes How can I use xmlpeek/xmlpoke to recursively peruse all the similarly named nodes in a file, the the test node below. tests test.../test test.../test test.../test /tests This didn't help, http://nant.sourceforge.net/release/0.85/help/tasks/xmlpeek.html And I found this http://old.nabble.com/xmlpeek---Multiple-nodes-found-with-the-XPath-expression-td20017190.html Per that page, do I really have to do this, that is hard code the indices? So if I add a 16th node, I'll have to change the script to add a 16th index? foreach item=String in=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 delim=, property=index xmlpeek file=${somefile} nodeindex=${index} / /foreach So I found this http://www.mail-archive.com/nant-users@lists.sourceforge.net/msg11179.html But my nant version 0.91 complains about xmllist being an unknown task or data type. -chris ***This e-mail message is intended only for the above named recipient(s) and may contain information that is sensitive or proprietary. If you have received this message in error or are not the named recipient(s), please immediately notify the sender, delete this e-mail message without making a copy and do not disclose or relay this e-mail message to anyone.*** -- For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2___ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users
Re: [NAnt-users] xmlpeek and multiple nodes
In other words, if you can't get to a specific node with an XPath expression you really need to roll your own. That's really what it is designed for. You could do something like what you are doing, however, you probably still need your own script task to get the count of matching nodes. A quick google find this http://bgeek.net/2005/09/19/nant-xml-node-counting/ BOb From: Chris Fouts [mailto:chris.fo...@caemilusa.com] Sent: Friday, April 20, 2012 9:48 AM To: Bob Archer; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes That's all I want to do, find a node and update it. From: Bob Archer [mailto:bob.arc...@amsi.com] Sent: Friday, April 20, 2012 9:36 AM To: Chris Fouts; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes For more than a simple find a node and update it I would recommend you write you own code using the script task. Or write your own task. BOb From: Chris Fouts [mailto:chris.fo...@caemilusa.com] Sent: Friday, April 20, 2012 9:02 AM To: nant-users@lists.sourceforge.net Subject: [NAnt-users] xmlpeek and multiple nodes How can I use xmlpeek/xmlpoke to recursively peruse all the similarly named nodes in a file, the the test node below. tests test.../test test.../test test.../test /tests This didn't help, http://nant.sourceforge.net/release/0.85/help/tasks/xmlpeek.html And I found this http://old.nabble.com/xmlpeek---Multiple-nodes-found-with-the-XPath-expression-td20017190.html Per that page, do I really have to do this, that is hard code the indices? So if I add a 16th node, I'll have to change the script to add a 16th index? foreach item=String in=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 delim=, property=index xmlpeek file=${somefile} nodeindex=${index} / /foreach So I found this http://www.mail-archive.com/nant-users@lists.sourceforge.net/msg11179.html But my nant version 0.91 complains about xmllist being an unknown task or data type. -chris ***This e-mail message is intended only for the above named recipient(s) and may contain information that is sensitive or proprietary. If you have received this message in error or are not the named recipient(s), please immediately notify the sender, delete this e-mail message without making a copy and do not disclose or relay this e-mail message to anyone.*** -- For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2___ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users
Re: [NAnt-users] xmlpeek and multiple nodes
So no canned support for this? -chris From: Bob Archer [mailto:bob.arc...@amsi.com] Sent: Friday, April 20, 2012 9:59 AM To: Chris Fouts; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes In other words, if you can't get to a specific node with an XPath expression you really need to roll your own. That's really what it is designed for. You could do something like what you are doing, however, you probably still need your own script task to get the count of matching nodes. A quick google find this http://bgeek.net/2005/09/19/nant-xml-node-counting/ BOb From: Chris Fouts [mailto:chris.fo...@caemilusa.com] Sent: Friday, April 20, 2012 9:48 AM To: Bob Archer; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes That's all I want to do, find a node and update it. From: Bob Archer [mailto:bob.arc...@amsi.com] Sent: Friday, April 20, 2012 9:36 AM To: Chris Fouts; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes For more than a simple find a node and update it I would recommend you write you own code using the script task. Or write your own task. BOb From: Chris Fouts [mailto:chris.fo...@caemilusa.com] Sent: Friday, April 20, 2012 9:02 AM To: nant-users@lists.sourceforge.net Subject: [NAnt-users] xmlpeek and multiple nodes How can I use xmlpeek/xmlpoke to recursively peruse all the similarly named nodes in a file, the the test node below. tests test.../test test.../test test.../test /tests This didn't help, http://nant.sourceforge.net/release/0.85/help/tasks/xmlpeek.html And I found this http://old.nabble.com/xmlpeek---Multiple-nodes-found-with-the-XPath-expression-td20017190.html Per that page, do I really have to do this, that is hard code the indices? So if I add a 16th node, I'll have to change the script to add a 16th index? foreach item=String in=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 delim=, property=index xmlpeek file=${somefile} nodeindex=${index} / /foreach So I found this http://www.mail-archive.com/nant-users@lists.sourceforge.net/msg11179.html But my nant version 0.91 complains about xmllist being an unknown task or data type. -chris ***This e-mail message is intended only for the above named recipient(s) and may contain information that is sensitive or proprietary. If you have received this message in error or are not the named recipient(s), please immediately notify the sender, delete this e-mail message without making a copy and do not disclose or relay this e-mail message to anyone.*** -- For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2___ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users
Re: [NAnt-users] xmlpeek and multiple nodes
For more than a simple find a node and update it I would recommend you write you own code using the script task. Or write your own task. BOb From: Chris Fouts [mailto:chris.fo...@caemilusa.com] Sent: Friday, April 20, 2012 9:02 AM To: nant-users@lists.sourceforge.net Subject: [NAnt-users] xmlpeek and multiple nodes How can I use xmlpeek/xmlpoke to recursively peruse all the similarly named nodes in a file, the the test node below. tests test.../test test.../test test.../test /tests This didn't help, http://nant.sourceforge.net/release/0.85/help/tasks/xmlpeek.html And I found this http://old.nabble.com/xmlpeek---Multiple-nodes-found-with-the-XPath-expression-td20017190.html Per that page, do I really have to do this, that is hard code the indices? So if I add a 16th node, I'll have to change the script to add a 16th index? foreach item=String in=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 delim=, property=index xmlpeek file=${somefile} nodeindex=${index} / /foreach So I found this http://www.mail-archive.com/nant-users@lists.sourceforge.net/msg11179.html But my nant version 0.91 complains about xmllist being an unknown task or data type. -chris ***This e-mail message is intended only for the above named recipient(s) and may contain information that is sensitive or proprietary. If you have received this message in error or are not the named recipient(s), please immediately notify the sender, delete this e-mail message without making a copy and do not disclose or relay this e-mail message to anyone.*** -- For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2___ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users
Re: [NAnt-users] xmlpeek and multiple nodes
Not really, no. From: Chris Fouts [mailto:chris.fo...@caemilusa.com] Sent: Friday, April 20, 2012 10:03 AM To: nant-users@lists.sourceforge.net Subject: Re: [NAnt-users] xmlpeek and multiple nodes So no canned support for this? -chris From: Bob Archer [mailto:bob.arc...@amsi.com] Sent: Friday, April 20, 2012 9:59 AM To: Chris Fouts; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes In other words, if you can't get to a specific node with an XPath expression you really need to roll your own. That's really what it is designed for. You could do something like what you are doing, however, you probably still need your own script task to get the count of matching nodes. A quick google find this http://bgeek.net/2005/09/19/nant-xml-node-counting/ BOb From: Chris Fouts [mailto:chris.fo...@caemilusa.com] Sent: Friday, April 20, 2012 9:48 AM To: Bob Archer; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes That's all I want to do, find a node and update it. From: Bob Archer [mailto:bob.arc...@amsi.com] Sent: Friday, April 20, 2012 9:36 AM To: Chris Fouts; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes For more than a simple find a node and update it I would recommend you write you own code using the script task. Or write your own task. BOb From: Chris Fouts [mailto:chris.fo...@caemilusa.com] Sent: Friday, April 20, 2012 9:02 AM To: nant-users@lists.sourceforge.net Subject: [NAnt-users] xmlpeek and multiple nodes How can I use xmlpeek/xmlpoke to recursively peruse all the similarly named nodes in a file, the the test node below. tests test.../test test.../test test.../test /tests This didn't help, http://nant.sourceforge.net/release/0.85/help/tasks/xmlpeek.html And I found this http://old.nabble.com/xmlpeek---Multiple-nodes-found-with-the-XPath-expression-td20017190.html Per that page, do I really have to do this, that is hard code the indices? So if I add a 16th node, I'll have to change the script to add a 16th index? foreach item=String in=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 delim=, property=index xmlpeek file=${somefile} nodeindex=${index} / /foreach So I found this http://www.mail-archive.com/nant-users@lists.sourceforge.net/msg11179.html But my nant version 0.91 complains about xmllist being an unknown task or data type. -chris ***This e-mail message is intended only for the above named recipient(s) and may contain information that is sensitive or proprietary. If you have received this message in error or are not the named recipient(s), please immediately notify the sender, delete this e-mail message without making a copy and do not disclose or relay this e-mail message to anyone.*** -- For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2___ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users
Re: [NAnt-users] xmlpeek and multiple nodes
Silly me. This works for xmlpeek, but I can't xmlpoke on a nodeindex. Duh Backtrack -chris From: Chris Fouts Sent: Friday, April 20, 2012 11:18 AM To: nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes Ok, here's my workaround to parse this xml file, and it works! Essentially I just increment the node index and make a recursive target call. tests !-- testRunStatus = run this test?: yes, no, or skip -- test nameLesson1234/name testRunStatusskip/testRunStatus /test test nameLesson4567/name testRunStatusyes/testRunStatus /test test nameLesson5678/name testRunStatusno/testRunStatus /test !-- This has to be the last node! -- test name*/name testRunStatusno/testRunStatus /test /tests !-Initial xml idx value is 0 -- property name=xmlidx value=0 / target name=selectTestToRun xmlpeek file=C:\Sompath\teststoRun.xml xpath=/tests/test/name nodeindex=${xmlidx} property=name / if test=${name != '*'} echoname is ${name} /echo xmlpeek file=C:\Somepath\teststoRun.xml xpath=/tests/test/testRunStatus nodeindex=${xmlidx} property=testRunStatus / echotestRunStatus is ${testRunStatus} /echo if test=${testRunStatus == 'yes'} !-RUN THE TEST -- /if !-increment xml index -- property name=xmlidx value=${int::parse(xmlidx)+1} / !-Recursive call -- call target=selectTestToRun / /if /target From: Bob Archer [mailto:bob.arc...@amsi.com] Sent: Friday, April 20, 2012 11:05 AM To: Chris Fouts; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes Not really, no. From: Chris Fouts [mailto:chris.fo...@caemilusa.com] Sent: Friday, April 20, 2012 10:03 AM To: nant-users@lists.sourceforge.net Subject: Re: [NAnt-users] xmlpeek and multiple nodes So no canned support for this? -chris From: Bob Archer [mailto:bob.arc...@amsi.com] Sent: Friday, April 20, 2012 9:59 AM To: Chris Fouts; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes In other words, if you can't get to a specific node with an XPath expression you really need to roll your own. That's really what it is designed for. You could do something like what you are doing, however, you probably still need your own script task to get the count of matching nodes. A quick google find this http://bgeek.net/2005/09/19/nant-xml-node-counting/ BOb From: Chris Fouts [mailto:chris.fo...@caemilusa.com] Sent: Friday, April 20, 2012 9:48 AM To: Bob Archer; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes That's all I want to do, find a node and update it. From: Bob Archer [mailto:bob.arc...@amsi.com] Sent: Friday, April 20, 2012 9:36 AM To: Chris Fouts; nant-users@lists.sourceforge.net Subject: RE: xmlpeek and multiple nodes For more than a simple find a node and update it I would recommend you write you own code using the script task. Or write your own task. BOb From: Chris Fouts [mailto:chris.fo...@caemilusa.com] Sent: Friday, April 20, 2012 9:02 AM To: nant-users@lists.sourceforge.net Subject: [NAnt-users] xmlpeek and multiple nodes How can I use xmlpeek/xmlpoke to recursively peruse all the similarly named nodes in a file, the the test node below. tests test.../test test.../test test.../test /tests This didn't help, http://nant.sourceforge.net/release/0.85/help/tasks/xmlpeek.html And I found this http://old.nabble.com/xmlpeek---Multiple-nodes-found-with-the-XPath-expression-td20017190.html Per that page, do I really have to do this, that is hard code the indices? So if I add a 16th node, I'll have to change the script to add a 16th index? foreach item=String in=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 delim=, property=index xmlpeek file=${somefile} nodeindex=${index} / /foreach So I found this http://www.mail-archive.com/nant-users@lists.sourceforge.net/msg11179.html But my nant version 0.91 complains about xmllist being an unknown task or data type. -chris ***This e-mail message is intended only for the above named recipient(s) and may contain information that is sensitive or proprietary. If you have received this message in error or are not the named recipient(s), please immediately notify the sender, delete this e-mail message without making a copy and do not disclose or relay this e-mail message to anyone.*** -- For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2___ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users
Re: [NAnt-users] xmlpeek and multiple nodes
I have a modified copy of the XMLLIST task that I use for this. This issue comes up quite often for me; I don't understand why this type of situation/solution seems to get downplayed as "...don't do that".You can find a way to the originalhere:http://weblogs.asp.net/soever/archive/2006/12/01/nant-xmllist-command-updated.aspx--Mike Frederick -- For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2___ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users
Re: [NAnt-users] xmlpeek and multiple nodes
I don’t think I said “don’t do that”… All I said was, out of the box xmlpoke and xmlpeek are really designed to work with an xpath that matches a single element in the XML. ;) BOb From: m...@thefrederickhome.name [mailto:m...@thefrederickhome.name] Sent: Friday, April 20, 2012 11:44 AM To: nant-users@lists.sourceforge.net Subject: Re: [NAnt-users] xmlpeek and multiple nodes I have a modified copy of the XMLLIST task that I use for this. This issue comes up quite often for me; I don't understand why this type of situation/solution seems to get downplayed as ...don't do that. You can find a way to the original here: http://weblogs.asp.net/soever/archive/2006/12/01/nant-xmllist-command-updated.aspx -- Mike Frederick -- For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2___ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users