xsd

XSD any element

≡放荡痞女 提交于 2020-01-05 03:58:10
问题 I'm trying to create a list that some of the elements are defined and some are not, without priority to order. I tried it this way, with an any element: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="object" mixed="true"> <xs:choice> <xs:element name="value" minOccurs="1" maxOccurs="1"> <xs:simpleType> <xs:restriction base="xs:integer"> <xs:enumeration value="1"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:any namespace="##any"

XSD: Allow any unknown element in any order

半城伤御伤魂 提交于 2020-01-05 03:55:12
问题 I need to write an XSD schema. In this schema, some elements are known and mandatory, others are unknown and optional: <father> <childMandatory1 /> <childMandatory2 /> <childOptionnal1 /> </father> or: (changing the mandatory children order) <father> <childMandatory2 /> <childMandatory1 /> </father> I know the mandatory children (but not their order). But I don't know if there will be any optional child(ren) (and if so, their names). I tried with "xs:all", but "xs:all" does not allow "any" :

Element type(long) without content

二次信任 提交于 2020-01-05 03:36:27
问题 My schema is: <xsd:element name="SetMonitor"> <xsd:complexType> <xsd:sequence> <xsd:element name="period" type="xsd:long" /> <xsd:element name="refreshrate" type="xsd:long" /> </xsd:sequence> </xsd:complexType> </xsd:element> And my xml will be: Case 1. <SetMonitor xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cb="http://schemas.cordys.com/1.0/coboc"> <period/> <refreshrate/> </SetMonitor> OR Case 2. <SetMonitor xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cb=

minOccurs and maxOccurs on elements inside xsd:choice

时光怂恿深爱的人放手 提交于 2020-01-04 21:44:29
问题 I have a root element <a> and its children <b>, <c>, <d> Here's what I need: the child elements can appear in any order just 1 <b> more than 1 <c> 0 or 1 <d> For example: <a> <c /> <b /> <c /> <d /> </a> And here is my XSD: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="a"> <xs:complexType> <xs:choice> <xs:element name="b" /> <xs:element name="c" minOccurs="1" maxOccurs="unbounded"/> <xs:element name=

minOccurs and maxOccurs on elements inside xsd:choice

≡放荡痞女 提交于 2020-01-04 21:41:59
问题 I have a root element <a> and its children <b>, <c>, <d> Here's what I need: the child elements can appear in any order just 1 <b> more than 1 <c> 0 or 1 <d> For example: <a> <c /> <b /> <c /> <d /> </a> And here is my XSD: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="a"> <xs:complexType> <xs:choice> <xs:element name="b" /> <xs:element name="c" minOccurs="1" maxOccurs="unbounded"/> <xs:element name=

Is there a better method than <!ENTITY> to reuse a complicated table in DocBook?

两盒软妹~` 提交于 2020-01-04 15:14:13
问题 Consider the DocBook article in test.xml which contains an <informaltable> that is repeated at the beginning of each section. Consider also that the <informaltable> is actually much more complicated than this example shows. This example accomplishes reuse of the complicated <informaltable> using an external <!ENTITY ... SYSTEM ...> declaration. The complicated <informaltable> is in another file called reusedtable.xml. test.xml <!DOCTYPE article [<!ENTITY ReusedTable SYSTEM "reusedtable.xml">]

How can I avoide XSD sequence when generating XSDs from JAX-WS?

孤者浪人 提交于 2020-01-04 14:13:43
问题 When I have annotaded java class like @javax.xml.bind.annotation.XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class UserdataType { String username; String street; String address; it will be generated to <xs:complexType name="userdataType"> <xs:sequence> <xs:element name="username" type="xs:string" minOccurs="0"/> <xs:element name="street" type="xs:string" minOccurs="0"/> <xs:element name="address" type="xs:string" minOccurs="0"/> So, by default JAX-WS always generates

Does the Xml Schema spec define the serialization of optional attributes with a default?

杀马特。学长 韩版系。学妹 提交于 2020-01-04 13:44:21
问题 Firstly, the Xml Schema spec does specify the parsing of an optional attribute with a default value : if such an attribute is absent in an xml document, then when parsed with the XSD, they appear to be present, and having that default value. Secondly, some tools apply this idea to serialization , so that attributes with default values are omitted (in other words: given an optional attribute with a default value , when an attribute has that value, it is omitted). However, as far as I can tell,

Standards for queries over SOAP

我的未来我决定 提交于 2020-01-04 09:16:47
问题 Is there a standards-sanctioned XML format for describing entity queries? Background: I plan to build a library for writing queries over WCF services. On the client I want to be able to write (C#): var customers = from c in service.Customers where c.Name.StartsWith("P") order by c.Name select c; I will use a custom serializer to turn the LINQ query into an XML format to send as part of the SOAP body to the server. Maybe it would look something like this: <query> <fetch entity="Customer"> <all

Generate XSD from XML programmatically in Java

风流意气都作罢 提交于 2020-01-04 06:26:24
问题 I'm looking for a leightweight library that allows me to genereate an XSD from XML in Java (no commandline tool). I know that it is not a clean way to generate it, but in this case I need to do it. Also the XML is very simple in terms of structure. I already looked into Trang, but there is no API documentation except how to call it from command line. Also I checked out xsd-gen, but the issue with that library is that one would need to modify some package declrations in the source code which I