借助任何编程语言(例如asp.net和Java,html)创建XML [英] Create XML with help of any programming language (like asp.net and Java, html)

查看:73
本文介绍了借助任何编程语言(例如asp.net和Java,html)创建XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨Javed;

我在开发xml文件(index.xml)时遇到问题,请参见以下示例.我可以手动创建相同的文件,但是同一文件中的附件过多(即> 500).因此,我想借助编程语言来创建它.

示例:1(文件保存在路径:appn052254/0000/index.xml中)

< mydoc:mydoc xmlns:mydoc ="http://www.vish.net/mydoc" xmlns:xlink ="http://www.w3c.org/1999/xlink" dtd-version ="1.0">
< v1-行政信息>
< leaf id ="VP0000" operation ="new" checksum ="7f3cdjtac7fa166fc098ed55351f7c74" checksum-type ="MD5" xlink:href ="v1/data/my-first.pdf">
< title> MY文档模块1




请注意上面的example-1;我们可以看到第一时间将文件(operation ="new")上载到文档(index.xml)的元素之一.

示例:2(文件保存在路径:appn052254/0001/index.xml中)

< mydoc:mydoc xmlns:mydoc ="http://www.vish.net/mydoc" xmlns:xlink ="http://www.w3c.org/1999/xlink" dtd-version ="1.0">
< v1-行政信息>
<叶子id ="VP0001"操作=替换" modified-file ="../0000/my-first.pdf#VP0000" checksum-type ="MD5" checksum ="b78bf2c43c23c4856dd725efd5f633df" xlink:href ="v1/data/my-first.pdf>
< title> MY文档模块1




对于上面的example-2;修改了example-1(操作=替换")并创建了example-2,我们需要在index.xml中为新上传的pdf文件提供新的ID,校验和和属性[modified-file ="value"].请注意,在首次创建的index.xml文件中,修改文件属性不可用.

示例:3(文件保存在路径:appn052254/0002/index.xml中)

< mydoc:mydoc xmlns:mydoc ="http://www.vish.net/mydoc" xmlns:xlink ="http://www.w3c.org/1999/xlink" dtd-version ="1.0">
< v1-行政信息>
< leaf id ="VP0002" operation ="append" modified-file ="../0000/index.xml#VP0001" checksum-type ="MD5" checksum ="e311897074eb07d093fdd93c92c3f176" xlink:href ="v1/data/my-first.pdf>
< title> MY文档模块1




对于上面的示例3;修改了example-2(操作="append")并创建了example-3,我们需要在index.xml中为新上传的pdf文件提供新的ID,校验和和属性[modified-file ="value"]. />
另请注意,文件夹"v1"和"index.xml"文件保存在相同的文件夹"0000"或"0001"或"0002"或...中.
并在主文件夹"appn052254"中保存了相同的文件夹"0000"或"0001".
意思是:路径为:appn052254/0000/index.xml或appn052254/0000/v1
意思是:路径为:appn052254/0001/index.xml或appn052254/0001/v1
意思是:路径为:appn052254/0002/index.xml或appn052254/0002/v1

预先感谢,

请尽快给我答复.

Hi Javed;

I have problem with developing xml files(index.xml), please see the following example. I can able to create the same file mannually but there are too many attachment (i.e. >500) in the same file. so, i want to create that with help of programming langguage.

Example: 1 (file saved in the path :appn052254/0000/index.xml)

<mydoc:mydoc xmlns:mydoc="http://www.vish.net/mydoc" xmlns:xlink="http://www.w3c.org/1999/xlink" dtd-version="1.0">
<v1-administrative-information>
<leaf id="VP0000" operation="new" checksum="7f3cdjtac7fa166fc098ed55351f7c74" checksum-type="MD5" xlink:href="v1/data/my-first.pdf">
<title>MY Document Module 1




Please note that above example-1; we can see the one of the element for fist time uploaded file (operation="new") into the document(index.xml).

Example: 2 (file saved in the path :appn052254/0001/index.xml)

<mydoc:mydoc xmlns:mydoc="http://www.vish.net/mydoc" xmlns:xlink="http://www.w3c.org/1999/xlink" dtd-version="1.0">
<v1-administrative-information>
<leaf id="VP0001" operation="replace" modified-file="../0000/my-first.pdf#VP0000" checksum-type="MD5" checksum="b78bf2c43c23c4856dd725efd5f633df" xlink:href="v1/data/my-first.pdf">
<title>MY Document Module 1




For the above example-2; example-1 is modified (operation="replace") and create example-2 and we need to proive new ID, checksum and Attribute [modified-file="value"] for new uploaded pdf file in the index.xml. please note that modified-file Attribute is not available in the first time created index.xml file.

Example: 3 (file saved in the path :appn052254/0002/index.xml)

<mydoc:mydoc xmlns:mydoc="http://www.vish.net/mydoc" xmlns:xlink="http://www.w3c.org/1999/xlink" dtd-version="1.0">
<v1-administrative-information>
<leaf id="VP0002" operation="append" modified-file="../0000/index.xml#VP0001" checksum-type="MD5" checksum="e311897074eb07d093fdd93c92c3f176" xlink:href="v1/data/my-first.pdf">
<title>MY Document Module 1




for the above example-3; example-2 is modified (operation="append") and create example-3 and we need to proive new ID, checksum and Attribute [modified-file="value"] for new uploaded pdf file in the index.xml.

please also note that folders "v1" and "index.xml" files are saved in the same folder "0000" or "0001" or "0002" or....
and the same folder "0000" or "0001" saved in the main folder "appn052254".
Means: path is : appn052254/0000/index.xml or appn052254/0000/v1
Means: path is : appn052254/0001/index.xml or appn052254/0001/v1
Means: path is : appn052254/0002/index.xml or appn052254/0002/v1

Thanks in advance,

please give me reply as soon as possible.

推荐答案

我删除了您重复的问题. ASP.NET是用于创建网站的框架.它使用C#或VB.NET.它们都使用.NET框架,该框架包含用于编写XML的类.最明显使用的是XmlDocument,它符合文档对象模型(称为DOM).您需要使用子节点或属性或组合来创建自己的XML模式,这是最有意义的.

XML也是一个字符串,因此您可以只使用一个字符串构建器,这里有一个XML构建器类,我一直忘了它的名字,它使您可以流式传输XML并跟踪需要关闭的节点(您仍然需要说出何时关闭它们).
I deleted your duplicate question. ASP.NET is a framework for creating websites. It uses C#, or VB.NET. They both use the .NET framework, which contains classes for writing XML. The most obvious one to use, is XmlDocument, which conforms to the Document Object Model ( known as the DOM ). You need to create your own XML schema, using either child nodes, or attributes, or a combination, whatever makes the most sense.

XML is also just a string, so you could just use a string builder, there''s an XML builder class, whose name I always forget, that lets you stream XML and keeps track of the nodes that need to be closed ( you still need to say when to close them ).


不知道谁是Javed,但是您已经在上面重新发布了这个问题,所以我认为这个版本不需要回复.
No idea who Javed is, but you have reposted this question above, so I presume this version does not need a response.


这篇关于借助任何编程语言(例如asp.net和Java,html)创建XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆