English 中文(简体)
2. 形成内容简单、属性
原标题:Creating elements with simple content and attributes
  • 时间:2010-01-28 18:22:33
  •  标签:
  • xml
  • xsd

如果我们想要形成一个包含简单内容(因此构成数据类型之一)和属性的内容,那么我们就不必使用<代码><simpleType>要素,我们必须宣布复杂的类型,并具体说明这种复杂类型将包含简单的内容。 我们这样做的方法是使用<代码><extension> elements under the <simpleContent> i。

a) 这一新类别(通过<代码><extension> under <simpleContent> elements ) 是否在某种程度上概括了基类建筑的功能和属性?

b) Do we use <complexType> und <simple 类型和编号;由于衍生类别将具有复杂的类型,即使含有简单内容,也构成要素?

c) 所有复杂类型是否来自某些共同基类?

Thanx

问题回答

请记住xml可以像电文一样对待,虽然我们可以将其编为物体,但物体主要含有特性。 你们似乎对物体行为而不是信息行为提出问题。

a) 复杂的类型将包含延展的xsd的所有特性,以及你所补充的简便线的额外内容/性能。 一旦被编成物体,就会包含复杂和简单类型的所有特性。

b) 简单 类型只能包含属性或文字。 它们不能包含其他零件。 这就是为什么我们使用复杂的Type。 1. 扩大具有更多成分的类型 类型必须使用。

c) 这种声音,如“在大多数O-O语文中都有基物体类别?” 在你控制 x子时,你可以确定,是否有含有基质的基质和你想要所有 x的成分的基质。

详情请参见:

http://www.w3schools.com/schema/default.asp





相关问题
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

热门标签