У меня есть такой XML-код:
<case>
<tab tabdescription="text here">
<subtab subtab_description="subtab description here" subttab_text="subtab text here" />
<subtab subtab_description="subtab description here" subttab_text="subtab text here" />
<subtab subtab_description="subtab description here" subttab_text="subtab text here" />
</tab>
<tab tabdescription="text here">
<subtab subtab_description="subtab description here" subttab_text="subtab text here" />
<subtab subtab_description="subtab description here" subttab_text="subtab text here" />
<subtab subtab_description="subtab description here" subttab_text="subtab text here" />
</tab>
<tab tabdescription="text here">
<subtab subtab_description="subtab description here" subttab_text="subtab text here" />
<subtab subtab_description="subtab description here" subttab_text="subtab text here" />
<subtab subtab_description="subtab description here" subttab_text="subtab text here" />
</tab>
<exhibit exhibitdescription="exhibit description here">
<exhibitfilename>FileName.File</exhibitfilename />
</exhibit>
<exhibit exhibitdescription="exhibit description here">
<exhibitfilename>FileName.File</exhibitfilename />
</exhibit>`
<exhibit exhibitdescription="exhibit description here">
<exhibitfilename>FileName.File</exhibitfilename />
</exhibit>
</case>
В моем коде c # у меня есть объект табуляции, который содержит свойство tabdescription и объекты List <subtab>
, а объект subtab содержит свойство subtabdescription исвойство подтаблицы.У меня также есть объект экспоната с описаниями экспонатов и свойствами файла-экспоната.
Мне нужно заполнить эти объекты, чтобы по окончании у меня было три объекта табуляции, каждый из которых содержал по 3 объекта вложенной вкладки со всеми соответствующими полями.Мне также понадобятся 3 экспоната, заполненные их описанием и именем файла экспоната.
Я уже немного поработал с ling to xml, но мне никогда не приходилось беспокоиться о том, чтобы вывести объекты в идеальное древовидное представление xml, потому что обычно у них есть идентификаторы, по которым я могу просматривать списки.после факта и группируйте пункты должным образом.Любая помощь с этим была бы великолепна.