xsd-1.1

Should I be using XSD 1.1 to build an open standard?

独自空忆成欢 提交于 2021-02-19 00:55:09
问题 We have been asked to put together a set of schemas for an open XML standard. XSD 1.0 would cope with most of the rules, but it would be a bit messy in places (especially to allow for extensibility) it would also rely on implementers reading free text descriptions of some rules in the form of annotations. Pretty much all of the rules could be implemented using XSD 1.1, however we are not sure if this would limit implementers unduly. So my question, is XSD 1.1 mature enough to be used in the

Dependent naming of XML element in Xml Schema

眉间皱痕 提交于 2021-02-11 08:10:52
问题 Assuming that I have this XML: <parameters> <parameter type="string" isVisible="True" optional="False" id="DealerCode"> <DealerCode>ABCDEF001</DealerCode> </parameter> </parameters> I used a Xml-Schema generator to generate me a basic one. This results in this: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified"> <xs:element name="DealerCode" type="xs:string"/> <xs:element name="parameter"> <xs

Dependent naming of XML element in Xml Schema

半腔热情 提交于 2021-02-11 08:10:24
问题 Assuming that I have this XML: <parameters> <parameter type="string" isVisible="True" optional="False" id="DealerCode"> <DealerCode>ABCDEF001</DealerCode> </parameter> </parameters> I used a Xml-Schema generator to generate me a basic one. This results in this: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified"> <xs:element name="DealerCode" type="xs:string"/> <xs:element name="parameter"> <xs

Dependent naming of XML element in Xml Schema

喜欢而已 提交于 2021-02-11 08:08:49
问题 Assuming that I have this XML: <parameters> <parameter type="string" isVisible="True" optional="False" id="DealerCode"> <DealerCode>ABCDEF001</DealerCode> </parameter> </parameters> I used a Xml-Schema generator to generate me a basic one. This results in this: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified"> <xs:element name="DealerCode" type="xs:string"/> <xs:element name="parameter"> <xs

How to access the failed xsd 1.1 assert rule during validation?

核能气质少年 提交于 2021-02-05 07:25:27
问题 I hope I am not asking a stupid question but I was unable to find an answer myself yet. Situation: I have a xml file which has to be validated against an XSD 1.1 (with a lot of asserts). For the validation I use this xerces version: org.opengis.cite.xerces:xercesImpl-xsd11:2.12-beta-r1667115 . As it has been stated quite a few times on Stackoverflow, this seems to be the only working version for XSD 1.1. And yes, it works perfectly. After the validation, I need to know every single violation

XSD define element by name or alternate attribute

自作多情 提交于 2021-01-28 00:43:42
问题 Consider two possible implementations of a "tag group": Authors are allowed to use either an element named <tag-group> or any element with attribute role="tag-group" . I'd like to write an XSD schema that will validate either case. Ideally, the schema can also validate that children are valid within a given parent. The "tag group", for example, allows children to be either an element named <tag> or any element with attribute role="tag" . So the ideal schema would validate, that given <tag

Linux command line tool validating XSD 1.1?

梦想的初衷 提交于 2020-01-15 07:09:33
问题 Is there any command line tool that validates XML against a XSD version 1.1 ? Xmllint does not validate version 1.1. 回答1: XSD 1.1 is currently supported by Saxon and by Xerces J. Both should run without trouble under Linux. 回答2: I found a handy wrapper around Xerces-J: https://www.dropbox.com/s/939jv39ihnluem0/xsd11-validator.jar java -jar xsd11-validator.jar -sf my.xsd -if my.xml You can update the Xerces-J lib by unzipping the jar, dropping the new Xerces-J in it, then rezipping it to a jar

XSD 1.1 Conditional Type Assignment <alternative test=“”> to check if an element hasn't an attribute set?

大兔子大兔子 提交于 2020-01-02 07:10:17
问题 I would like to ask if someone knows how to make an XSD 1.1 Conditional Type Assignment check if an element hasn't an attribute using the XPath query, e.g.: <!--inline alternative type definitions --> <element name="TimeTravel" type="TravelType"> <alternative test="@direction='Future'"> <complexType> <complexContent> <restriction base="TravelType" .... <!-- some past travel related elements go here --> </complexType> </alternative> <alternative test="@direction='Past'"> <complexType>

XSD restrict element occurrence with an specific attribute

前提是你 提交于 2019-12-25 06:33:44
问题 I try to define a complex type for a selection that can consist of different type of entries but only one entry is allowed to have an attribute "multiselect". Here is what I tried: <element name="selection" minOccurs="0" maxOccurs="unbounded"> <complexType> <sequence> <element name="name" type="string" /> <element name="source"> <complexType> <choice> <element name="item" minOccurs="1" maxOccurs="unbounded" type="string" /> <element name="path" type="string" minOccurs="1" maxOccurs="1" /> <

Validate descendants of unknown XML elements via XSD?

↘锁芯ラ 提交于 2019-12-24 18:02:07
问题 My XML file looks like : <root> <template> <unknownTag> <anotherUnknownTag/> <anotherKnownTag/> <field name='price'/> </unknownTag> </template> <template> <field name='salary'/> </template> <anothorKnownTag/> </root> I want to apply regex restriction to the attribute name of the tag <field/> whether it's a child or a grandchild or a grand grandchild and so on. I have tried the following code, but the regex only applied to the element field when it's a direct child of the template tag. <xs