I am curious if there is a standard or guideline for determining what types of things should be attributes and elements in an XML file.
I am also wondering how to create xmlarray and xmlarrayitem lists using XMLSerializer. For example, if I have the following:
<SomeBaseTag> <Item1 Attr11="one" Attr12="two" /> <Item1 Attr11="one" Attr12="two" /> <Item1 Attr11="one" Attr12="two" /> <Item2 Attr21="one" Attr22="two" /> <Item2 Attr21="one" Attr22="two" /> <Item2 Attr21="one" Attr22="two" /> </SomeBaseTag>
Should I change it to:
<SomeBaseTag> <Item1s> <Item1 Attr11="one" Attr12="two" /> <Item1 Attr11="one" Attr12="two" /> <Item1 Attr11="one" Attr12="two" /> </Item1s> <Item2s> <Item2 Attr21="one" Attr22="two" /> <Item2 Attr21="one" Attr22="two" /> <Item2 Attr21="one" Attr22="two" /> </Item2s> </SomeBaseTag>
It all depends on the semantics of what you are trying to represent using your XML document.
For example, if your represents a market stall and represents apples, but represents oranges, then the first format is ideal. SomeBaseTag Item1 Item2
SomeBaseTag
Item1
Item2
, , , . , SomeBaseTag ** Item1 ** s , ** Item2 ** s .
, , , .
, . .
, . , . , "<" . , , .
. XML . , WSDL, , -, messages:
messages
<wsdl> <types/> <message/> <message/> <message/> <portTypes/> <bindings/> <service/> </wsdl>
, <messages/>.
<messages/>
- xmls , . , xmls - , , , element vs. . xml , xml
, " ". XML :
, , , , . :
<SomeBaseTag> <SomeItemTag> <SomeAttributeTag>one</SomeAttributeTag> <AnotherAttributeTag>two</AnotherAttributeTag> </SomeItemTag> <SomeItemTag> <SomeAttributeTag>one</SomeAttributeTag> <AnotherAttributeTag>two</AnotherAttributeTag> </SomeItemTag> </SomeBaseTag>
"", "" "primeFactor", , "Item" "attribute".
, XML-. , .
1:
<SomeBaseTag> <Item1/> <Item1/> <Item2/>
2:
<SomeBaseTag> <Set1> <Item1/> <Item1/> </Set1> <Set2> <Item2/> </Set2>
Item1 Item2 , () . - , .
. , . . WSDL .
WSDL:
, " ".
<wsdl> <schema/> <schema/> <schema/> <message/> <message/> <message/> <operation/> <operation/> <operation/> <binding/> <binding/> <binding/> <service/> </wsdl>
, portType, .
. , , YAML JSON.
EDIT: ,
SomeBaseTag: Item1s: - {Attr11: one, Attr12: two} - {Attr11: one, Attr12: two} Item2s: - {Attr21: one, Attr22: two} - {Attr21: one, Attr22: two}
, - , XML. , XML-. XML, . DOCTYPE, , XML, Schema, . , , XML, .
, , . , , , , . - . , 2 4, .
" ", . , XML - , , , .
Source: https://habr.com/ru/post/1715656/More articles:oracle xml parsing gives invalid character error - xmlruby on rails redirect_to (: back) does not work - redirectTeam Planning Algorithm - Quiz Design - C #OO JS and Google Maps APIs: What am I doing wrong? - javascriptVisual Studio 2008 sp1 vC ++ project works in 32-bit mode, but not 64-bit - c ++Как я могу получить конкретное значение строки или ячейки из объекта DataColumn без использования DataGrid? - .netWhat is a good, fast PRNG (not cryptographically secure) - randomMySQL is another UPDATE else INSERT statement - phpFast integer conversion in Python - performanceId type does not match id - but it does! - objective-cAll Articles