xsd generates [System.Xml.Serialization.XmlTextAttribute()]
, is it exactly equal to 开发者_如何学Python[XmlText]
attribute? why xsd generates the simple one?
It is the same thing.
All xxxAttribute
classes can be used as simply xxx
.
For example, you would usually use [Serializable]
instead of the full name - SerializableAttribute
.
The compiler "knows" that when you use []
this is an attribute.
See the examples at the bottom of the Attribute
MSDN page.
XSD generates the full name in order to be on the safe side - there is no way for the tool writers to know if you have created your own attribute with this name. Fully qualifying the name and namespace makes things less likely to break.
精彩评论