xsd

can xsd schema validate encoding, e.g. UTF-8, possible?

六眼飞鱼酱① 提交于 2019-12-31 02:39:11
问题 By using schema, is there any simple/easy way to validate the encoding of an xml msg? Assuming the 1st line of xml is "not" trustworthy? e.g. ignore ?xml version="1.0" encoding="UTF-8" ? 回答1: No, schema can't dictate encoding type except in terms of the binary data element types, but this encoding is still going to be encapsulated by the high level encoding of the document itself. This makes sense if you realize that the schema is suppose to describe the information and not the transport

.NET xsd importer creates unserializable class

ぐ巨炮叔叔 提交于 2019-12-30 18:43:08
问题 I am using the .NET XSD.EXE importer to generate C# classes from a collection of XSD files. When I tried to serialize one of the classes to XML it failed ( InvalidOperationException ), and when I dug into it I discovered it one of the created classes appears to be wrong. Here is the pertinent XSD code: <xsd:complexType name="SuccessType"> <xsd:annotation> <xsd:documentation>Indicates in a response message that a request was successfully processed.</xsd:documentation> </xsd:annotation> <xsd

How to use alternatives in XML Schema 1.1

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-30 11:53:09
问题 From everything I have read, the schema I have defined below should work (emphasis on alternatives). I get the following error: The 'http://www.w3.org/2001/XMLSchema:alternative' element is not supported in this context. Could you please point out what I did wrong? Here is my current schema: <?xml version="1.0" encoding="utf-8"?> <xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/XMLSchema.xsd" xmlns:mstns="http://tempuri.org

Error when generating a class from xsd schema file

旧巷老猫 提交于 2019-12-30 09:45:11
问题 I'm trying to generate a class from an xsd schema but I obtain the following error message: Warning: cannot generate classes because no top-level elements with complex type were found. My xsd file looks like that: <?xml version="1.0" encoding="utf-8"?> <xs:schema id="MonitoringConfiguration" targetNamespace="urn:MonitoringConfiguration-1.0" elementFormDefault="qualified" xmlns="urn:MonitoringConfiguration-1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" > <xs:complexType name=

Generation of XSD restrictions in a schema generated from Java JAXB annotated classes

∥☆過路亽.° 提交于 2019-12-30 09:37:10
问题 MOXy BeanValidation gives me the ability to add validation to my JAXB classes. Using MOXy's "Bean Validation Plugin" I can have Bean Validation in generated JAXB classes based on restrictions/facets from a prexisting Schema. However is there any way of generating a schema with restrictions/facetsbased on Bean Validation annotations from a JAXB annotated java class ? XJC has a handy plugin architecture when doing 'schema first' generating java, but is there any equivalent 'java first' way to

Automate xsd.exe during build

谁说胖子不能爱 提交于 2019-12-30 06:46:08
问题 I need a way to automatically regenerate *.cs files during build, based on *.xsd files, preferably without involving any custom add-ins. This needs to run on the CI build as well. I'm not sure if I'm missing something obvious, or is this really tricky as it seems to me? 回答1: I use this script: @echo off cd %1 call :treeProcess %2 "XSDs" cd .. goto :eof :treeProcess rem From http://stackoverflow.com/a/8398621/298754 echo Processing %2 for %%f in (*.xsd) do call :buildXSD %%f %1 %2 %%~nf for /D

Tool for XML XSD schema validation [closed]

霸气de小男生 提交于 2019-12-30 05:59:15
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Does anybody know of a command line tool for validating XML with XSD schema? 回答1: xmllint from the Libxml project xmllint --schema schema.xsd doc.xml 回答2: On http://www.w3.org/XML/Schema under "Tools" you should find the one which fits your need. I would think it’s oNVDL. 回答3: mono-xmltool , see https://github

Is there a class to generate a sample XML document from XSD schema in .NET

偶尔善良 提交于 2019-12-30 04:43:08
问题 In Visual Studio you can create a template XML document from an existing schema. The new XML Schema Explorer in VS2008 SP1 takes this a stage further and can create a sample XML document complete with data. Is there a class library in .NET to do this automatically without having to use Visual Studio? I found the XmlSampleGenerator article on MSDN but it was written in 2004 so maybe there is something already included in .NET to do this now? 回答1: some footwork is involved, but you could load

python suds wrong namespace prefix in SOAP request

為{幸葍}努か 提交于 2019-12-30 02:26:38
问题 I use python/suds to implement a client and I get wrong namespace prefixes in the sent SOAP header for a spefic type of parameters defined by element ref= in the wsdl. The .wsdl is referencing a data types .xsd file, see below. The issue is with the function GetRecordAttributes and its first argument of type gbt:recordReferences . File: browse2.wsdl <xsd:schema targetNamespace="http://www.grantadesign.com/10/10/Browse" xmlns="http://www.grantadesign.com/10/10/Browse" xmlns:gbt="http://www

Validating XML with XSD

末鹿安然 提交于 2019-12-30 02:19:12
问题 I'm running into real difficulties validating XML with XSD. I should prefix all of this and state up front, I'm new to XSD and validation, so I'm not sure if it's a code issue or an XML issue. I've been to XML API hell and back with the bajillion different options and think that I've found what would be the ideal strategy for validating XML with XSD. Note, my XML and XSD are coming from a database, so I don't need to read anything from disk. I've narrowed my problem down into a simple sample