Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / WinForms, .Net Framework [игнор отключен] [закрыт для гостей] / Правильно прочитать xml / 21 сообщений из 21, страница 1 из 1
28.10.2013, 12:47
    #38443318
Tanya_0306
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
Имеется xml документ такой структуры

Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
<?xml version="1.0"?>
<!--Date of Landing:10/28/2013 2:41:06 PM-->
<FileSharing>
  <Conversion>
    <Table Name="Clients">
      <Record>
        <Id Value="A" />
        <Client Value="A" />
        <Identifier Value="11111111" />
      </Record>
    </Table>
    <Table Name="Companies">
      <Record>
        < Id Value="B" />
        <Company Value="B" />
        <Prefix Value="TY" />
      </Record>
    </Table>
    <Table Name="Currencies" />
    <Table Name="Measurements">
      <Record>
        <Id Value="%" />
        <Measurement Value="percentage" />
        <Scale Value="1.000" />
      </Record>
    </Table>
    <Table Name="Nomenclature">
      <Record>
        <Id Value="1" />
        <Nomenclature Value="1111" />
        <Measurement Объект.ССылка ="%" Value="%" />
      </Record>
    </Table>
    <Table Name="Contracts">
      <Record>
        <Id Value="106" />
        <Contract Value="1" />
        <Number Value="1" />
        <Dt Value="10/22/2013 12:00:00 AM" />
        <Client Value="A" />
        <Company Value="B" />
        <Table Name="Qualities">
          <Record>
            <Contract Объект.ССылка ="106" Value="106" />
          </Record>
        </Table>
        <Table Name="Volumes">
          <Record>
            <Contract Объект.ССылка ="106" Value="106" />
          </Record>
          <Record>
            <Contract Объект.ССылка ="106" Value="106" />
          </Record>
        </Table>
      </Record>
    </Table>
  </Conversion>
</FileSharing>



Как правильно "собрать" данные из тега Record ? необходимо из этой информации получить строку для записи в базу. Имя таблицы атрибут Name, имя реквизита - имя элемента, значение элемента - атрибут value.
...
Рейтинг: 0 / 0
28.10.2013, 12:56
    #38443341
Arm79
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
XPathNavigator

/FileSharing/Table/Record
или можно проще: //Record
...
Рейтинг: 0 / 0
28.10.2013, 12:57
    #38443344
Arm79
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
Правда я бы все таки попробовал вначале десериализацию в список объектов.
...
Рейтинг: 0 / 0
28.10.2013, 13:22
    #38443408
МСУ
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
Arm79Правда я бы все таки попробовал вначале десериализацию в список объектов.
+1
...
Рейтинг: 0 / 0
28.10.2013, 13:33
    #38443435
Tanya_0306
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
Arm79,

не могу понять десериализацию... как ее к файл xml. Буду очень признательна если не отошлете mdsn и на моем примере объясните.
...
Рейтинг: 0 / 0
28.10.2013, 14:01
    #38443482
Tanya_0306
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
Для десериализации мне каждую таблицу моей базы надо прописать как класс?
...
Рейтинг: 0 / 0
28.10.2013, 14:10
    #38443503
МСУ
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
...
Рейтинг: 0 / 0
28.10.2013, 14:16
    #38443512
Arm79
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
Tanya_0306,

Нет. К сожалению, вы полезли в XML предварительно не продумав его структуру. XSD было бы очень кстати. Почему у вас в Table могут быть вложены другие table?

Я особо не заморачивался, для примера это и не нужно.

Взял ваш XML и из студии сгенерировал для него XSD (меню XML/CreateSchema)

автосгенерированная xsd
Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="FileSharing">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Conversion">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" name="Table">
                <xs:complexType>
                  <xs:sequence minOccurs="0">
                    <xs:element name="Record">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:choice maxOccurs="unbounded">
                            <xs:element name="Id">
                              <xs:complexType>
                                <xs:attribute name="Value" type="xs:string" use="required" />
                              </xs:complexType>
                            </xs:element>
                            <xs:element name="Contract">
                              <xs:complexType>
                                <xs:attribute name="Value" type="xs:unsignedByte" use="required" />
                              </xs:complexType>
                            </xs:element>
                            <xs:element name="Number">
                              <xs:complexType>
                                <xs:attribute name="Value" type="xs:unsignedByte" use="required" />
                              </xs:complexType>
                            </xs:element>
                            <xs:element name="Dt">
                              <xs:complexType>
                                <xs:attribute name="Value" type="xs:string" use="required" />
                              </xs:complexType>
                            </xs:element>
                            <xs:element name="Nomenclature">
                              <xs:complexType>
                                <xs:attribute name="Value" type="xs:unsignedShort" use="required" />
                              </xs:complexType>
                            </xs:element>
                            <xs:element name="Measurement">
                              <xs:complexType>
                                <xs:attribute name="Value" type="xs:string" use="required" />
                                <xs:attribute name="Объект.ССылка" type="xs:string" use="optional" />
                              </xs:complexType>
                            </xs:element>
                            <xs:element name="Scale">
                              <xs:complexType>
                                <xs:attribute name="Value" type="xs:decimal" use="required" />
                              </xs:complexType>
                            </xs:element>
                            <xs:element name="Company">
                              <xs:complexType>
                                <xs:attribute name="Value" type="xs:string" use="required" />
                              </xs:complexType>
                            </xs:element>
                            <xs:element name="Prefix">
                              <xs:complexType>
                                <xs:attribute name="Value" type="xs:string" use="required" />
                              </xs:complexType>
                            </xs:element>
                            <xs:element name="Client">
                              <xs:complexType>
                                <xs:attribute name="Value" type="xs:string" use="required" />
                              </xs:complexType>
                            </xs:element>
                            <xs:element name="Identifier">
                              <xs:complexType>
                                <xs:attribute name="Value" type="xs:unsignedInt" use="required" />
                              </xs:complexType>
                            </xs:element>
                            <xs:element name="Table">
                              <xs:complexType>
                                <xs:sequence>
                                  <xs:element maxOccurs="unbounded" name="Record">
                                    <xs:complexType>
                                      <xs:sequence>
                                        <xs:element name="Contract">
                                          <xs:complexType>
                                            <xs:attribute name="Объект.ССылка" type="xs:unsignedByte" use="required" />
                                            <xs:attribute name="Value" type="xs:unsignedByte" use="required" />
                                          </xs:complexType>
                                        </xs:element>
                                      </xs:sequence>
                                    </xs:complexType>
                                  </xs:element>
                                </xs:sequence>
                                <xs:attribute name="Name" type="xs:string" use="required" />
                              </xs:complexType>
                            </xs:element>
                          </xs:choice>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="Name" type="xs:string" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>




Далее, утилитой xsd.exe (запускал через C:\Windows\System32\cmd.exe /E:ON /V:ON /T:0E /K "C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\SetEnv.cmd") сгенерировал классы для неё (xsd.exe ФАЙЛ.xml /c /out:КУДА_ВЫКЛАДЫВАТЬ_ФАЙЛ)

автосгенерированные классы
Код: c#
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
321.
322.
323.
324.
325.
326.
327.
328.
329.
330.
331.
332.
333.
334.
335.
336.
337.
338.
339.
340.
341.
342.
343.
344.
345.
346.
347.
348.
349.
350.
351.
352.
353.
354.
355.
356.
357.
358.
359.
360.
361.
362.
363.
364.
365.
366.
367.
368.
369.
370.
371.
372.
373.
374.
375.
376.
377.
378.
379.
380.
381.
382.
383.
384.
385.
386.
387.
388.
389.
390.
391.
392.
393.
394.
395.
396.
397.
398.
399.
400.
401.
402.
403.
404.
405.
406.
407.
408.
409.
410.
411.
412.
413.
414.
415.
416.
417.
418.
419.
420.
421.
422.
423.
424.
425.
426.
427.
428.
429.
430.
431.
432.
433.
434.
435.
436.
437.
438.
439.
440.
441.
442.
443.
444.
445.
446.
447.
448.
449.
450.
451.
452.
//------------------------------------------------------------------------------
// <auto-generated>
//     Этот код создан программой.
//     Исполняемая версия:2.0.50727.5472
//
//     Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
//     повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------

using System.Xml.Serialization;

// 
// This source code was auto-generated by xsd, Version=2.0.50727.3038.
// 


/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
public partial class FileSharing {
    
    private FileSharingTable[] conversionField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlArrayItemAttribute("Table", IsNullable=false)]
    public FileSharingTable[] Conversion {
        get {
            return this.conversionField;
        }
        set {
            this.conversionField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class FileSharingTable {
    
    private FileSharingTableRecord recordField;
    
    private string nameField;
    
    /// <remarks/>
    public FileSharingTableRecord Record {
        get {
            return this.recordField;
        }
        set {
            this.recordField = value;
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string Name {
        get {
            return this.nameField;
        }
        set {
            this.nameField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class FileSharingTableRecord {
    
    private object[] itemsField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("Client", typeof(FileSharingTableRecordClient))]
    [System.Xml.Serialization.XmlElementAttribute("Company", typeof(FileSharingTableRecordCompany))]
    [System.Xml.Serialization.XmlElementAttribute("Contract", typeof(FileSharingTableRecordContract))]
    [System.Xml.Serialization.XmlElementAttribute("Dt", typeof(FileSharingTableRecordDT))]
    [System.Xml.Serialization.XmlElementAttribute("Id", typeof(FileSharingTableRecordID))]
    [System.Xml.Serialization.XmlElementAttribute("Identifier", typeof(FileSharingTableRecordIdentifier))]
    [System.Xml.Serialization.XmlElementAttribute("Measurement", typeof(FileSharingTableRecordMeasurement))]
    [System.Xml.Serialization.XmlElementAttribute("Nomenclature", typeof(FileSharingTableRecordNomenclature))]
    [System.Xml.Serialization.XmlElementAttribute("Number", typeof(FileSharingTableRecordNumber))]
    [System.Xml.Serialization.XmlElementAttribute("Prefix", typeof(FileSharingTableRecordPrefix))]
    [System.Xml.Serialization.XmlElementAttribute("Scale", typeof(FileSharingTableRecordScale))]
    [System.Xml.Serialization.XmlElementAttribute("Table", typeof(FileSharingTableRecordTable))]
    public object[] Items {
        get {
            return this.itemsField;
        }
        set {
            this.itemsField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class FileSharingTableRecordClient {
    
    private string valueField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string Value {
        get {
            return this.valueField;
        }
        set {
            this.valueField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class FileSharingTableRecordCompany {
    
    private string valueField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string Value {
        get {
            return this.valueField;
        }
        set {
            this.valueField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class FileSharingTableRecordContract {
    
    private byte valueField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public byte Value {
        get {
            return this.valueField;
        }
        set {
            this.valueField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class FileSharingTableRecordDT {
    
    private string valueField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string Value {
        get {
            return this.valueField;
        }
        set {
            this.valueField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class FileSharingTableRecordID {
    
    private string valueField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string Value {
        get {
            return this.valueField;
        }
        set {
            this.valueField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class FileSharingTableRecordIdentifier {
    
    private uint valueField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public uint Value {
        get {
            return this.valueField;
        }
        set {
            this.valueField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class FileSharingTableRecordMeasurement {
    
    private string valueField;
    
    private string объектССылкаField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string Value {
        get {
            return this.valueField;
        }
        set {
            this.valueField = value;
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute("Объект.ССылка")]
    public string ОбъектССылка {
        get {
            return this.объектССылкаField;
        }
        set {
            this.объектССылкаField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class FileSharingTableRecordNomenclature {
    
    private ushort valueField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public ushort Value {
        get {
            return this.valueField;
        }
        set {
            this.valueField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class FileSharingTableRecordNumber {
    
    private byte valueField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public byte Value {
        get {
            return this.valueField;
        }
        set {
            this.valueField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class FileSharingTableRecordPrefix {
    
    private string valueField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string Value {
        get {
            return this.valueField;
        }
        set {
            this.valueField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class FileSharingTableRecordScale {
    
    private decimal valueField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public decimal Value {
        get {
            return this.valueField;
        }
        set {
            this.valueField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class FileSharingTableRecordTable {
    
    private FileSharingTableRecordTableRecord[] recordField;
    
    private string nameField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("Record")]
    public FileSharingTableRecordTableRecord[] Record {
        get {
            return this.recordField;
        }
        set {
            this.recordField = value;
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string Name {
        get {
            return this.nameField;
        }
        set {
            this.nameField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class FileSharingTableRecordTableRecord {
    
    private FileSharingTableRecordTableRecordContract contractField;
    
    /// <remarks/>
    public FileSharingTableRecordTableRecordContract Contract {
        get {
            return this.contractField;
        }
        set {
            this.contractField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class FileSharingTableRecordTableRecordContract {
    
    private byte объектССылкаField;
    
    private byte valueField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute("Объект.ССылка")]
    public byte ОбъектССылка {
        get {
            return this.объектССылкаField;
        }
        set {
            this.объектССылкаField = value;
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public byte Value {
        get {
            return this.valueField;
        }
        set {
            this.valueField = value;
        }
    }
}




эти классы приложил к проекту
Сама десериализация до боли проста

Код: c#
1.
2.
3.
4.
5.
6.
7.
8.
9.
        static void Main(string[] args)
        {
            XmlSerializer ser  = new XmlSerializer(typeof(FileSharing));

            using (var fs = new FileStream(@"XmlData.xml", FileMode.Open, FileAccess.Read, FileShare.Read))
            {
                FileSharing sharing = (FileSharing) ser.Deserialize(fs);
            }
        }
...
Рейтинг: 0 / 0
28.10.2013, 14:21
    #38443523
Arm79
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
Tanya_0306,

Вот пример ручной реализации иерархического XML с десериализацией (но там естественно, структура продумана)
http://stackoverflow.com/questions/13470446/correct-deserializing-of-hierarchical-xml
...
Рейтинг: 0 / 0
28.10.2013, 14:40
    #38443565
МСУ
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
Arm79Tanya_0306, Почему у вас в Table могут быть вложены другие table?
Каким образом?
...
Рейтинг: 0 / 0
28.10.2013, 14:42
    #38443570
Arm79
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
МСУArm79Tanya_0306, Почему у вас в Table могут быть вложены другие table?
Каким образом?

Не знаю :-)

вот:
Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
    <Table Name="Contracts">
      <Record>
        <Id Value="106" />
        <Contract Value="1" />
        <Number Value="1" />
        <Dt Value="10/22/2013 12:00:00 AM" />
        <Client Value="A" />
        <Company Value="B" />
        <Table Name="Qualities">
          <Record>
            <Contract Объект.ССылка ="106" Value="106" />
          </Record>
        </Table>
        <Table Name="Volumes">
          <Record>
            <Contract Объект.ССылка ="106" Value="106" />
          </Record>
          <Record>
            <Contract Объект.ССылка ="106" Value="106" />
          </Record>
        </Table>
      </Record>
    </Table>
...
Рейтинг: 0 / 0
28.10.2013, 14:44
    #38443573
Tanya_0306
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
Arm79,

Тable может быть в Table - это вложенная таблица так прописана.
...
Рейтинг: 0 / 0
28.10.2013, 14:51
    #38443592
Arm79
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
Tanya_0306Arm79,

Тable может быть в Table - это вложенная таблица так прописана.

Тогда я советую по образцу и подобию сделать свои классы. Если есть знания схем XML, то лучше сначала с них. Если нет, то кодить

Что то вроде иерархии:
Контейнер (FileSharing) содержит коллекцию таблиц.
Каждая таблица может содержать коллекцию строк
Каждая строка может содержать коллекцию полей, где поле - это наименование, тип, значение и коллекцию Таблиц (см. предыдущий пункт)
...
Рейтинг: 0 / 0
28.10.2013, 15:24
    #38443656
Tanya_0306
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
Arm79,

знание xml схем пока нет ...
попробую проэксперементировать как в примере с " ручной реализации иерархического XML с десериализацией ".
Прописать все таблицы, поля.
А потом десериализованный объект как записать в базу?
...
Рейтинг: 0 / 0
28.10.2013, 15:27
    #38443664
Arm79
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
Tanya_0306Прописать все таблицы, поля.

Очень плохо смотрите. Не надо реализовывать ВСЕ Таблицы и ВСЕ поля

1 - контейнер
1 - таблица
1 - поле

всего три класса. Может, потребуется несколько больше, но никак не ОДНА ТАБЛИЦА = ОДИН КЛАСС
...
Рейтинг: 0 / 0
28.10.2013, 15:28
    #38443666
МСУ
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
Arm79Не знаю :-) вот ...
Вот не надо юлить, ты же и сам понимаешь, что это будет другая схема :)
...
Рейтинг: 0 / 0
28.10.2013, 15:31
    #38443672
МСУ
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
...
Рейтинг: 0 / 0
28.10.2013, 15:36
    #38443683
Arm79
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
МСУArm79Не знаю :-) вот ...
Вот не надо юлить, ты же и сам понимаешь, что это будет другая схема :)
Я не юлю. Написал же, в качестве схемы взял автоматически сгенерированную. По хорошему нужно писать схему самому.

Собственно, про свою схему и их чего она состоит - я уже написал.
...
Рейтинг: 0 / 0
28.10.2013, 16:17
    #38443763
Arm79
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
Tanya_0306,

вот, наваял на скорую руку

пример документа
Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
<?xml version="1.0" encoding="utf-8" ?>

<FileSharing xmlns="http://tempuri.org/Test.xsd">
  <Table Name="Table1">
    <Row>
      <Field Name="Id" Type="Int16" Value="1"/>
      <Field Name="Txt" Type="String" Value="qwerty"/>
    </Row>
  </Table>
  <Table Name="Table2">
    <Row>
      <Field Name="a" Type="String"/>
      <Field Name="b" Type="Int16" Value="2"/>
      <Field Name="c" Type="Int32" Value="3"/>
      <Table Name="Table2.Table1">
        <Row>
          <Field Name="d" Type="String" Value="qwerty"/>
          <Field Name="e" Type="Int32" Value="4"/>
          <Table Name="Table2.Table1.Table1">
            <Row>
              <Field Name="f" Type="String" />
              <Field Name="g" Type="Int32" Value="5"/>
            </Row>
          </Table>
        </Row>
      </Table>
    </Row>
  </Table>
</FileSharing>




схема для документа
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Test"
targetNamespace=" http://tempuri.org/Test.xsd"
elementFormDefault="qualified"
xmlns=" http://tempuri.org/Test.xsd"
xmlns:mstns=" http://tempuri.org/Test.xsd"
xmlns:xs=" http://www.w3.org/2001/XMLSchema"
>
<xs:simpleType name="Types">
<xs:restriction base="xs:string">
<xs:enumeration id="DateTime" value="DateTime" />
<xs:enumeration id="String" value="String" />
<xs:enumeration id="Int16" value="Int16" />
<xs:enumeration id="Int32" value="Int32" />
<xs:enumeration id="Int64" value="Int64" />
</xs:restriction>
</xs:simpleType>

<xs:complexType name="Field">
<xs:attribute name="Type" type="Types" use="required" />
<xs:attribute name="Name" type="xs:string" use="required"/>
<xs:attribute name="Value" type="xs:string" use="optional"/>
</xs:complexType>

<xs:complexType name="SimpleRow">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="Field" type="Field" />
</xs:sequence>
</xs:complexType>

<xs:complexType name="ComplexRow">
<xs:complexContent>
<xs:extension base="SimpleRow">
<xs:sequence>
<xs:element name="Table" minOccurs="0" maxOccurs="unbounded" type="Table" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="Table">
<xs:sequence>
<xs:element name="Row" type="ComplexRow" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="Name" type="xs:string" use="required" />
</xs:complexType>

<xs:complexType name="FileSharing">
<xs:sequence>
<xs:sequence>
<xs:element name="Table" type="Table" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:sequence>
</xs:complexType>

<xs:element name="FileSharing" type="FileSharing"/>

</xs:schema>


сгенерированные классы
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:2.0.50727.5472
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------

using System.Xml.Serialization;

//
// This source code was auto-generated by xsd, Version=2.0.50727.3038.
//


/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace=" http://tempuri.org/Test.xsd%22)%5D]http://tempuri.org/Test.xsd")]
[System.Xml.Serialization.XmlRootAttribute(Namespace=" http://tempuri.org/Test.xsd", IsNullable=false)]
public partial class FileSharing {

private Table[] tableField;

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Table")]
public Table[] Table {
get {
return this.tableField;
}
set {
this.tableField = value;
}
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace=" http://tempuri.org/Test.xsd%22)%5D]http://tempuri.org/Test.xsd")]
public partial class Table {

private ComplexRow[] rowField;

private string nameField;

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Row")]
public ComplexRow[] Row {
get {
return this.rowField;
}
set {
this.rowField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Name {
get {
return this.nameField;
}
set {
this.nameField = value;
}
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace=" http://tempuri.org/Test.xsd%22)%5D]http://tempuri.org/Test.xsd")]
public partial class ComplexRow : SimpleRow {

private Table[] tableField;

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Table")]
public Table[] Table {
get {
return this.tableField;
}
set {
this.tableField = value;
}
}
}

/// <remarks/>
[System.Xml.Serialization.XmlIncludeAttribute(typeof(ComplexRow))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace=" http://tempuri.org/Test.xsd%22)%5D]http://tempuri.org/Test.xsd")]
public partial class SimpleRow {

private Field[] fieldField;

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Field")]
public Field[] Field {
get {
return this.fieldField;
}
set {
this.fieldField = value;
}
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace=" http://tempuri.org/Test.xsd%22)%5D]http://tempuri.org/Test.xsd")]
public partial class Field {

private Types typeField;

private string nameField;

private string valueField;

/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public Types Type {
get {
return this.typeField;
}
set {
this.typeField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Name {
get {
return this.nameField;
}
set {
this.nameField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Value {
get {
return this.valueField;
}
set {
this.valueField = value;
}
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace=" http://tempuri.org/Test.xsd%22)%5D]http://tempuri.org/Test.xsd")]
public enum Types {

/// <remarks/>
DateTime,

/// <remarks/>
String,

/// <remarks/>
Int16,

/// <remarks/>
Int32,

/// <remarks/>
Int64,
}
...
Рейтинг: 0 / 0
28.10.2013, 16:20
    #38443773
Arm79
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
Arm79,

отформатированное:

схема
Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Test"
    targetNamespace="http://tempuri.org/Test.xsd"
    elementFormDefault="qualified"
    xmlns="http://tempuri.org/Test.xsd"
    xmlns:mstns="http://tempuri.org/Test.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
  <xs:simpleType name="Types">
    <xs:restriction base="xs:string">
      <xs:enumeration id="DateTime" value="DateTime" />
      <xs:enumeration id="String" value="String" />
      <xs:enumeration id="Int16" value="Int16" />
      <xs:enumeration id="Int32" value="Int32" />
      <xs:enumeration id="Int64" value="Int64" />
    </xs:restriction>
  </xs:simpleType>
  
  <xs:complexType name="Field">
    <xs:attribute name="Type" type="Types" use="required" />
    <xs:attribute name="Name" type="xs:string" use="required"/>
    <xs:attribute name="Value" type="xs:string" use="optional"/>
  </xs:complexType>

  <xs:complexType name="SimpleRow">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Field" type="Field" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ComplexRow">
    <xs:complexContent>
      <xs:extension base="SimpleRow">
        <xs:sequence>
          <xs:element name="Table" minOccurs="0" maxOccurs="unbounded" type="Table" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Table">
    <xs:sequence>
      <xs:element name="Row" type="ComplexRow" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:attribute name="Name" type="xs:string" use="required" />
  </xs:complexType>

  <xs:complexType name="FileSharing">
    <xs:sequence>
      <xs:element name="Table" type="Table" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  
  <xs:element name="FileSharing" type="FileSharing"/>
  
</xs:schema>



классы от xsd.exe
Код: c#
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
//------------------------------------------------------------------------------
// <auto-generated>
//     Этот код создан программой.
//     Исполняемая версия:2.0.50727.5472
//
//     Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
//     повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------

using System.Xml.Serialization;

// 
// This source code was auto-generated by xsd, Version=2.0.50727.3038.
// 


/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/Test.xsd")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://tempuri.org/Test.xsd", IsNullable=false)]
public partial class FileSharing {
    
    private Table[] tableField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("Table")]
    public Table[] Table {
        get {
            return this.tableField;
        }
        set {
            this.tableField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/Test.xsd")]
public partial class Table {
    
    private ComplexRow[] rowField;
    
    private string nameField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("Row")]
    public ComplexRow[] Row {
        get {
            return this.rowField;
        }
        set {
            this.rowField = value;
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string Name {
        get {
            return this.nameField;
        }
        set {
            this.nameField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/Test.xsd")]
public partial class ComplexRow : SimpleRow {
    
    private Table[] tableField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("Table")]
    public Table[] Table {
        get {
            return this.tableField;
        }
        set {
            this.tableField = value;
        }
    }
}

/// <remarks/>
[System.Xml.Serialization.XmlIncludeAttribute(typeof(ComplexRow))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/Test.xsd")]
public partial class SimpleRow {
    
    private Field[] fieldField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("Field")]
    public Field[] Field {
        get {
            return this.fieldField;
        }
        set {
            this.fieldField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/Test.xsd")]
public partial class Field {
    
    private Types typeField;
    
    private string nameField;
    
    private string valueField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public Types Type {
        get {
            return this.typeField;
        }
        set {
            this.typeField = value;
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string Name {
        get {
            return this.nameField;
        }
        set {
            this.nameField = value;
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string Value {
        get {
            return this.valueField;
        }
        set {
            this.valueField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/Test.xsd")]
public enum Types {
    
    /// <remarks/>
    DateTime,
    
    /// <remarks/>
    String,
    
    /// <remarks/>
    Int16,
    
    /// <remarks/>
    Int32,
    
    /// <remarks/>
    Int64,
}

...
Рейтинг: 0 / 0
29.10.2013, 10:19
    #38444513
Tanya_0306
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Правильно прочитать xml
Arm79,

Спасибо за помощь!
...
Рейтинг: 0 / 0
Форумы / WinForms, .Net Framework [игнор отключен] [закрыт для гостей] / Правильно прочитать xml / 21 сообщений из 21, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]