Click here to Skip to main content
15,901,001 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

XML
<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>
Posted
Updated 23-Aug-10 8:29am
v4

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.
 
Share this answer
 
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.
 
Share this answer
 
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
<?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,
mehdi najafian
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900