<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<br><br>I could be imagining things, but I thought Julian just posted something about Regular Expressions now being supported.<br><br>If that is true, then this would work:<br><br>new_xml = replace(original_xml, /the_string_here/g, "");<br><br>the /g at the end if the string parameter means "global", so it would replace all the instances of that URL with "".<br><br>Dave<br><br><br><hr id="stopSpelling">From: ronm@mitchellmedia.co.uk<br>To: xerte@lists.nottingham.ac.uk<br>Subject: Re: [Xerte] how to strip out a specific string?<br>Date: Sun, 12 Apr 2009 20:19:55 +0100<br><br><div>Cheers Dave that's very helpful - I'll give that a try.</div><br><div><div>On 12 Apr 2009, at 19:35, Dave Burnett wrote:</div><br class="EC_Apple-interchange-newline"><blockquote><span class="EC_Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div class="EC_hmmessage" style="font-size: 10pt; font-family: Verdana;"><br>It actually does have a closing tag: /&gt;<br><br>XML shorthands the closing tag to save characters when all the info is contained in the attributes, i.e. there is no actual value between the tags.<br><br><span style="font-size: 11pt; font-family: Arial,sans-serif;">&lt;name&gt;jamesclay (James Clay)&lt;/name&gt; //no attributes, data between tags<br><br><br></span><span style="font-size: 11pt; font-family: Arial,sans-serif;">&lt;link type="text/html" rel="alternate" href="<a href="http://twitter.com/jamesclay/statuses/1483252089">http://twitter.com/jamesclay/statuses/1483252089</a>"/&gt;<br><br>//all data in opening tag attributes, no explicit closing tag, just /&gt;<br><br></span><br>So if you know the format you show below would be consistent, you could key on that "/&gt;" as the end of the string and RFind (reverse find) back to the first "/" you hit.<br><br>That should isolate the actual picture name/format.<br><br>Dave<br><br><br><hr id="EC_stopSpelling">From:<span class="EC_Apple-converted-space">&nbsp;</span><a href="mailto:ronm@mitchellmedia.co.uk">ronm@mitchellmedia.co.uk</a><br>To:<span class="EC_Apple-converted-space">&nbsp;</span><a href="mailto:xerte@lists.nottingham.ac.uk">xerte@lists.nottingham.ac.uk</a><br>Date: Sun, 12 Apr 2009 19:22:22 +0100<br>Subject: [Xerte] how to strip out a specific string?<br><br><div class="EC_EC_Section1"><div><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">Hi all</span></div><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">I've been experimenting with the new module method of creating templates and have created a couple of new templates optimised for a specific purpose which I’ll happily share with the community once complete. One is an optimised &nbsp;view of twitter feeds but unless I’m mistaken it seems like the xml isn't complete for some reason. I can pick up and display the text and links etc ok but I can't work out how to access the profile pics. Here's an example entry...</span></div><p class="EC_EC_MsoPlainText" style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&nbsp;</span></p><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&lt;entry&gt;</span></div><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&nbsp;&nbsp;&nbsp; &lt;id&gt;tag:search.twitter.com,2005:1483252089&lt;/id&gt;</span></div><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&nbsp;&nbsp;&nbsp; &lt;published&gt;2009-04-09T12:59:26Z&lt;/published&gt;</span></div><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&nbsp;&nbsp;&nbsp; &lt;link type="text/html" rel="alternate" href="<a href="http://twitter.com/jamesclay/statuses/1483252089">http://twitter.com/jamesclay/statuses/1483252089</a>"/&gt;</span></div><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&nbsp;&nbsp;&nbsp; &lt;title&gt;@ronm123 I meant in a browser, via a second projector probably.&lt;/title&gt;</span></div><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&nbsp;&nbsp;&nbsp; &lt;content type="html"&gt;&amp;lt;a href="<a href="http://twitter.com/ronm123">http://twitter.com/ronm123</a>"&amp;gt;@ronm123&amp;lt;/a&amp;gt; I meant in a browser, via a second projector probably.&lt;/content&gt;</span></div><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&nbsp;&nbsp;&nbsp; &lt;updated&gt;2009-04-09T12:59:26Z&lt;/updated&gt;</span></div><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&nbsp;&nbsp;&nbsp; &lt;link type="image/png" rel="image" href="<a href="http://s3.amazonaws.com/twitter_production/profile_images/96243182/Photo14_normal.jpg">http://s3.amazonaws.com/twitter_production/profile_images/96243182/Photo14_normal.jpg</a>"/&gt;</span></div><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&nbsp;&nbsp;&nbsp; &lt;twitter:source&gt;&amp;lt;a href="<a href="http://twitter.com/">http://twitter.com/</a>"&amp;gt;web&amp;lt;/a&amp;gt;&lt;/twitter:source&gt;</span></div><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&nbsp;&nbsp;&nbsp; &lt;author&gt;</span></div><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;name&gt;jamesclay (James Clay)&lt;/name&gt;</span></div><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;uri&gt;<a href="http://twitter.com/jamesclay%3C/uri">http://twitter.com/jamesclay&lt;/uri</a>&gt;</span></div><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&nbsp;&nbsp;&nbsp; &lt;/author&gt;</span></div><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&nbsp; &lt;/entry&gt;</span></div><p class="EC_EC_MsoPlainText" style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&nbsp;</span></p><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">I want to be able to strip out the path to the .jpg e.g.<a href="http://s3.amazonaws.com/twitter_production/profile_images/96243182/Photo14_normal.jpg">http://s3.amazonaws.com/twitter_production/profile_images/96243182/Photo14_normal.jpg</a></span></div><p class="EC_EC_MsoPlainText" style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&nbsp;</span></p><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">But can't work out how to do that. I can access the content of &lt;id&gt;,&lt;title&gt; and even &lt;name&gt; but the tag containing the profile pic link e.g. &lt;link type=”image/png” doesn’t have a closing tag. Presumably I need some kind of function + regular expression - any suggestions?</span></div><p class="EC_EC_MsoNormal" style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&nbsp;</span></p><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">Cheers</span></div><div style="padding: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">Ron<span style="color: rgb(31, 73, 125);"></span></span></div></div></div><br><hr>Rediscover Hotmail®: Get e-mail storage that grows with you.<span class="EC_Apple-converted-space">&nbsp;</span><a href="http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage1_042009">Check it out.</a>_______________________________________________<br>Xerte mailing list<br><a href="mailto:Xerte@lists.nottingham.ac.uk">Xerte@lists.nottingham.ac.uk</a><br><a href="http://lists.nottingham.ac.uk/mailman/listinfo/xerte">http://lists.nottingham.ac.uk/mailman/listinfo/xerte</a><br></div></span></blockquote></div><br><br /><hr />Rediscover Hotmail®: Now available on your iPhone or BlackBerry <a href='http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Mobile1_042009' target='_new'>Check it out.</a></body>
</html>