xsd

In XML Schema, why does an element group tag even exist?

半世苍凉 提交于 2020-01-06 16:46:32
问题 From my understanding, group is used to create named sequences (choice, sequence, all) that can later be referenced. However, why is this even necessary when complexType can be used to accomplish the same thing and is, in addition, much more powerful? Isn't this very un-DRY? Not to mention that the group tag essentially acts as both a definition of a type, and at the same time, can be a reference to that type, depending on whether you use ref or name attribute. Isn't this terribly confusing

Accept or reject change tracking in XML

99封情书 提交于 2020-01-06 16:19:34
问题 I have multiple XML files which consists of change tracking attribute <atict:add> or <atict:del> . Objective: if XML file consists of an element CT="ACCEPT" then accept/print all tags with <atict:add> and ignore <atict:del> if XML file consits of an element CT="REJECT" then accept/print all tags with <atict:del> and ignore <atict:accept> Sample XML: <?xml version="1.0" encoding="UTF-8"?> <DM xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:atict="http://www.arbortext.com/namespace

maven-jaxb2-plugin not compiling xsd on linux machine but works on windows?

依然范特西╮ 提交于 2020-01-06 15:18:41
问题 Here is code snippet from pom.xml <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>0.8.3</version> </plugin> Here is the exception [INFO] --- maven-jaxb2-plugin:0.8.3:generate (default) @ customer-project --- [ERROR] Error while parsing schema(s).Location [ file:....Customer.xsd{12,97}]. org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'customer:CustomerApplication' to a(n) 'element declaration' component. at com.sun

Error validating the XML content: The element cannot contain white space. Content model is empty

∥☆過路亽.° 提交于 2020-01-06 12:27:09
问题 Hi I keep having this error while I try to valide a qti xml document. Here is the xml document: <respcondition title="Correct" > <conditionvar> <not> <varequal respident="1">A</varequal> </not> <varequal respident="1">B</varequal> <not> <varequal respident="1">C</varequal> </not> <varequal respident="1">D</varequal> </conditionvar> <setvar action="Set">1</setvar> <displayfeedback linkrefid="Correct"/> </respcondition> Here is the fragment of xsd that valide the xml <!-- ******************* --

Problem with restriction in xsd

 ̄綄美尐妖づ 提交于 2020-01-06 08:16:47
问题 <xs:restriction base="xs:any"> Why cant I put restriction on any type like this? 回答1: Because its meaningless, semantically it would be like the statment "You can't do nothing" More syntactically, after reading about xs:restriction, I think that xs:any is not a built in data type, simpleType element or a complexType element but rather a place holder for extending a document with any element. 回答2: You can't put such restriction, because xs:any is not a type. If you want to derive a new type by

Unique value across elements in XSD

与世无争的帅哥 提交于 2020-01-06 06:06:04
问题 I'm trying to enforce a unique value across an element used in multiple complexType elements. For example : <xs:element name="lmt"> <xs:complexType> <xs:choice maxOccurs="unbounded"> <xs:element ref="lf" maxOccurs="unbounded"/> <xs:element ref="cdl" maxOccurs="unbounded"/> </xs:choice> </xs:complexType> <xs:unique name="uniquePos"> <xs:selector xpath="./*/pos"/> <xs:field xpath="."/> </xs:unique> </xs:element> <xs:element name="pos"> <xs:simpleType> <xs:restriction base="xs:integer"> <xs

PyXB: two versions of XSDs with same namespace

陌路散爱 提交于 2020-01-06 05:51:11
问题 I am implementing a client for the TRIAS APIs v 1.0 and v 1.1 using PyXB. The problem I'm facing is, that both XSD collections have the same namespace with same elements with differing content. So I built two class bindings with pyxbgen for each version. However I now cannot use them both within the same program, since PyXB will throw a pyxb.exceptions_.NamespaceUniquenessError : Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.7/dist

How to reference an xsd-Schema in an xml-node

寵の児 提交于 2020-01-06 05:45:30
问题 I need to put a reference to an XML-schema (xsd) into an XML-node. It should look like this: <root> <!--reference to xsd--> <child1/> <child2/> </root> At the place of the comment should be a link to some schema. Is there a standard way to do this? 回答1: This is a good link to start reading about referencing schema documents in XML documents; it gives you a description of the two attributes, xsi:noNamespaceSchemaLocation and xsi:schemaLocation used for this purpose. 回答2: Do you want to do

XSD for soap result not working

一个人想着一个人 提交于 2020-01-06 04:28:06
问题 I want to check a soap response against a xsd. Here is the xml soap response: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <GetHTMLResponse xmlns="http://www.webserviceX.NET"> <GetHTMLResult> Test </GetHTMLResult> </GetHTMLResponse> </soap:Body> </soap:Envelope> Here is my XSD: <xs:schema attributeFormDefault="unqualified

XSD reference a type defined within the same file

亡梦爱人 提交于 2020-01-06 04:05:56
问题 I an trying to create an XSD, to define complex types to be referenced in other XSDs. So far so good. Within this XSD (playlist.xsd) I have one main complexType "playlistType". I want the playlistType to be able to contain multiple instances of an element of type 'secondaryEventType', which I am trying to define as a separate complexType within the same XSD file. However, when I come to try to create the 'secondaryEvent' element within the 'playlistType' I am continuously getting the error