Siebel Mobile Connector Guide > Sample XML and XSL Output >

Sample XSL Style Sheets


With no style sheets applied, SWE will return all the requested data. In order to filter data for specific views, it is necessary to apply style sheets for those views and also apply a style sheet that filters data for all unsubscribed views. The following is an example of a style sheet that filters data for all unsubscribed views (*_UnsubscribedView_UI.xsl).

<?xml version="1.0" encoding="UTF-8" ?>

- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:output method="xml" media-type="text/html" encoding="UTF-8" />

- <xsl:template match="/">

  <xsl:call-template name="COPYNODE" />

  </xsl:template>

- <xsl:template name="COPYNODE">

- <xsl:copy>

  <xsl:copy-of select="@*" />

  <xsl:value-of select="text()" />

- <xsl:for-each select="*">

  <xsl:call-template name="CHILDPROCESS" />

  </xsl:for-each>

  </xsl:copy>

  </xsl:template>

- <xsl:template name="CHILDPROCESS">

- <xsl:choose>

  <xsl:when test="name()='VIEW'" />

- <xsl:otherwise>

  <xsl:call-template name="COPYNODE" />

  </xsl:otherwise>

  </xsl:choose>

  </xsl:template>

  </xsl:stylesheet>

The following XSL style sheet limits data returned from the SMC Opportunity View (Vendor_SiebelMobileConnector_SMCOpportunityView_UI.xsl):

<?xml version="1.0" encoding="UTF-8" ?>

<?xml version="1.0" encoding="UTF-8" ?>

- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:output method="xml" media-type="text/html" encoding="UTF-8" />

- <xsl:template match="/">

  <xsl:call-template name="COPYNODE" />

  </xsl:template>

- <xsl:template name="COPYNODE">

- <xsl:copy>

  <xsl:copy-of select="@*" />

  <xsl:value-of select="text()" />

- <xsl:for-each select="*">

  <xsl:call-template name="CHILDPROCESS" />

  </xsl:for-each>

  </xsl:copy>

  </xsl:template>

- <xsl:template name="CHILDPROCESS">

- <xsl:choose>

- <xsl:when test="name()='COLUMN'">

- <xsl:choose>

- <xsl:when test="ancestor::node()[name()='APPLET' and @NAME='Account Form Applet']">

  <xsl:call-template name="AccountFormAppletCOLUMN" />

  </xsl:when>

  </xsl:choose>

  </xsl:when>

- <xsl:when test="name()='FIELD'">

- <xsl:choose>

- <xsl:when test="ancestor::node()[name()='APPLET' and @NAME='Account Form Applet']">

  <xsl:call-template name="AccountFormAppletFIELD" />

  </xsl:when>

  </xsl:choose>

  </xsl:when>

- <xsl:when test="name()='CONTROL'">

- <xsl:choose>

- <xsl:when test="ancestor::node()[name()='APPLET' and @NAME='Account Form Applet']">

  <xsl:call-template name="AccountFormAppletCONTROL" />

  </xsl:when>

  </xsl:choose>

  </xsl:when>

- <xsl:otherwise>

  <xsl:call-template name="COPYNODE" />

  </xsl:otherwise>

  </xsl:choose>

  </xsl:template>

- <xsl:template name="AccountFormAppletCONTROL">

- <xsl:choose>

- <xsl:when test="@NAME='Name'">

  <xsl:call-template name="COPYNODE" />

  </xsl:when>

  </xsl:choose>

  </xsl:template>

- <xsl:template name="AccountFormAppletCOLUMN">

- <xsl:choose>

- <xsl:when test="@FIELD='Name'">

  <xsl:call-template name="COPYNODE" />

  </xsl:when>

  </xsl:choose>

  </xsl:template>

- <xsl:template name="AccountFormAppletFIELD">

- <xsl:choose>

- <xsl:when test="@NAME='Name'">

  <xsl:call-template name="COPYNODE" />

  </xsl:when>

  </xsl:choose>

  </xsl:template>

  </xsl:stylesheet>

Siebel Mobile Connector Guide Copyright © 2006, Oracle. All rights reserved.