xsd

“extend” an xml schema

北慕城南 提交于 2020-01-04 06:01:16
问题 I'm trying to "extend" an xml schema (nhibernate here, for example), to add my own entities inside of it. I'm stuck to the point where validation chokes on the "exm:foo" (and exm:foobar) entity, as the "base" schema doesn't allow it. How can I manage to do that, without changing the base schema ? Sample : <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Test" namespace="Test.DataAccess.Entities" xmlns:exm="urn:extend-mappings"> <class

XML Schema: Child element type based on parent attribute 'type'

ⅰ亾dé卋堺 提交于 2020-01-04 05:45:10
问题 I have an XML document like below: <operation name="func"> <param name="a" type="string">up</param> <param name="b" type="integer">5</param> <param name="c" type="CustomList"> <list> <idx>0</idx> <name>ZZZZ</name> <value>0.5464</value> </list> <list> <idx>1</idx> <name>YYYY</name> <value>0.464</value> </list> .... </param> </operation> and I wrote an XSD to restrict it: <xs:complexType name="CustomListNode"> <xs:sequence> <xs:element name="idx" type="xs:integer" /> <xs:element name="name"

XmlSchema reading annotation at <schema> level

柔情痞子 提交于 2020-01-04 05:28:28
问题 I've created a schema definition that starts like the following ... <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="urn:my.namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:it="urn:mynamespace"> <xs:annotation> <xs:appinfo>My annotation</xs:appinfo> </xs:annotation> Then I load the schema and I compile it with: System.Xml.Schema.XmlSchemaSet set = new System.Xml.Schema.XmlSchemaSet(); set.Add(schema); set.Compile(); but I can't manage

XSD for XMI 2.1.1

余生颓废 提交于 2020-01-04 05:13:45
问题 I have to parse a XMI file (xmi version 2.1.1) using JAXB. For that, I have to generate Java classes corresponding to a XMI file. So I need a shema definition of a xmi file to do that with the jxc tool. I hope anyone know where I can find this file. Thanks in advance for help ! Edit : for more informations, there is an exemple of a xmi file (generated using modelio) : <?xml version="1.0" encoding="UTF-8"?> <uml:Model xmlns:uml="http://schema.omg.org/spec/UML/2.1.1" xmlns:xmi="http://schema

can't compile a W3C-provided XSD schema; can't resolve “id”?

筅森魡賤 提交于 2020-01-04 04:48:06
问题 I'm playing around with an XML schema and trying to produce a simple valid document that uses it. The schema XSD is provided by the W3C, so I can't imagine anything's actually wrong with it. But xmllint on the command line as well as any number of freebie online validators complain about the actual XSD (not my test document) with: The QName value '{http://www.w3.org/XML/1998/namespace}id' does not resolve to a(n) attribute declaration. Note that it can't resolve the id type/name, which is

Choice of complex types in an XSD

人盡茶涼 提交于 2020-01-04 04:21:47
问题 In an XML schema can a complex type contain a choice of other complex types? I couldn't find any information about that. 回答1: Yes, see section 3.4.2 of the XML Schema reference; a complexType can indeed contain a choice element. Similarly, a choice element can contain one or more complexType elements (see section 3.8.2). 来源: https://stackoverflow.com/questions/11252175/choice-of-complex-types-in-an-xsd

How can I include Html in my Xml Schema

泄露秘密 提交于 2020-01-04 04:01:15
问题 I am trying to allow Html tags as children of one of my types. <xs:complexType name="Html"> <xs:sequence> <!-- Attempting to allow us to include necessary HTML right into our XML --> <xs:any minOccurs="0" namespace="http://www.w3.org/1999/xhtml"></xs:any> </xs:sequence> </xs:complexType> <xs:element name="Html" type="Html"></xs:element> The intent is to allow Html tags, inside any element of that type, but not necessarily needing to have surrounding html or body tags for well formed html. How

Bulk load XML referring to auto-increment parent-id

本秂侑毒 提交于 2020-01-04 02:34:12
问题 In short : I want to do an XML Bulk Load to a SQL Server (2008) database and generate auto-increment-id's for a parent, that can be used in the child. This seems limited by the scope: the parent-node is not finished, so not inserted yet. Does anybody know a way around this? The longer description (sorry, it's really long, but I try to be complete): From a customer I got a lot of XML-documents with a similar structure from which to generate a test-DB. They are exported for use by another tool,

Namespace " Is not available to be referenced in this schema

会有一股神秘感。 提交于 2020-01-04 02:26:08
问题 Hello I am very new to XML Schemas. (This is my first attempt.) I can't understand why I keep getting this error. Namespace " Is not available to be referenced in this schema. This is the line i get the error on. <sch:element name="Field1" type="naming"/> XSD FILE <?xml version="1.0" encoding="utf-8"?> <sch:schema xmlns:sch="http://www.w3.org/2001/XMLSchema" targetNamespace="http://tempuri.org/MySchemaFile" elementFormDefault="qualified"> <sch:element name="Root"> <sch:complexType> <sch

why some schemas use <xsd:choice> instead of <xsd:enumeration>?

巧了我就是萌 提交于 2020-01-04 01:59:27
问题 I saw an xml schema ( EPP ) whitch used xsd:choice with an element even if we can use xsd:enumeration instead : <element name="access" type="epp:dcpAccessType"/> <complexType name="dcpAccessType"> <choice> <element name="all"/> <element name="none"/> <element name="null"/> <element name="other"/> <element name="personal"/> <element name="personalAndOther"/> </choice> </complexType> to make the question clear , I will use this example instead : <element name="sport" type="sportType"/> <!--