如何编写以下XML文档? [英] How to write below XML documentation?

查看:78
本文介绍了如何编写以下XML文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个文档XML。我不知道用VB.NET在ASP.NET中编写这个文档。请帮帮我。



内容文件:



Hi,

I have a document XML. I don't know to write this document in ASP.NET with VB.NET. Please help me.

Content document:

<script type="text/javascript"></script>  
< xs:schema targetNamespace =" http://www.irica.com/ECE/1383-12/SendSchema " xmlns:irecetns =" http://www.irica.com/ECE/1383-12/SendSchema " xmlns =" http://www.irica.com/ECE/1383-12/SendSchema " xmlns:xs =" http://www.w3.org/2001/XMLSchema " elementFormDefault =" qualified " attributeFormDefault =" qualified " version =" 1.01 " >
 < xs:element name =" Letter " >
 < xs:complexType >
< xs:sequence >
 < xs:element name =" Protocol " nillable =" false " minOccurs =" 1 " maxOccurs =" 1 " >
 < xs:complexType >
  < xs:attribute name =" Name " type =" xs:string " use =" required " form =" unqualified " />
  < xs:attribute name =" Version " type =" xs:string " use =" required " form =" unqualified " />
  < xs:anyAttribute namespace =" ##any " processContents =" skip " />
  br mode="hold" />  br mode="hold" /> 
 < xs:element name =" OtherReceivers " nillable =" false " minOccurs =" 0 " maxOccurs =" 1 " >
 < xs:complexType >
 < xs:sequence >
 < xs:element name =" OtherReceiver " nillable =" false " minOccurs =" 0 " maxOccurs =" unbounded " >
 < xs:complexType >
  < xs:attribute name =" Organization " type =" xs:string " use =" required " form =" unqualified " />
  < xs:attribute name =" Department " type =" xs:string " use =" optional " form =" unqualified " />
  < xs:attribute name =" Position " type =" xs:string " use =" optional " form =" unqualified " />
  < xs:attribute name =" Name " type =" xs:string " use =" optional " form =" unqualified " />
  < xs:attribute name =" Code " type =" xs:string " use =" required " form =" unqualified " />
  < xs:attribute name =" ReceiveType " type =" irecetns:ReceiveType " use =" required " form =" unqualified " />
  < xs:anyAttribute namespace =" ##any " processContents =" skip " />
  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" /> < xs:element name =" RelatedLetterDateTime " nillable =" false " maxOccurs =" 1 " minOccurs =" 1 " >
 < xs:complexType >
 < xs:simpleContent >
 < xs:extension base =" xs:dateTime " >
  < xs:attribute name =" ShowAs " type =" irecetns:DateType " use =" required " form =" unqualified " />
  < xs:anyAttribute namespace =" ##any " processContents =" skip " />
  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" /> < xs:element name =" RelatedLetterSender " nillable =" false " maxOccurs =" 1 " minOccurs =" 1 " >
 < xs:complexType >
  < xs:attribute name =" Organization " type =" xs:string " use =" required " form =" unqualified " />
  < xs:attribute name =" Department " type =" xs:string " use =" optional " form =" unqualified " />
  < xs:attribute name =" Position " type =" xs:string " use =" optional " form =" unqualified " />
  < xs:attribute name =" Name " type =" xs:string " use =" optional " form =" unqualified " />
  < xs:attribute name =" Code " type =" xs:string " use =" required " form =" unqualified " />
  < xs:anyAttribute namespace =" ##any " processContents =" skip " />
  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" /> < xs:element name =" Subject " minOccurs =" 0 " maxOccurs =" 1 " nillable =" true " >
 < xs:complexType >
 < xs:simpleContent >
 < xs:extension base =" xs:string " >
  < xs:anyAttribute namespace =" ##any " processContents =" skip " />
  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" /> < xs:element name =" Priority " nillable =" false " maxOccurs =" 1 " minOccurs =" 1 " >
 < xs:complexType >
  < xs:attribute name =" Name " type =" xs:string " use =" required " form =" unqualified " />
  < xs:attribute name =" Code " type =" xs:string " use =" required " form =" unqualified " />
  < xs:anyAttribute namespace =" ##any " processContents =" skip " />
  br mode="hold" />  br mode="hold" /> < xs:element name =" Classification " nillable =" false " maxOccurs =" 1 " minOccurs =" 1 " >
 < xs:complexType >
  < xs:attribute name =" Name " type =" xs:string " use =" required " form =" unqualified " />
  < xs:attribute name =" Code " type =" xs:string " use =" required " form =" unqualified " />
  < xs:anyAttribute namespace =" ##any " processContents =" skip " />
  br mode="hold" />  br mode="hold" /> < xs:element name =" Keywords " nillable =" false " minOccurs =" 0 " maxOccurs =" 1 " >
< xs:complexType >
 < xs:sequence >
 < xs:element name =" Keyword " nillable =" false " minOccurs =" 0 " maxOccurs =" unbounded " >
 < xs:complexType >
 < xs:simpleContent >
- < xs:extension base =" xs:string " >
  < xs:anyAttribute namespace =" ##any " processContents =" skip " />
  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" /> < xs:element name =" Origins " nillable =" false " minOccurs =" 1 " maxOccurs =" 1 " >
 < xs:complexType >
 < xs:sequence >
 < xs:element name =" Origin " nillable =" false " maxOccurs =" unbounded " minOccurs =" 1 " >
 < xs:complexType >
 < xs:simpleContent >
 < xs:extension base =" xs:base64Binary " >
  < xs:attribute name =" ContentType " type =" irecetns:FileType " use =" required " form =" unqualified " />
  < xs:attribute name =" Extension " type =" xs:string " use =" optional " form =" unqualified " />
  < xs:attribute name =" Description " type =" xs:string " use =" optional " form =" unqualified " />
  < xs:anyAttribute namespace =" ##any " processContents =" skip " />
  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" /> < xs:element name =" Attachments " minOccurs =" 0 " maxOccurs =" 1 " nillable =" false " >
 < xs:complexType >
 < xs:sequence >
 < xs:element name =" Attachment " nillable =" true " minOccurs =" 0 " maxOccurs =" unbounded " >
 < xs:complexType >
 < xs:simpleContent >
 < xs:extension base =" xs:base64Binary " >
  < xs:attribute name =" ContentType " type =" xs:string " use =" required " form =" unqualified " />
  < xs:attribute name =" Extension " type =" xs:string " use =" optional " form =" unqualified " />
  < xs:attribute name =" Description " type =" xs:string " use =" optional " form =" unqualified " />
  < xs:anyAttribute namespace =" ##any " processContents =" skip " />
  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" />  br mode="hold" />  < xs:any namespace =" ##any " processContents =" lax " minOccurs =" 0 " maxOccurs =" unbounded " />
  br mode="hold" />  br mode="hold" />  br mode="hold" /> < xs:simpleType name =" FileType " >
 < xs:restriction base =" xs:string " >
  < xs:enumeration value =" image/jpeg " />
  < xs:enumeration value =" image/tiff " />
  < xs:enumeration value =" image/gif " />
  < xs:enumeration value =" image/png " />
  < xs:enumeration value =" application/msword " />
  < xs:enumeration value =" application/pdf " />
  < xs:enumeration value =" text/plain " />
  br mode="hold" />  br mode="hold" /> < xs:simpleType name =" DateType " >
 < xs:restriction base =" xs:string " >
  < xs:enumeration value =" gregorian " />
  < xs:enumeration value =" jalali " />
  < xs:enumeration value =" hijri " />
  br mode="hold" />  br mode="hold" /> < xs:simpleType name =" ReceiveType " >
 < xs:restriction base =" xs:string " >
  < xs:enumeration value =" Origin " />
  < xs:enumeration value =" Copy " />
  < xs:enumeration value =" Refer " />
  br mode="hold" />  br mode="hold" />  /xml>

推荐答案

You mean how to create the XML file ? ASP.NET has NO XML support, this is a general .NET question, C# or VB.NET. I would suggest that the best way to create this document may well be to use an XSLT transform, depending on what your source data is, I assume you’re filling this document with data based on different inputs ? Otherwise there’s no reason you can’t use an XmlTextWriter or even string mash it. It’s just text, at the end of the day.
You mean how to create the XML file ? ASP.NET has NO XML support, this is a general .NET question, C# or VB.NET. I would suggest that the best way to create this document may well be to use an XSLT transform, depending on what your source data is, I assume you're filling this document with data based on different inputs ? Otherwise there's no reason you can't use an XmlTextWriter or even string mash it. It's just text, at the end of the day.


I think you are not looking at any xml, its the XML schema definition that you have just placed here.



Why dont you use Linq to XML ?

There is probably the easiest way to do this using LINQ.

Check how I produced XML with schema in my Resource Generator tool :



http://www.abhisheksur.com/2010/06/resource-generator-tool.html[^]



This should help you.
I think you are not looking at any xml, its the XML schema definition that you have just placed here.

Why dont you use Linq to XML ?
There is probably the easiest way to do this using LINQ.
Check how I produced XML with schema in my Resource Generator tool :

http://www.abhisheksur.com/2010/06/resource-generator-tool.html[^]

This should help you.


I Worked with this type of XML.This is a ECE which is the standard protocol for transfering email entra-organization. I made ECE Software for Some Company. The XML sample for that is like below:

I Worked with this type of XML.This is a ECE which is the standard protocol for transfering email entra-organization. I made ECE Software for Some Company. The XML sample for that is like below:
<?xml version="1.0" encoding="UTF-8"?>
   <Letter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file://ECE_Send_ver1.01.xsd">
         <Protocol Name="test attribute" Version="test attribute">test string</Protocol>
         <Software>test string</Software>
         <Sender Organization="test attribute" Department="test attribute" Position="test attribute" Name="test attribute" Code="test attribute">test string</Sender>
         <Receiver Organization="test attribute" Department="test attribute" Position="test attribute" Name="test attribute" Code="test attribute" ReceiveType="test attribute">test string</Receiver>
         <OtherReceivers>
               <OtherReceiver Organization="test attribute" Department="test attribute" Position="test attribute" Name="test attribute" Code="test attribute" ReceiveType="test attribute">test string</OtherReceiver>
               <OtherReceiver Organization="test attribute" Department="test attribute" Position="test attribute" Name="test attribute" Code="test attribute" ReceiveType="test attribute">test string</OtherReceiver>
               <OtherReceiver Organization="test attribute" Department="test attribute" Position="test attribute" Name="test attribute" Code="test attribute" ReceiveType="test attribute">test string</OtherReceiver>
         </OtherReceivers>
         <LetterNo>test string</LetterNo>
         <LetterDateTime>test string</LetterDateTime>
         <RelatedLetters>
               <RelatedLetter>test string</RelatedLetter>
               <RelatedLetter>test string</RelatedLetter>
               <RelatedLetter>test string</RelatedLetter>
         </RelatedLetters>
         <Subject>test string</Subject>
         <Priority Name="test attribute" Code="test attribute">test string</Priority>
         <Classification Name="test attribute" Code="test attribute">test string</Classification>
         <Keywords>
               <Keyword>test string</Keyword>
               <Keyword>test string</Keyword>
               <Keyword>test string</Keyword>
         </Keywords>
         <Origins>
               <Origin>test string</Origin>
               <Origin>test string</Origin>
               <Origin>test string</Origin>
         </Origins>
         <Attachments>
               <Attachment>test string</Attachment>
               <Attachment>test string</Attachment>
               <Attachment>test string</Attachment>
         </Attachments>
   </Letter>



Sincerely Yours,
$b $b mehdi najafian


Sincerely Yours,
mehdi najafian


这篇关于如何编写以下XML文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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