xml元素支持的最大属性数 [英] maximum number of attributes supported by xml element

查看:57
本文介绍了xml元素支持的最大属性数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

xml支持的最大属性数是多少?

what is maximum count of attributes that are supported by xml?

推荐答案

无限制。你有多少RAM?
No limit. How much RAM do you have?


没有这样的限制。所以你可以拥有任何。但是如果你需要在你的xml doc中找到节点上的最大属性数,那么你可以使用的东西如下。



There is no such limit.So you can have any.But If you need to find the maximum number of attributes on a node in your xml doc,Then you can use something is as below.

XElement el = XElement.Load("MyXML.xml");
int maxAttr = el.DescendantNodesAndSelf().OfType<XElement>().Max(x => x.Attributes().Count());





欲了解更多信息:



节点在XML文档中的最大属性数量



我希望这会对你有所帮助。



For more info :

Maximum number of attributes a node has in a XML document

I hope this will help to you.


XML规范中没有这样的限制:(http://www.w3.org/TR/REC-xml/)



关闭主题:

对于给定的XML Schema,可以使用<$ c $指定ELEMENTS的数量(当然不是属性=唯一) C> maxOccurs的。你的意思是这样吗?
There is no such limit in the XML specification: (http://www.w3.org/TR/REC-xml/)

Off Topic:
For a given XML Schema the number of ELEMENTS (not attributes of course = unique) can be specified by using maxOccurs. Did you mean something like this?


这篇关于xml元素支持的最大属性数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆