English 中文(简体)
3. 可及和关键因素
原标题:nillable and minOccurs XSD element attributes
  • 时间:2009-12-14 19:50:40
  •  标签:
  • xml
  • xsd
  • wsdl

我接着又提出以下内容:minOccurs=“0”nillable=“true”

I was reading this article and now in my WSDL I m not sure if using both is worth it. The article gives a good example of representing arrays where you might have null values interspersed throughout, as this can t be done with just minOccurs="0". Now, the convention I ve been going with is that if an element isn t optional it is not nillable. The difference as I understand it, and where my question lies, is that by applying the nillable property to an element, I am saying that you can pass in the XSD equivalent of a NULL value? Otherwise, an element without the nillable property, has to have a value within the restriction placed on it?

最佳回答

你们需要决定是否考虑将XML作为XML,还是想把 X(或其他)物体从这里传到这里。

在XML中,有线可允许建造<代码><myelement xsi:nil= real />,作为像NCL一样的明确缺席价值指标。 这与仅仅<代码><myelement/>有别之处。 两者完全不同。 因此,在研究XML时,你必须区分四起案件:

<!-- nothing -->
<myElement attr1= true >some content</myElement>
<myElement/>
<myElement xsi:nil= true />

另一方面,如果你主要关心 Java——或许是因为你正在使用SOAP,那么,你需要思考 Java是如何回播的。

对于从目标继承的任何 Java项目,日本宇宙航空研究开发机构和其他制图技术需要一种处理无效价值的方法。 值得注意的是这样做的方法。 如果你对可能成为标的物的物品表示不快,则工具包将无休止地利用阵列来寻找出代表缺席的办法。

另一方面,如果你有一阵列,就会铭记,it/em>阵列是一个目标,可以宣布无效。 因此,每个工具箱必须区分零件和零件。

另一方面,如果你有某种原始类型(例如int),则可以产生问题,因为没有从Xsi:nil到原始数据。

问题回答

暂无回答




相关问题
how to represent it in dtd?

I have two element action and guid. guid is a required field when action is add. but when action is del it will not appear in file. How to represent this in dtd ?

.Net application configuration add xml-data

I need to add xml-content to my application configuration file. Is there a way to add it directly to the appSettings section or do I need to implement a configSection? Is it possible to add the xml ...

XStream serializing collections

I have a class structure that I would like to serialize with Xstream. The root class contains a collection of other objects (of varying types). I would like to only serialize part of the objects that ...

MS Word splits words in its XML format

I have a Word 2003 document saved as a XML in WordProcessingML format. It contains few placeholders which will be dynamically replaced by an appropriate content. But, the problem is that Word ...

Merging an XML file with a list of changes

I have two XML files that are generated by another application I have no control over. The first is a settings file, and the second is a list of changes that should be applied to the first. Main ...

How do I check if a node has no siblings?

I have a org.w3c.dom.Node object. I would like to see if it has any other siblings. Here s what I have tried: Node sibling = node.getNextSibling(); if(sibling == null) return true; else ...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml