<?xml version="1.0" encoding="UTF-8" ?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
  <meta>
    <author>Todd Vierling</author>
    <description>HTML selector that returns a flat, escaped string rather than a node tree. Suitable for use with Pipes and other applications wishing to embed HTML in another XML-like container.</description>
    <sampleQuery>select * from {table} where url='http://www.yahoo.com/' and xpath='//a'</sampleQuery>
  </meta>
  <bindings>
  <select itemPath="" produces="XML">
    <urls>
      <url>{url}</url>
    </urls>
    <inputs>
      <key id="url" type="xs:string" paramType="variable" required="true" />
      <key id="xpath" type="xs:string" paramType="variable" required="false" />
    </inputs>
      <execute><![CDATA[
var results = y.rest(url).accept('text/html').get().response;
if (xpath) results = y.xpath(results, xpath);
response.object = results.toXMLString();
      ]]></execute>
    </select>
  </bindings>
</table>

