以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 XML基础 』  (http://bbs.xml.org.cn/list.asp?boardid=1)
----  can anyone help me with my xml and xsl codes?  (http://bbs.xml.org.cn/dispbbs.asp?boardid=1&rootid=&id=39979)


--  作者:honeyee.net
--  发布时间:11/13/2006 10:04:00 PM

--  can anyone help me with my xml and xsl codes?
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="style.xsl"?>
<degreeprogrammes>
 <course>
  <code>G500</code>
  <name>Single Honours Computer Science</name>
  <description>
   Our Single Honours programme is designed to be flexible. The first year 0provides a foundation in all areas of Computer Science while in the second and final years, students select courses which reflect their interests, with guidance from their Academic Adviser.
  </description>
 </course>
 <course>
  <code>G5N1</code>
  <name>Computer Science with Management</name>
  <description>
   Information technology is now widely used in many different commercial and industrial environments. In addition to the key Computer Science courses covered, this programme provides an understanding of the nature of management in a variety of organisations and functions,
together with an appreciation of the ways in which information technology can assist management in operations and strategic decision-making. In the first year, core courses are taken in both Computer Science and Management, including statistics and management information systems, and both departments offer a range of options in the second and final years.
  </description>
 </course>
 <course>
  <code>G5R1</code>
  <name>Computer Science with French</name>
  <description>
   There is an increasing demand for graduates with both technical and linguistic abilities and this programme is a response to that demand. In Computer Science the first year introduces the various areas of the subject while later years provide the opportunity to specialise in particular topics. The French courses, which make up one-quarter of the degree, provide a basis of practical language work with the opportunity to take options in French literature, culture and society. The third year is spent abroad, organised by the French Department.
  </description>
 </course>
 <course>
  <code>G5G8</code>
  <name>Computer Science with Artificial Intelligence</name>
 </course>
 <course>
  <code>G560</code>
  <name>Computer Science with Communications</name>
 </course>
 <course>
  <code>G5G6</code>
  <name>Computer Science with Computer Architecture and Design</name>
 </course>
 <course>
  <code>G590</code>
  <name>Computer Science with Safety Critical Systems</name>
  <description>
   This new family of degrees (starting September 1999) offers the core Computer Science syllabus together with the opportunity to specialise, in the second and final years, in the areas in which the Department is pre-eminent in research, and which include topics of major current interest. The programme structure will include a specified combination of courses in the specialist area, and a relevant final year full-unit project. The particular knowledge and skills gained, reflected in the title of the degree obtained, will immediately be evident to prospective employers. These research-oriented degrees will also be an ideal preparation for further academic study (hence their higher entry requirements: at least 26 points at A-level, including an A or B grade in Mathematics). Students who wish to continue their studies at Royal Holloway after graduating may take the MSc in Computer Science by Research, a one-year course which offers graduates the opportunity to specialise further in the research area which particularly interests them. Those wishing to study for PhD will also find these programmes provide an excellent focus on a particular area of research.
  </description>
 </course>
 <course>
  <code>GG5C</code>
  <name>Computer Science and Discrete Mathematics</name>
 </course>
 <course>
  <code>GG51</code>
  <name>Computer Science and Mathematics</name>
  <description>
   Modern Mathematics has been profoundly affected by the development of
the computer and many of the most exciting and practical new mathematical ideas rely on the use of computing technology. Students who take either of these joint degrees find that each subject enriches the other, and studying both subjects opens up a very wide range of career opportunities.
  </description>
 </course>
 <course>
  <code>GF53</code>
  <name>Computer Science and Physics</name>
  <description>
   This degree programme offers the opportunity to study in depth the hardware and software aspects of computer systems and the fundamental physical principles underlying this important technology.
  </description>
 </course>
 <course>
  <code>FG65</code>
  <name>Geology and Computing</name>
  <description>
   Computers are an increasingly important tool in Geology. First year courses in the Geology and Computer Science Departments concentrate on the basics of both subjects. In the second and final years there is a range of options available in both departments including courses which are specifically aimed at the use of computers in the Earth Sciences. A final year project involves writing a well-designed computer programme for the analysis or modelling of geological, geophysical or geochemical data.
  </description>
 </course>
 <course>
  <code>NG15</code>
  <name>Management and Information Systems</name>
  <description>
   This is a joint degree programme taught by the School of Management and the Department of Computer Science. It emphasises the successful  management of technological change in business. This is far more important than the mere introduction of computer-based systems, and so the programme examines the management and organisational issues involved in the introduction and operation of information systems. Teaching includes methods more often associated with postgraduate courses - for example, extensive use of case studies, and active interaction with practitioners from the business world.
  </description>
 </course>
 <course>
  <code>CG85</code>
  <name>Cognitive Science</name>
  <description>
   Cognitive Science is a discipline which draws on a knowledge of cognitive psychology, computer systems and computer models, both classical and connectionist. This joint programme covers both psychological and computing perspectives. In the Psychology Department research methods and experimental design skills are studied alongside fundamental studies of brain function. In Computer Science, basic programming skills are covered as well as more advanced topics including artificial intelligence and neural networks (a novel computing paradigm based on models of biological brains). Cognitive Science graduates will have a thorough grounding in this rapidly expanding field which links our understanding of human and machine capabilities.
  </description>
 </course>
</degreeprogrammes>
[/QUOTE]

[QUOTE]
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/xsl/Transform">

<xsl:template match="/">

<html>
 <body>
  <table cellspace="0" cellpadding="0" border="1" width="750">
   <xsl:for-each select="degreeprogrammes/course">
   <tr>
    <td>Course code:</td>
    <td><xsl:value-of select="code"/></td>
   </tr>
   <tr>
    <td>Course name:</td>
    <td><xsl:value-of select="name"/></td>
   </tr>
   <tr>
    <td>Course Description:</td>
    <td><xsl:value-of select="description"/></td>
   </tr>
   </xsl:for-each>
  </table>
 </body>
</html>

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


Thanks


--  作者:honeyee.net
--  发布时间:11/13/2006 10:05:00 PM

--  
the error is loading the XSLT faild
--  作者:Qr
--  发布时间:11/14/2006 8:56:00 AM

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


--  作者:honeyee.net
--  发布时间:11/14/2006 2:26:00 PM

--  
谢谢你啊,让我郁闷的问题,竟然就是着小小的错误...唉...
看来以后要仔细些了,我是初学者.

谢谢版主的回复!


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
1,679.688ms