xsd-1.1

XSD conditional type assignment default type confusion?

余生颓废 提交于 2019-12-24 09:35:13
问题 I try to design a XSD with CTA. I have the following XML: <?xml version="1.0" encoding="UTF-8"?> <persons xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="test.xsd"> <person version="1"> <firstname>toto</firstname> <lastname>tutu</lastname> </person> <person version="2"> <firstname>toto</firstname> <lastname>tutu</lastname> <birthdate>2017-12-18</birthdate> </person> </persons> The XSD looks like: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns

XML Schema 1.1 not recognizing 'assert' or 'assertion'

不羁的心 提交于 2019-12-23 07:00:40
问题 I am trying to use the following in an XSD <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" > <xs:element name="dimension"> <xs:complexType> <xs:attribute name="height" type="xs:int"/> <xs:attribute name="width" type="xs:int"/> <xs:assert test="@height = @width"/> </xs:complexType> </xs:element> I know assert/assertion are part of XML Schema 1.1 but not 1.0. However everything I have read indicates the namespace is the same for both: http://www.w3.org/2001

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

How to indicate that an xml schema that requires schema 1.1 features?

馋奶兔 提交于 2019-12-18 15:05:13
问题 If I create an XML Schema that requires schema 1.1 features (especially subtle ones, like removing an optional element in restriction of a base type), what is the best way to indicate that this schema should not be used with a processor that only understands version 1.0? In an XSLT stylesheet file, it is possible to indicate the version of the XSLT specification that is used using a version attribute. But in an XSD file, the version attribute does not have this meaning - it is a free-form

XSD “version” attribute semantics

杀马特。学长 韩版系。学妹 提交于 2019-12-13 13:17:28
问题 <schema xmlns="http://www.w3.org/2001/XMLSchema" ... version="xxx"> The XSD specification https://www.w3.org/TR/xmlschema11-1/#declare-schema does not specify the semantics for the version attribute: The other attributes ( id and version ) are for user convenience, and this specification defines no semantics for them. Nor does that the W3C versioning guide https://www.w3.org/TR/xmlschema-guide2versioning/. Is there a consensus arising whether this attribute should be used for specifying the

How to use Conditional Type Assignment for different integer types in XSD

喜你入骨 提交于 2019-12-13 04:43:18
问题 XSD1.1 allows the type of an element to depend on one of its attributes. For example, <integer kind='s'>100</integer> will cause the type of 'element' to be xs:short. Here is what I have got: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" attributeFormDefault="unqualified" vc:minVersion="1.1"> <xs:complexType name="GenericInt"> <xs:simpleContent> <xs:extension

How to access parent element in XSD assertion XPath?

微笑、不失礼 提交于 2019-12-12 20:13:21
问题 I am trying to write an assertion that will make the values of @row and @column less than or equal to the values of @rows and @columns in the parent element <structure> . <xs:element name="structure"> <xs:complexType> <xs:sequence> <xs:element name="cell" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="row" type="xs:positiveInteger"/> <xs:attribute name="column" type="xs:positiveInteger"/> <xs:assert test="@row le @rows"/> <xs:assert test="@column le @columns"/> </xs:complexType>

Co-Occurrence Constraint

社会主义新天地 提交于 2019-12-12 17:20:37
问题 I am having difficulty writing an XSD I'm working on using XML Schema 1.1. I have one element named PaymentMethod that is either "C" or "F": If PaymentMethod = "C", then it's a check. If PaymentMethod = "F", then it's a fund transfer. How do I make BankingInfo (BankName, TransitNo, AccountNo, AccountType) optional for a check and mandatory for a fund transfer? See below for a snippet of my code. <xs:element name="PaymentMethod"> <xs:simpleType> <xs:restriction base="xs:string"> <xs

Conditional on value in xsd

巧了我就是萌 提交于 2019-12-11 16:36:02
问题 is there any way to add conditions on a tag value? For example, my xml looks like this: <Root> <Scheduler> <DateTimeType>DAY</DateTimeType> <DayOfWeek>Sunday</DayOfWeek> <!-- TAG IS ALLOWED --> </Scheduler> <Scheduler> <DateTimeType>MONTH</DateTimeType> <DayOfWeek>Sunday</DayOfWeek> <!-- TAG IS NOT ALLOWED --> <DayOfMonth>28</DayOfMonth> <!-- TAG IS ALLOWED --> </Scheduler> <Scheduler> <DateTimeType>WEEKDAY</DateTimeType> <DayOfWeek>Sunday</DayOfWeek> <!-- TAG IS ALLOWED --> <TimeOfDay>15:26<

Assert condition to optimize the query in XSD

ぃ、小莉子 提交于 2019-12-11 16:13:44
问题 I have an XSD where i have to use assert condition. I would want to print all columns for condition when indicator='A' and few columns another condition is indicator='D'. I have the below logic but i have around 100 columns so can anyone help me with optimizing the query? <xs:assert test="if (indicator eq 'A') then test1 and test2 and test3 and test4 and test5 and test6 and test7 else if (indicator eq 'B') then test1 and test3 else false()"/> The input XML is in this format: `<?xml version="1