| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 958 人关注过本帖
标题:[求助]初学XML,自己编写的一个小程序出了什么问题
只看楼主 加入收藏
jbwang
Rank: 1
等 级:新手上路
帖 子:64
专家分:0
注 册:2007-5-22
收藏
 问题点数:0 回复次数:2 
[求助]初学XML,自己编写的一个小程序出了什么问题

我写了一个XML的简历,在网页中总是显示不出来,我是照着老师的程序写的,代码也不多,怎么还是有问题。好心人帮忙看一下。
下面是XML文件:
<?xml version="1.0" encoding="gb2312"?>
<?xml-stylesheet href="resume.xsl" type="text/xsl"?>

<resume xmlns:xsi="http://www.sina.com.cn" xsi:naNamespaceSchemaLocation="resume.xsd">
<session1 date="2007-11-1" property="Personal information">
<name>Wang</name>
<sex>male</sex>
<id>0709120456</id>
<major>Cryptography</major>
<telephone>88200147</telephone>
<taste>swimming</taste>
</session1>

<session2>
<subtitle>Objective</subtitle>
<information authenticity="ture">To obtain a challenging position as a software engineer with an emphasis in software design and development.
</information>

<subtitle>Education</subtitle>
<information authenticity="ture">2003.9-2007.7 Graduate School of XD University, B.E.
</information>

<subtitle>Computer Abilities</subtitle>
<information authenticity="ture">Skilled in use of matlab,HTML, JavaScript, C, C++, Office 2003, SQL2000.
</information>

<subtitle>English Skills</subtitle>
<information>Past CET-4 and CET-6.Have a good command of both spoken and written English.
</information>

<subtitle>Scholarship and Awards</subtitle>
<information>Excellent graduate student</information>

<subtitle>Qualifications</subtitle>
<information>Liablity for my job,innovative and sence of teamwork</information>
</information>-->
</session2>
</resume>


以下是XSL文件:
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.sina.com.cn">
<xsl:template match="/">
<html>
<head>
<title>Resume</title>
</head>
<body background="dirt.gif">
<h1 style="color:#000000;font-size:large;text-align:center;letter-spacing:normal ">Resume</h1>
<br/>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>

<xsl:template match="resume">
<xsl:apply-templates select="session1">
</xsl:apply-templates>
<xsl:apply-templates select="session2">
</xsl:apply-templates>
</xsl:template>

<xsl:template match="session1">
<h2 style="font-weight:bold;text-align:left;font-size:18px"><xsl:value-of select="@property"/></h2>
Name:<xsl:value-of select="name"/><br/> Sex:<xsl:value-of select="sex"/><br/>
ID:<xsl:value-of select="id"/><br/> Major:<xsl:value-of select="major"/><br/>
phone:<xsl:value-of select="telephone"/><br/> Taste:<xsl:value-of select="taste"/><br/>
</xsl:template>

<xsl:template match="session2">
<xsl:for-each select="subtitle">
<h2 style="font-weight:bold;text-align:left;font-size:18px"><xsl:value-of select="subtitle"/></h2>
<xsl:value-of select="information"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

[此贴子已经被作者于2007-11-6 21:38:48编辑过]



xdcZREHW.txt (1.6 KB) [求助]初学XML,自己编写的一个小程序出了什么问题



WB6ipwxk.txt (1.24 KB) [求助]初学XML,自己编写的一个小程序出了什么问题

搜索更多相关主题的帖子: XML 编写 初学 
2007-11-06 18:04
lmhllr
Rank: 8Rank: 8
等 级:贵宾
威 望:44
帖 子:1504
专家分:42
注 册:2005-5-12
收藏
得分:0 

贴出来好一点..

2007-11-06 19:55
jbwang
Rank: 1
等 级:新手上路
帖 子:64
专家分:0
注 册:2007-5-22
收藏
得分:0 

给自己顶一下

2007-11-06 23:12
快速回复:[求助]初学XML,自己编写的一个小程序出了什么问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015163 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved