Mashup Code Sample - WebClipping Mashup example with EMML and XPath
Posted 10/29/2008 - 11:57 by osornohm
In this mashup you can see how to do a simple webclipping from the Office Depot online store using the directInvoke function in emml
<variable name="endpointURLPrefix" type="string" default="http://www.officemax.com.mx/store/detail.aspx?ID=" />
<!-- Building the endpoint with the parameter -->
<assign outputvariable="endpointURL" fromexpr="concat($endpointURLPrefix,$productId)" />
<!-- Calling the endpoint webpage -->
<directinvoke endpoint="$endpointURL" method="GET" outputvariable="htmlResult" />
and get´s the price of a specific product parsing the output with XPath.
<!-- Parsing with XPath and building the output -->
<appendresult outputvariable="result">
<price>{(substring($htmlResult//*:span[@class="price red"]/string(),2))}</price>
</appendresult>
This approach is good webpages that return well formed xml.
(1 vote)
- Login or register to post comments
- Email this page










