webd:proxy

Purpose

Specifies a proxy server for HTTP requests. The server is defined in the mcs-config.xml file. See Defining HTTP resources for more information.

Contained by

Attribute

Attribute Description Type Default Options Use
ref A reference to a proxy element in the mcs-config.xml file. xs:string none    optional 

Examples

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
  xmlns:pipeline="http://www.volantis.com/xmlns/marlin-pipeline"
  xmlns:webd="http://www.volantis.com/xmlns/marlin-web-driver"
  xmlns:mcs="http://www.volantis.com/xmlns/2006/01/xdime/mcs">
  <head>
    <title>DCI elements</title>
    <meta property="mcs:cache-scope">optimistic</meta>
    <meta property="mcs:max-age">180</meta>
  </head>
  <body>
    <div>
      <pipeline:transform href="test.xsl">
        <webd:get url="http://weather.yahooapis.com/forecastrss">
          <webd:proxy ref="myproxy"/>
          <webd:parameters>
            <webd:parameter name="p" value="USWA0395"/>
            <webd:parameter name="u" value="c"/>
          </webd:parameters>
        </webd:get>
      </pipeline:transform>
    </div>
  </body>
</html>

The test.xsl transformation must include the following code.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
  xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
  <xsl:output method="xml"/>
  <xsl:template match="/">
    <div xmlns="http://www.w3.org/2002/06/xhtml2">
      <h3>
        <xsl:value-of select="/rss/channel/item/title"/>
      </h3>
      <p>Current Conditions: <xsl:value-of select="/rss/channel/item/yweather:condition/@text"/>,
        <xsl:value-of select="/rss/channel/item/yweather:condition/@temp"/>
        <xsl:value-of select="/rss/channel/yweather:units/@temperature"/>.</p>
    </div>
  </xsl:template>
</xsl:stylesheet>

The pipeline-configuration section in mcs-config.xml must contain proxy configuration.

<proxy id="myproxy" port="8080" host="localhost"/>

Related topics