Re: [WebDNA] Small Parsing Problem
This WebDNA talk-list message is from 2009
It keeps the original formatting.
numero = 101845
interpreted = N
texte = Hey, thanks for all the solutions!.I solved my own problem because I had over complicated it. I found anode in the xml that has what I need. I was preparing to parse twopieces of information to create the link I wanted, when it was infront of my eyes, Doh.To extract a link from a YouTube xml. MyVariable is the nth
node. Five videos, fifth video, MyVariable would be 5[xmlnodeattributesref=xml_var1&path=named:feed/entry([MyVariable])/media:group/media:player][text]LinkToVideo=[value][/text][/xmlnodeattributes]http://code.google.com/apis/youtube/2.0/developers_guide_protocol_understanding_video_feeds.htmlD.On Wed, Jan 28, 2009 at 5:57 PM, Dan Strong wrote:> [text]stringToParse=tag:youtube,2008:video:24Ryj1ywosw[/text]>> [middle startafter=video:&endbefore=][stringToParse][/middle]>> would definitely work, as would a [middle]/[listwords] hybrid, using colon> as a delimiter since your desired id code would be the last [word] in the> loop>> [listwords words=[middle> startafter=&endbefore=][stringToParse][/middle]&delimiters=:][word][/listwords]>> -Dan>>>> On Wed, 28 Jan 2009 17:47:38 -0500> David Bastedo wrote:>>>> middle also confuses me . . . :)>>>> Thanks in advance!>>>> D.>>>> On Wed, Jan 28, 2009 at 5:31 PM, Govinda >> wrote:>>>>>> or if you are in a rush, why not use [middle] instead?>>> if you need more help writing such a [middle] ask again and I'll do it.>>> -Govinda>>>>>> On Jan 28, 2009, at 3:25 PM, David Bastedo wrote:>>>>>>> Hi, I am trying to get a youTube VideoID value from the content of the>>>> ID>>>> tag.>>>>>>>> Example:>>>> tag:youtube,2008:video:24Ryj1ywosw>>>>>>>> so ineffect, I need to parse the following>>>> tag:youtube,2008:video:24Ryj1ywosw>>>>>>>>>>>> From YouTube: The tag specifies a URN that uniquely and>>>> permanently identifies a feed or video entry.>>>>>>>> so I believe the solution is a grep to get the content from each of>>>> the tag and video elements, as the tag and video labels will not>>>> change, but the content will have a varying length.>>>>>>>> So to get the videoID, I would grep from the colon after video to the>>>> end and take everything inbetween . . . of course, that's where it all>>>> falls apart as I am really just starting to find that I need to lear>>>> grep and regular expressions. . .>>>>>>>> thanks for any help.>>>>>>>> D.>>>>>>>>>>>>>>>> -->>>> David Bastedo>>>> Ten Plus One Communications Inc.>>>> http://www.10plus1.com>>>> 416.603.2223 ext.1>>>> --------------------------------------------------------->>>> This message is sent to you because you are subscribed to>>>> the mailing list .>>>> To unsubscribe, E-mail to: >>>> archives: http://mail.webdna.us/list/talk@webdna.us>>>> old archives: http://dev.webdna.us/TalkListArchive/>>>>>> --------------------------------------------------------->>> This message is sent to you because you are subscribed to>>> the mailing list .>>> To unsubscribe, E-mail to: >>> archives: http://mail.webdna.us/list/talk@webdna.us>>> old archives: http://dev.webdna.us/TalkListArchive/>>>>>>>>>>>>>> -->> David Bastedo>> Ten Plus One Communications Inc.>> http://www.10plus1.com>> 416.603.2223 ext.1>> --------------------------------------------------------->> This message is sent to you because you are subscribed to>> the mailing list .>> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us>> old archives: http://dev.webdna.us/TalkListArchive/>> ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> old archives: http://dev.webdna.us/TalkListArchive/>-- David BastedoTen Plus One Communications Inc.http://www.10plus1.com416.603.2223 ext.1
Associated Messages, from the most recent to the oldest:
Hey, thanks for all the solutions!.I solved my own problem because I had over complicated it. I found anode in the xml that has what I need. I was preparing to parse twopieces of information to create the link I wanted, when it was infront of my eyes, Doh.To extract a link from a YouTube xml. MyVariable is the nth node. Five videos, fifth video, MyVariable would be 5[xmlnodeattributesref=xml_var1&path=named:feed/entry([MyVariable])/media:group/media:player][text]LinkToVideo=[value][/text][/xmlnodeattributes]http://code.google.com/apis/youtube/2.0/developers_guide_protocol_understanding_video_feeds.htmlD.On Wed, Jan 28, 2009 at 5:57 PM, Dan Strong wrote:> [text]stringToParse=tag:youtube,2008:video:24Ryj1ywosw[/text]>> [middle startafter=video:&endbefore=][stringToParse][/middle]>> would definitely work, as would a [middle]/[listwords] hybrid, using colon> as a delimiter since your desired id code would be the last [word] in the> loop>> [listwords words=[middle> startafter=&endbefore=][stringToParse][/middle]&delimiters=:][word][/listwords]>> -Dan>>>> On Wed, 28 Jan 2009 17:47:38 -0500> David Bastedo wrote:>>>> middle also confuses me . . . :)>>>> Thanks in advance!>>>> D.>>>> On Wed, Jan 28, 2009 at 5:31 PM, Govinda >> wrote:>>>>>> or if you are in a rush, why not use [middle] instead?>>> if you need more help writing such a [middle] ask again and I'll do it.>>> -Govinda>>>>>> On Jan 28, 2009, at 3:25 PM, David Bastedo wrote:>>>>>>> Hi, I am trying to get a youTube VideoID value from the content of the>>>> ID>>>> tag.>>>>>>>> Example:>>>> tag:youtube,2008:video:24Ryj1ywosw>>>>>>>> so ineffect, I need to parse the following>>>> tag:youtube,2008:video:24Ryj1ywosw>>>>>>>>>>>> From YouTube: The tag specifies a URN that uniquely and>>>> permanently identifies a feed or video entry.>>>>>>>> so I believe the solution is a grep to get the content from each of>>>> the tag and video elements, as the tag and video labels will not>>>> change, but the content will have a varying length.>>>>>>>> So to get the videoID, I would grep from the colon after video to the>>>> end and take everything inbetween . . . of course, that's where it all>>>> falls apart as I am really just starting to find that I need to lear>>>> grep and regular expressions. . .>>>>>>>> thanks for any help.>>>>>>>> D.>>>>>>>>>>>>>>>> -->>>> David Bastedo>>>> Ten Plus One Communications Inc.>>>> http://www.10plus1.com>>>> 416.603.2223 ext.1>>>> --------------------------------------------------------->>>> This message is sent to you because you are subscribed to>>>> the mailing list .>>>> To unsubscribe, E-mail to: >>>> archives: http://mail.webdna.us/list/talk@webdna.us>>>> old archives: http://dev.webdna.us/TalkListArchive/>>>>>> --------------------------------------------------------->>> This message is sent to you because you are subscribed to>>> the mailing list .>>> To unsubscribe, E-mail to: >>> archives: http://mail.webdna.us/list/talk@webdna.us>>> old archives: http://dev.webdna.us/TalkListArchive/>>>>>>>>>>>>>> -->> David Bastedo>> Ten Plus One Communications Inc.>> http://www.10plus1.com>> 416.603.2223 ext.1>> --------------------------------------------------------->> This message is sent to you because you are subscribed to>> the mailing list .>> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us>> old archives: http://dev.webdna.us/TalkListArchive/>> ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> old archives: http://dev.webdna.us/TalkListArchive/>-- David BastedoTen Plus One Communications Inc.http://www.10plus1.com416.603.2223 ext.1
David Bastedo
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
What am I doing wrong? --GOT IT! (2000)
help needed: Non-english characters in WebCatalog (1997)
[regexp] will be renamed to [grep] in next release (2000)
Field Totals (2004)
Version 2.1.3 changes ... (1998)
I give up!! (1997)
are YOU disallowing certain chars to be in user passwords? (2000)
Generating Report Totals (1997)
[WebDNA] Check if variable is blank or is raw or third condition (2010)
rename a file (1997)
Orderfile context problem (1998)
OSX (2002)
RE: IIS4b2 and WebCatalog b19 (1997)
Triggers (2003)
[WebDNA] Recall with different scopes ... (2015)
Setting up shop (1997)
searching multiple databases (1997)
Assigning new CART number (1997)
NT or Mac (1998)
Limiting user access to .tmpl files (1997)