<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>xml on S Anand</title>
    <link>https://www.s-anand.net/blog/tag/xml/</link>
    <description>Recent content in xml on S Anand</description>
    <generator>Hugo -- 0.164.0</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 20 Sep 2024 04:07:16 +0000</lastBuildDate>
    <atom:link href="https://www.s-anand.net/blog/tag/xml/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title></title>
      <link>https://www.s-anand.net/blog/structure-prompts-as-xml/</link>
      <pubDate>Fri, 20 Sep 2024 04:07:16 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/structure-prompts-as-xml/</guid>
      <description>&lt;p&gt;Looks like XML tags are the best way to structure prompts and separate sections for an #LLM. It&amp;rsquo;s the only format that all of Anthropic, Google, and OpenAI LLMs encourage.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;p&gt;&lt;instructions&gt;&amp;hellip;&lt;/instructions&gt;
&lt;question&gt;&amp;hellip;&lt;/question&gt;
&lt;example&gt;&amp;hellip;&lt;/example&gt;
&lt;example&gt;&amp;hellip;&lt;/example&gt;&lt;/p&gt;
&lt;p&gt;Anthropic Docs: &lt;a href=&#34;https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/use-xml-tags&#34;&gt;https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/use-xml-tags&lt;/a&gt;
OpenAI Docs: &lt;a href=&#34;https://platform.openai.com/docs/guides/prompt-engineering/strategy-write-clear-instructions&#34;&gt;https://platform.openai.com/docs/guides/prompt-engineering/strategy-write-clear-instructions&lt;/a&gt;
Google Docs: &lt;a href=&#34;https://cloud.google.com/vertex-ai/generative-ai/docs/learn/prompts/structure-prompts&#34;&gt;https://cloud.google.com/vertex-ai/generative-ai/docs/learn/prompts/structure-prompts&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Alternatives are using JSON, Markdown, templating formats like Mustache/Jinja, etc.&lt;/p&gt;
&lt;p&gt;Even Llama&amp;rsquo;s system tokens seem a little XML-like.
&lt;a href=&#34;https://github.com/meta-llama/llama3/blob/main/llama/tokenizer.py#L61-L74&#34;&gt;https://github.com/meta-llama/llama3/blob/main/llama/tokenizer.py#L61-L74&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Personally, I&amp;rsquo;ve been using Markdown so far. But it&amp;rsquo;s time to switch over. (Only on the prompt side. On the generation side, Markdown still seems the best.)&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.linkedin.com/feed/update/urn%3Ali%3Ashare%3A7242746111097012225&#34;&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    <item>
      <title>RSS feeds in Excel</title>
      <link>https://www.s-anand.net/blog/rss-feeds-in-excel/</link>
      <pubDate>Thu, 03 May 2007 12:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/rss-feeds-in-excel/</guid>
      <description>&lt;p&gt;The technique of &lt;a href=&#34;https://www.s-anand.net/blog/web-lookup-using-excel/&#34;&gt;Web lookups in Excel&lt;/a&gt; I described yesterday is very versatile. I will be running through some of the practical uses it can be put to over the next few days&lt;/p&gt;
&lt;p&gt;TO generalise things beyond just &lt;a href=&#34;https://www.s-anand.net/blog/web-lookup-using-excel/&#34;&gt;getting the Amazon price&lt;/a&gt;, I created a &lt;a href=&#34;https://www.s-anand.net/blog/user-defined-functions-in-excel/&#34;&gt;user-defined function&lt;/a&gt; called XPATH. It takes two parameters:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;URL&lt;/strong&gt; of the XML feed to read&lt;br&gt;
&lt;strong&gt;Search&lt;/strong&gt; XPath list string (separated by spaces)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This function can be used to extract information out of any XML file on the Web and get it out as a table. For example, if you wanted to watch the Top 10 movies on the &lt;a href=&#34;http://www.imdb.com/chart/top&#34;&gt;IMDb Top 250&lt;/a&gt;, and were looking for torrents, an RSS feed is available from &lt;a href=&#34;http://www.mininova.org/&#34;&gt;mininova&lt;/a&gt;. The URL &lt;a href=&#34;http://www.mininova.org/rss/movie&#34;&gt;http://www.mininova.org/rss/movie&lt;/a&gt;_name/4 gives you an RSS file matching all movies with &amp;ldquo;movie_name&amp;rdquo;. From this, we need to extract the &lt;item&gt;&lt;title&gt; and &lt;item&gt;&lt;link&gt; elements. That&amp;rsquo;s represented by &amp;ldquo;//item title link&amp;rdquo; on my search string.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.s-anand.net/blog/assets/flickr-mininova-rss-feed-in-excel_482789516_o-png.webp&#34;&gt;&lt;img alt=&#34;Mininova RSS feed in Excel&#34; loading=&#34;lazy&#34; src=&#34;https://www.s-anand.net/blog/assets/flickr-mininova-rss-feed-in-excel_482789516_o-png.webp&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The formula becomes &lt;code&gt;XPath2( &amp;quot;http://www.mininova.org/rss/&amp;quot;&amp;amp;A2&amp;amp;&amp;quot;/4&amp;quot;, &amp;quot;//item title link&amp;quot;)&lt;/code&gt;. The result is a 2-dimensional array returning individual items in rows, and the columns are title and link. Pulling it all together, you can get the sheet above.&lt;/p&gt;
&lt;p&gt;All of this could be done using a command-line program. Excel has one huge advantage though. It&amp;rsquo;s one of the most powerful user-interfaces. Increasingly, I&amp;rsquo;m beginning to rely on just two user interfaces for almost any task. One is the browser, and the other is Excel. With Excel, I could have a sheet that has my &lt;a href=&#34;https://www.s-anand.net/blog/wishlist-for-movies/&#34;&gt;movie wishlist&lt;/a&gt; (which changes often), and add check to see if the torrent exists. Every time I add a bunch of movies to the wishlist, it&amp;rsquo;s just a matter of copying the formula down. No need to visit a torrent search engine and typing each movie in, one by one.&lt;/p&gt;
&lt;p&gt;Another example. Someone suggests 10 movies to watch. I&amp;rsquo;d rather watch the ones with a higher IMDb rating. Again, enter the Web lookup. Type in the movie names. Use a function like this to look up the rating on IMDb, and sort by the rating.&lt;/p&gt;
&lt;p&gt;The possibilities are endless.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;comments&#34;&gt;Comments&lt;/h2&gt;
&lt;!-- wp-comments-start --&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Isit?&lt;/strong&gt; &lt;em&gt;3 May 2007 12:00 pm&lt;/em&gt;:
Is it possible to have the feeds update cumulative so the old feeds dont get replaced in excel?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alex&lt;/strong&gt; &lt;em&gt;3 May 2007 12:00 pm&lt;/em&gt;:
Hi, I have an Excel spreadsheet with URLs of move titles on IMDB, and I would like to retrieve the movie rating. I&amp;rsquo;ve read your tutorials, and this one comes closest to what I need. However I still cannot figure out what needs to be done. It looks like you have this problem solved. If so, can you possibly share your solution with me? Thank you, Alex&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Kishan&lt;/strong&gt; &lt;em&gt;3 May 2007 12:00 pm&lt;/em&gt;:
I came here searching for the other way round. That is to publish an RSS feed of what I have in Xcel! Thanks Anyways&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;venkat&lt;/strong&gt; &lt;em&gt;15 Oct 2010 4:09 pm&lt;/em&gt;:
Anand
Can you provide the xpath function?, I need to read a rss feed into excel, and i want only some columns of data, i would appreciate if you could send the xpath function to my email id
Thanks
venkat&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://www.light-sensors.com&#34;&gt;Light Sensors&lt;/a&gt;&lt;/strong&gt; &lt;em&gt;2 Dec 2010 7:08 pm&lt;/em&gt;:
movie ratings really depend on how cool the movie is, i usually rate movies depending on the story line `-;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;rt&lt;/strong&gt; &lt;em&gt;27 Jun 2013 5:41 pm&lt;/em&gt;:
Hi, nice job ! can you share with me your xpath2 (i tried your other one without succes on amazon) ?Thanks, R&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- wp-comments-end --&gt;
</description>
    </item>
    <item>
      <title>IIMB PGP99 Birthday calendar</title>
      <link>https://www.s-anand.net/blog/iimb-pgp99-birthday-calendar/</link>
      <pubDate>Sun, 16 Apr 2006 12:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/iimb-pgp99-birthday-calendar/</guid>
      <description>&lt;p&gt;The &lt;a href=&#34;http://www.google.com/calendar/ical/j8rt8e5j0h8jtteqe34aabecb0@group.calendar.google.com/public/basic&#34;&gt;IIMB PGP99 Birthday calendar&lt;/a&gt; is online. You can add it to &lt;a href=&#34;http://calendar.google.com/&#34;&gt;Google Calendar&lt;/a&gt;, &lt;a href=&#34;http://www.apple.com/ical/&#34;&gt;iCal&lt;/a&gt; or &lt;a href=&#34;http://www.mozilla.org/projects/calendar/&#34;&gt;Mozilla Calendar&lt;/a&gt;. Here&amp;rsquo;s the &lt;a href=&#34;http://www.google.com/calendar/feeds/j8rt8e5j0h8jtteqe34aabecb0@group.calendar.google.com/public/basic&#34;&gt;XML&lt;/a&gt; version.&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Droogle</title>
      <link>https://www.s-anand.net/blog/droogle/</link>
      <pubDate>Thu, 24 Mar 2005 12:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/droogle/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://www.droogle.ca/&#34;&gt;Droogle&lt;/a&gt;. Drink recipes.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;comments&#34;&gt;Comments&lt;/h2&gt;
&lt;!-- wp-comments-start --&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Jetru&lt;/strong&gt; &lt;em&gt;24 Mar 2005 5:04 pm&lt;/em&gt;:
Doesnt look like the XML feed is working&amp;hellip;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deshi&lt;/strong&gt; &lt;em&gt;24 Mar 2005 6:17 pm&lt;/em&gt;:
This is one lousy blog!&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Genmys&lt;/strong&gt; &lt;em&gt;25 Mar 2005 1:49 am&lt;/em&gt;:
Lassi features as South Indian drink. Obscure results for Butter Milk&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ritzkini&lt;/strong&gt; &lt;em&gt;25 Mar 2005 8:13 am&lt;/em&gt;:
Bandwidth Limit Exceeded.The server is temporarily unable to service your request due to the site owner reaching his/her bandwidth limit. Please try again later.Apache/1.3.33 Server at &lt;a href=&#34;https://www.droogle.ca&#34;&gt;www.droogle.ca&lt;/a&gt; Port 80(25/03/2005-at 1:45 PM IST)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shamit&lt;/strong&gt; &lt;em&gt;26 Mar 2005 4:41 am&lt;/em&gt;:
It is getting a bit cluttered &amp;hellip;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;S Anand&lt;/strong&gt; &lt;em&gt;28 Mar 2005 3:20 am&lt;/em&gt;:
Yes, it is, rather. Will see what I can do about that.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;S Anand&lt;/strong&gt; &lt;em&gt;30 Mar 2005 7:23 am&lt;/em&gt;:
Fixed the XML feed.&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- wp-comments-end --&gt;
</description>
    </item>
    <item>
      <title>RSS feed</title>
      <link>https://www.s-anand.net/blog/rss-feed/</link>
      <pubDate>Tue, 25 Jan 2005 12:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/rss-feed/</guid>
      <description>&lt;p&gt;My &lt;a href=&#34;https://www.s-anand.net/blog/sanand.xml&#34;&gt;RSS feed&lt;/a&gt; is back.&lt;/p&gt;
</description>
    </item>
  </channel>
</rss>
