xsd

What does targetNamespace do ? Am I getting it right?

此生再无相见时 提交于 2019-12-22 10:44:14
问题 Here is the <schema> tag of my XSD: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cmu.edu/ns/blank" targetNamespace="http://www.cmu.edu/ns/blank" elementFormDefault="qualified"> If my understanding is correct, here is what it means: This schema itself belongs to http://www.w3.org/2001/XMLSchema namespace The root of the XML instance should belong to http://www.cmu.edu/ns/blank namespace All the elements within the XML instance which do not have a prefix

How to generate a dependency diagram from a set of XSD files?

[亡魂溺海] 提交于 2019-12-22 10:34:58
问题 See the title: I have around 50 XSD files importing each other (with tags) and I need to analyze their dependencies. Do you know any software (preferably free) to generate a dependency diagram automatically from these files? 回答1: I did not find any existing program to do that, so... I developed my own! It is called GraphVisu. There is a first program to generate the graph structure from seed XSD files, and another one to visualise graphs. I also included a detection of clusters of

Element 'assert' is invalid, misplaced, or occurs too often

戏子无情 提交于 2019-12-22 10:34:47
问题 We were provided a set of schemas from a vendor, (we have alerted them to the error as well). When I try to generate the Java classes using xjc, it fails with the error below C:\Users\...>"C:\Program Files (x86)\Java\jdk1.7.0_80\bin\xjc.exe" -d output ICSv1.01.xsd parsing a schema... [ERROR] s4s-elt-invalid-content.1: The content of 'ICSBatchV01' is invalid. Element 'assert' is invalid, misplaced, or occurs too often. line 77 of file:/C:/Users/.../ICSv1.01.xsd [ERROR] s4s-elt-invalid-content

JAXB bindings file: namespace-aware node selection

ε祈祈猫儿з 提交于 2019-12-22 10:27:07
问题 I tend to use external JAXB bindings files for my Schema-to-Java compilation. This works just fine, but I did notice one thing that I've started wondering about. It's not really JAXB-specific, more like an XPath question, but the context helps. Suppose we have this schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:test="www.acme.com" targetNamespace="www.acme.com" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs

Key, KeyRef in different XSD documents

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 09:57:09
问题 Is this possible? Say for example I have customers.xml <customers> <customer>1</customer> <customer>2</customer> </customers> orders.xml <orders> <order> <customer>1</customer> </order> <order> <customer>3</customer> Invalid as Customer 3 doesn't exist </order> </orders> How would the XSD (using key and keyref) look for this (customer.xsd and orders.xsd would also be two different files with different namespaces), is it even possible. All the examples I have seen deal with single files. Can

xml schema conversion issue against xsd giving Illeagal exception in android applications

纵然是瞬间 提交于 2019-12-22 09:50:11
问题 I have written a code to validate given xml file against given xsd file in my android application. But it is giving Illeagal exception error. In some posts I saw its because of low java version. But my java version 1.6.0_20. please check the below code, Error log and suggest. Code: try { // parse an XML document into a DOM tree parserFactory = DocumentBuilderFactory.newInstance(); parserFactory.setNamespaceAware(true); } catch (Exception e) { Log.e("Exception", "ERROR Last : " + e); e

org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'tns:root_element'

夙愿已清 提交于 2019-12-22 09:11:46
问题 I have spent past 2 hours on this. Am unable to figure out why this error is occurring. I have a simple xsd and xml code xml file: <?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2001/XMLSchema"> <element name="root_element" type="string"/> </schema> xsd file: <?xml version="1.0" encoding="UTF-8"?> <root_element>"asd"</root_element> My java code is: DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); SchemaFactory s_factory = SchemaFactory.newInstance

Sharing generated code for shared imported XSD files

断了今生、忘了曾经 提交于 2019-12-22 08:46:45
问题 I use gSOAP for XML data binding. Recently I refactored my XSD files by extracting a common part from two files to a separate third file and then imported it in the first two files. This was a deep and complex element that was refactored out. In actual code I would like to have a single function that takes an object of gSOAP generated type describing that element and constructs some internal objects. But for this I would need to have that generated class be stable and same for both final XSD

Create an XSD optional decimal element with restrictions

做~自己de王妃 提交于 2019-12-22 08:38:51
问题 I've managed to create an optional decimal element using this: <xs:simpleType name="OptionalDecimal"> <xs:union memberTypes="xs:decimal empty-string" /> </xs:simpleType> but I also need to add restrictions so that if it has been entered, to limit it to a maximum length of 10 and maximum number of 3 decimal places for example. So I've got this: <xs:restriction base="xs:decimal"> <xs:maxInclusive value="9999999999"/> <xs:fractionDigits value="3"/> </xs:restriction> The problem is I don't know

Where to place version information in a wsdl?

无人久伴 提交于 2019-12-22 08:36:50
问题 I have a web service where the definitions are located in the wsdl-file and the schema in an external xsd-file. In the xsd file, there is the schema tag, which provides an attribute 'version' that I can use to document the current version. Is there something similar in the wsdl format (WSDL 1.1)? If not, what is the best place to store a general version attribute for documentation purposes? Please keep in mind that I do not want to achieve backward compatibility, like it is described in http: