xsd

Allow variable element attributes in xml schema

一世执手 提交于 2019-12-24 11:07:53
问题 How would the element complexType look like if I want it to have variable attribute names, count and values ? <mtd:attributes icon="remove" security="D" variable1="F" variable2="D"/> I tried : <xsd:element name="attributes"> <xsd:complexType> <xsd:anyAttribute/> </xsd:complexType> </xsd:element> but it doesn't do it. 回答1: I finally made it with : <xsd:anyAttribute processContents="skip"/> 回答2: Try to add processContents=skip 来源: https://stackoverflow.com/questions/14872678/allow-variable

Schema generated from WCF web service and ASMX are different

我只是一个虾纸丫 提交于 2019-12-24 10:49:53
问题 I have the following class [Serializable()] [XmlType(AnonymousType=true)][XmlRoot(Namespace="", IsNullable=false)] public class Test { [XmlAttribute()] public string Prop { get; set; } public string Another { get; set; } } I used this class in both a WCF web service (SVC) and an ASMX web service and I'm expecting to get a SOAP body which are consistent for both ASMX and SVC where the "Prop" property is an attribute. Also, I tried adding a service and web reference to both SVC and ASMX and

XSD.exe ignores simple complextypes

核能气质少年 提交于 2019-12-24 10:48:26
问题 We have a big wcf service, and a big xsd document where we have several elements and complex types. We generate code with the xsd.exe, and use the XmlSerializerFormat on our ServiceContract for the WCF service to serialize these objects again. Now we have a problem with xsd.exe and the definitions of an array of strings. Image we have the following element defined.. <xs:element name="Configuration" type="Configuration"/> <xs:complexType name="Configuration"> <xs:sequence> <xs:element name=

XML-Schema: how to set enumerations to one appearance per document

南笙酒味 提交于 2019-12-24 10:36:27
问题 I want to add a name-attribute to all my elements. To make sure that only some attribute values are allowed I created a restriction-pattern. Is there a way to make sure, that each enumeration value is used exactly once per document? simpleStyle: <xsd:simpleType name="myname"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="1"/> <xsd:enumeration value="2"/> </xsd:restriction> </xsd:simpleType> XML <element name="1"/> <element name="2"/> <element name="1"/> The last one should not

Xsd2Code and xmldsig

為{幸葍}努か 提交于 2019-12-24 10:34:06
问题 I have a problem with generating code from xsd with Xsd2Code. The xsd looks like this: <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:ns1="urn:oasis:names:specification:ubl:schema:xsd:CountryIdentificationCode-1.0" xmlns:ns2="urn:oasis:names:specification:ubl:schema:xsd:LocationIdentificationCode-1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:import namespace="http:/

Cannot validate xml against a xsd. Error “cvc-elt.1: Cannot find the declaration of element 'systems'”

放肆的年华 提交于 2019-12-24 10:16:45
问题 I am having trouble validating an XML using an XSD via code. I can't figure out what I'm missing XML: <?xml version="1.0" encoding="UTF-8"?> <systems xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="test.namespace"> <system address="test" id="test" name="test" systemNr="test"> <mandant mandant="test"/> </system> <system address="test2" name="test2" systemNr="test2" id="test2"> <mandant mandant="test2"/> <mandant mandant="test2"/> </system> <system id="test3" address="test3" name=

JAXB equivalent for generating c++ classes from xsd?

别来无恙 提交于 2019-12-24 10:01:37
问题 JAXB provides a very OOP way for handling xml data, is there any such alternative or script avaiable for c++. Looking for some tool which is OS independent ie: should work in linux, windows, etc. Tool should be generating c++ classes like the way JAXB generated from XSD Schema. We used have a perl script performing the same job in my previous organization but that was quite primitive (didn't handle inheritance etc). perl or python scripts will be super. 回答1: I've been pretty impressed with

schemaLocation ignored when marshalling JAXB Classes using Metro

情到浓时终转凉″ 提交于 2019-12-24 09:59:58
问题 I'm using the Metro stack bundled with Java 6 SE to call a web service. The web service expects XML as a parameter. I use JAXB classes to create content and pass my JAXB root element to the web service endpoint. Now to my Problem: I can't find any way to make the marshaller include the schemaLocation of the XSD file since I can't directly access the marshaller. (If you have direct access to the marshaller it is possible do set the schemalocation as a property, but when using metro, all the

create winform from xsd+ xml

风格不统一 提交于 2019-12-24 09:59:00
问题 is it possible to create winforms based on an xsd file and xml ? maybe by using something similar to xslt (webforms)? 回答1: I don't think, because web forms are basically HTML or Text files, so we can render using XML / XSLT. But in the case of WinForm, it is different and complex. Yes you can try around XML Serialize / Deserialization concepts. Or XAML in WPF. 回答2: Sounds like you want to create editors for dataset objects dynamically. If you take a look at the designer.cs file of a winform

Why is intelliJ not using the correct version of .xsd file

浪子不回头ぞ 提交于 2019-12-24 09:48:17
问题 Here is my spring-security.xml file <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"> So the last line specifies a 3.0