xsd

XML Schema. Processing namespace-aware attribute values

青春壹個敷衍的年華 提交于 2019-12-23 18:11:12
问题 Part of my project involves heavy transformations of user-defined schema documents. I need to be able to change target namespaces, support type cross-references and build wsdl upon multiple schema documents. One of the most commonly used operations is changing namespace prefix prior to importing schema into wsdl file. I'm using org.xml.sax.ContentHandler and it's startPrefixMapping method to handle namespaces. All works fine and flawless unless I want to change element types. Here is simple

Incorrect definition for the root element in XML schema

时间秒杀一切 提交于 2019-12-23 18:08:42
问题 There is a schema with the following boring root element: <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> The schema is valid as far as I'm concerned, and Excel reads it no problem, for instance. However, when I try to validate stuff agaist this schema using MSXML (v3 or v4 or v6) I get the subject error. (I create XMLSchemaCache and the error occurs when I add the loaded schema to it.) From Google I learned that there is a conceptual problem

How to work with different.xsd namespaces that contains the same elements/classes?

不问归期 提交于 2019-12-23 18:07:34
问题 Im having a little trouble understanding how I should work with xml files, so I hope you guys can guide me in the right dirrection :) Hopefully I can explain my problem clear enough :) I have a lot of .xsd files which are all connected from top to bottom. So I have 10 .xsd with namespace A and 10 .xsd with namespace B. Lets say that the two namespaces represents each own car. That means they both share a lot of the same elements, like engine, wheel ect.. I tought that I could make use of xsd

How to allow xml:lang attribute in XMLSchema?

限于喜欢 提交于 2019-12-23 17:46:38
问题 I want to allow the use of xml:lang attributes in some of my element of my XMLSchema. But i can't find anything which describes how to to it. Yeah, my question is simple as that. 回答1: You can either create your own attribute with xmlschema type language, or reference xml:lang attribute as in the example Import another XML schema. I hope this will help. 回答2: You have to do a bit of hunting to piece this together from the standards. Here's the magic sauce you need in order to allow xml:lang

XSD for the XML file that Nunit uses

左心房为你撑大大i 提交于 2019-12-23 16:07:04
问题 Where can I find the XSD for the XML file that Nunit uses ? 回答1: For the results file? See Results.xsd (note that it didn't display properly for me, in Chrome; you may have to view source, or download, to see it properly). A transform file, and a sample results file, are in the parent directory. The files are also in the documentation package on the NUnit download page. 来源: https://stackoverflow.com/questions/3878018/xsd-for-the-xml-file-that-nunit-uses

Generate class for schema with abstract complex type

a 夏天 提交于 2019-12-23 15:35:16
问题 I'm working with some schema which defines an abstract complex type, eg. <xs:complexType name="MyComplexType" abstract="true"> This type is then referenced by another complex type in the schema: <xs:complexType name="AnotherType"> <xs:sequence> <xs:element name="Data" type="MyComplexType" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> When I run "xsd.exe /d /l:CS MySchema.xsd" I get this error: Error: There was an error processing MySchema.xsd'. - Error generating code for DataSet '

Maven - Have an XSD as a dependency

心已入冬 提交于 2019-12-23 12:28:04
问题 We have one project that defines the message formats it produces with XSD files. What is the easiest way to make these XSD files as dependencies of another project? I was looking at using the maven-build-helper attach-artifact goal to attach my XSD files. Is there a better mechanism? 回答1: I don't know the attach-artifact goal but I did something like you asked for. I had wsdl and xsd files to write Webservice artifacts and its client artifacts with axis2. I put my wsdl and xsd in an own

How can I fix the web reference proxy that Visual Studio generated to handle jagged arrays?

不羁岁月 提交于 2019-12-23 12:19:08
问题 It seems there is a known bug in wsdl.exe, the tool that Visual Studio uses to generate web service proxies. With certain XSD schemas the tool will generate classes that can't be deserialized from the XML. As far as I'm concerned that's unacceptable, but I don't know how to fix it. I will describe my case in detail, hopefully somebody will be able to help me with it. Schema <!-- return type from the service operation --> <xs:complexType name="listAssetsQueryResults"> <xs:sequence> <xs:element

How to validate big xml against xsd schema?

人走茶凉 提交于 2019-12-23 10:11:15
问题 I need to validate big xml with limited memory usage. With every code i've found so far i get out of memory error. Methods i tried: //method 1 SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(false); factory.setNamespaceAware(true); SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); factory.setSchema(schemaFactory.newSchema(new Source[] {new StreamSource(Thread.currentThread().getContextClassLoader().getResource(

Using XS:date i want date in format YYYYMMDD

那年仲夏 提交于 2019-12-23 09:38:26
问题 Using XSD i want to only accept date of the format YYYYMMDD in my xml field .. So how can i do that I saw this in an example will this work ?? 回答1: XML schema defines dateTime as ISO8601 with some exceptions and you should stick with this, otherwise you will get serious interoperability issues. If you want to send/receive date using different format, use simpleType with regular expression restriction and parse/format the date in your application code: <xs:simpleType name="CustomDate"> <xs