Программирование в IIS

Пример 1.15

<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> <xsl:template match="/">

<xsl:comment> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ XSL Sheet primarily for the purposes of building an HTML page to allow a user to open or create a new chair and see the results with the presentation logic abstracted completely ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


<xsl:comment> Start the HTML page here </xsl:comment> <HTML> <HEAD> <TITLE>XML COM page</TITLE> </HEAD> <BODY>

<xsl:comment> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ build table for chair data ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ </xsl:comment>

<xsl:for-each select="Chair"> <P>current</P> <TABLE BORDER="1" CELLSPACING="0" CELLPADDING="0"> <TR> <TH>ID</TH> <TH>Color</TH> </TR> <TR> <TD><xsl:value-of select="@ID"/></TD> <TD><xsl:value-of select="@Color"/></TD> </TR> </TABLE> </xsl:for-each>

<xsl:comment> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ XSL parts are completed

Please never forget, all HTML must be well formed also. XSL is also case sensitive. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ </xsl:comment>

<P>command </P> <xsl:comment> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ build table for commanding new chair data ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ </xsl:comment>

<FORM METHOD = "POST" ACTION = "XMLCOMChair.asp" ID = "frmImage" NAME = "getInfo" > <TABLE BORDER="1" CELLSPACING="0" CELLPADDING="0"> <TR> <TD>Action</TD> <TD> <input TYPE="text" NAME="Action" VALUE="Open or New"> </input> </TD> </TR> <TR> <TD>ID</TD> <TD><input TYPE="text" NAME="ID" VALUE=""></input></TD> </TR> <TR> <TD>color</TD> <TD> <input TYPE="text" NAME="color" VALUE="puce"> </input> </TD> </TR> </TABLE> <input ID="subFull" NAME="subR" TYPE="submit" VALUE="Go"></input> </FORM>


</xsl:template> </xsl:stylesheet>

Листинг 1.15. Source code for formatChair.xsl

Закрыть окно

Содержание  Назад  Вперед