如何把有规律的备注存到XML中

jiaxianglei 2009-05-15 09:50:57
备注(paperRule)如下:
version=1
ruleCount=3
bigType0=低压电工作业
scorePerQuestion0=48
questionType0=多选题
qty0=2
difficulty0=0
bigType1=低压电工作业
scorePerQuestion1=1
questionType1=选择题
qty1=2
difficulty1=0
bigType2=低压电工作业
scorePerQuestion2=1
questionType2=判断题
qty2=2
difficulty2=0
ruleCount为条目数,如果为3,则继续累加:bigType2...
...全文
101 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
shenzhenNBA 2009-05-15
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 jiaxianglei 的回复:]
如何存为下面的格式,并保存为XML文件:
<?xml version="1.0" encoding="gb2312"?>
<root ruleCount=3>
<rule>
<bigType>低压电工作业 </bigType>
<scorePerQuestion>48 </scorePerQuestion>
<questionType>多选题 </questionType>
<qty>2 </qty>
<difficulty>0 </difficulty>
</rule>
<rule>
<bigType>低压电工作业 </bigType>
<scorePerQuestion>1 </scorePerQuestion>
<questionType>选择题 </ques…
[/Quote]

<%
获取相关的数据和建立相关对象并连接到XML文件先
...
set newNode=objXML.createElement("name") '1,create new node: name
newNode.text=username '2,set the value of new node
objXML.documentElement.appendChild .appendChild newNode 'add new none to XML file
...
%>

循环这个过程就可以把节点字节点添加到XML文件中
jiaxianglei 2009-05-15
  • 打赏
  • 举报
回复
能写详细点吗?我不太懂,谢谢。
shenzhenNBA 2009-05-15
  • 打赏
  • 举报
回复
如何把有规律的备注存到XML中 ? 那不是把数据保存进XML节点吗?

asp中简要的如下

<%
...
set newNode=objXML.createElement("name") '1,create new node: name
newNode.text=username '2,set the value of new node
objXML.documentElement.appendChild .appendChild newNode 'add new none to XML file
...


%>
jiaxianglei 2009-05-15
  • 打赏
  • 举报
回复
如何存为下面的格式,并保存为XML文件:
<?xml version="1.0" encoding="gb2312"?>
<root ruleCount=3>
<rule>
<bigType>低压电工作业</bigType>
<scorePerQuestion>48 </scorePerQuestion>
<questionType>多选题 </questionType>
<qty>2 </qty>
<difficulty>0 </difficulty>
</rule>
<rule>
<bigType>低压电工作业 </bigType>
<scorePerQuestion>1</scorePerQuestion>
<questionType>选择题 </questionType>
<qty>2 </qty>
<difficulty>0 </difficulty>
</rule>
<rule>
<bigType>低压电工作业 </bigType>
<scorePerQuestion>1</scorePerQuestion>
<questionType>低压电工作业 </questionType>
<qty>1 </qty>
<difficulty>0 </difficulty>
</rule>
</root>
xiaojing7 2009-05-15
  • 打赏
  • 举报
回复
搜索下ASP这么保持XML数据的不就搞定了

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧