xsd

What is purpose of xsd:union in XML Schema (XSD)?

99封情书 提交于 2019-12-23 09:37:29
问题 I am parsing XSD for some purpose but facing issues with some XSD nodes. What is the use of the union in XSD and why it is used. Is it used to put some sort of restriction on XML? I am attaching union and simple type node. Please explain why it is used ? <xsd:simpleType name="PeriodExtendedEnum"> <xsd:union memberTypes="PeriodEnum"> <xsd:simpleType> <xsd:restriction base="xsd:token"> <xsd:enumeration value="T" /> </xsd:restriction> </xsd:simpleType> </xsd:union> </xsd:simpleType> <xsd

XML Schema for a fixed element with a fixed attribute?

让人想犯罪 __ 提交于 2019-12-23 09:31:43
问题 What would be the correct XML Schema 1.0 declaration for a <notice xml:lang="en">Banana banana banana</notice> where: The xml:lang attribute is compulsory The value "en" is fixed and compulsory The content of notice is simple text. The content of notice is fixed (as above) and compulsory? My best (but wrong) effort is the following fragment: <xs:element name="notice" use="required" fixed="Banana banana banana"> <xs:complexType> <xs:simpleContent> <xs:extension> <xs:attribute ref="xml:lang"

PHP Soap Server response formatting

给你一囗甜甜゛ 提交于 2019-12-23 09:30:12
问题 I'm making a SOAP web service in PHP that has to fit the requirements of a client's XSD file. Here is a link to the XSD file, supplied by the client: http://pastebin.com/MX1BZUXc The response they are expecting looks like this: [Some long lines broken for legibility, on the theory that the problem is not whitespace-related.] <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Header /> <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org

C# serializable classes to xsd

萝らか妹 提交于 2019-12-23 09:04:26
问题 Is there a way of outputing xml schemas (xsd) from serialisable c# classes? I have had a look about the web but im not sure im searching for the right stuff. Thanks 回答1: You're looking for XSD.exe http://msdn.microsoft.com/en-us/library/x6c1kb0s.aspx Point it at a .dll and it will generate schemas for your classes. 回答2: Xsd2Code works well http://xsd2code.codeplex.com/ 来源: https://stackoverflow.com/questions/6709984/c-sharp-serializable-classes-to-xsd

How to define multiple elements in XML Schema with the same name and different attribute value allowed?

你离开我真会死。 提交于 2019-12-23 08:38:31
问题 I would like to create XML Schema for this chunk of xml, I would like to restrict the values of "name" attribute, so that in output document on and only one instance of day is allowed for each week day: <a> <day name="monday" /> <day name="tuesday" /> <day name="wednesday" /> </a> I have tried to use this: <xs:complexType name="a"> <xs:sequence> <xs:element name="day" minOccurs="1" maxOccurs="1"> <xs:complexType> <xs:attribute name="name" use="required"> <xs:simpleType> <xs:restriction base=

How to get case-insensitive elements in XML

若如初见. 提交于 2019-12-23 07:57:47
问题 As far as I know XML element type names as well as attribute names are case sensitive. Is there a way or any trick to get case insensitive elements? Clarification : A grammar has been defined via XSD which is used for some clients to upload data. The users -the content generators- are creating XML files using different tools but many of them are using plain text editors or whatever. Sometimes when this people are trying to upload their files they get incompatibility errors. It is a common

xsd.exe Auto-Implemented Properties

百般思念 提交于 2019-12-23 07:47:03
问题 Is it possible to force xsd.exe to generate auto-implemented properties instead of the ugly manually implemented code which xsd.exe generates? public abstract partial class SomeClass { private string valueField; /// <remarks/> [System.Xml.Serialization.XmlTextAttribute()] public string Value { get { return this.valueField; } set { this.valueField = value; } } } 回答1: It seems XML Schema Definition Tool (Xsd.exe) does not support generating auto-implemented properties. But there is an

Nested elements in XSD cause Illegal class inheritance loop exception in JAXB, how can I properly override the bindings?

假如想象 提交于 2019-12-23 07:13:32
问题 I have got a problem, I'm trying to bind an XML where there are the name ' Contains ' three times. So I read that it's possible to override node names with a binding file. At the moment it doesn't work. I think mistake come from Xpath in the binding file, but I not sure. I have tried lot of way, but I have never succeed. There is my XSD File : <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="fr:gouv:ae:archive:draft:standard_echange_v0.2" xmlns:xs=

XML Schema 1.1 not recognizing 'assert' or 'assertion'

不羁的心 提交于 2019-12-23 07:00:40
问题 I am trying to use the following in an XSD <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" > <xs:element name="dimension"> <xs:complexType> <xs:attribute name="height" type="xs:int"/> <xs:attribute name="width" type="xs:int"/> <xs:assert test="@height = @width"/> </xs:complexType> </xs:element> I know assert/assertion are part of XML Schema 1.1 but not 1.0. However everything I have read indicates the namespace is the same for both: http://www.w3.org/2001

I want unique value for telephone element

谁说胖子不能爱 提交于 2019-12-23 06:13:13
问题 I am learning xml and schema.I want a schema where Telephone element value have to be unique. I try with unique but can't understand how it's work. Sorry for this silly question but i am learning. xml <?xml version="1.0" encoding="utf-8" ?> <Company xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Employee> <Name>ABC</Name> <Telephone>9998887770</Telephone> </Employee> <Employee> <Name>DEF</Name> <Telephone>9998887770</Telephone> </Employee> <Employee> <Name>GHI</Name> <Telephone