php将xml转html工具类,使用xlst将xml转换html的示例代码

xml文件

Time

="2008-1-28 09:00" Time="120" ScoreValue="100" Score="0">

Count

="1" Score="0">

if

ficulty="1" ScoreValue="20" Score="0">

诸葛亮姓什么?

Key

="1">诸

诸葛

诸葛亮

2

三国是指那三国?

魏国

吴国

辽国

蜀国

1,2,4

刘备建立了蜀国?

0

1

1

三国里的五虎上将是指关羽,$_4.1_$,$_4.2_$,$_4.3_$,赵云。

]]>

张飞

魏延

马超

为什么诸葛亮没能统一三国?

因为魏国统一了三国。

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

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

for

m"

xmlns:msxsl="urn:schemas-microsoft-com:xslt"

xmlns:rules="http://www.netguy.cn/xslt"

exclude-result-prefixes="rules msxsl">

uage="

C#

">

public

static

string

ChangeTextBox(string content)

{

// Define a regular expression for repeated w

ord

s.

Regex rx =

new

Regex(@"\$_\S\S\S_\$",

RegexOptions.Compiled | RegexOptions.IgnoreCase);

// Find matches.

MatchCollection matches = rx.Matches(content);

// Report on

each

match.

foreach

(Match match in matches)

{

string word = match.Value;

content=content.Replace(word,"

Substr

ing(2,word.Length-4)+"\" type=\"text\">");

}

return

content;

}

]]>

<

head

>

姓名:

学号:

开考时间:

时间:

总分:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值