Tải bản đầy đủ - 0 (trang)
4 Enhanced Example of XML/XSL Web Interface with WSAD

4 Enhanced Example of XML/XSL Web Interface with WSAD

Tải bản đầy đủ - 0trang

class="docEmphStrong">Employee/@name"/>



TotalHours:
select="
class="docEmphStrong">Summary/@totalHours"/>







Department:
select="
class="docEmphStrong">Employee/@deptName"/>



TotalOvertimeHours:


class="docEmphStrong">Summary/@overTimeHours"/>
















xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

version="1.0"

xmlns:xalan="http://xml.apache.org/xslt">

Time

Sheet







WeekEnding:













>


select="Summary"/>






border="0">



Employee:
select="
class="docEmphStrong">@name"/>





Department:
select="
class="docEmphStrong">@deptName"/>










border="0">



TotalHours:
select="
class="docEmphStrong">@totalHours"/>





TotalOvertimeHours:


class="docEmphStrong">@overTimeHours"/>






























width="100%">

Date

Hours

Project




class="docEmphStrong">
order="descending"select="Date"/>
















class="docEmphStrong">Project/@name"/>
















ProjectID



Name

Hours




select="Project"/>















TimeSheet









WeekEnding:
























ProjectTotals








select="Summary/ProjectTotals"/>














The
tagwilladdahorizontalrule(aline)tothe

HTMLoutputandthenitwillcalltheProjectTotals

template.

15.4.4.4TestingtheNewTemplates



Onceyouhavemadetheseupdates,applythe

timesheet2.xsltothetimesheet.xmlfile.Thegenerated

HTMLshouldcreateaWebpageasshowninFigure

15.21.

Figure15.21.FinaltimesheetHTMLoutput



packagecom.wsbook.xmlxsl.sample;

importjava.util.Properties;

importjavax.xml.parsers.DocumentBuilderFactory;

importorg.w3c.dom.Document;

importorg.w3c.dom.Element;

importorg.w3c.dom.Node;

publicclassTimeSheetXMLGenerator{

publicDocumentgenerateXML(StringshowDetails){

Documentdoc=null;

try{

doc=DocumentBuilderFactory.newInstance().

newDocumentBuilder().newDocument();}catch

(Exceptione){

System.out.println("Exceptionoccurred�"+e);

Returnnull;

}



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

4 Enhanced Example of XML/XSL Web Interface with WSAD

Tải bản đầy đủ ngay(0 tr)

×