xsd-validation

XSD schemaLocation, targetNamespace, default XML namespace matching

梦想与她 提交于 2021-02-10 15:00:31
问题 I am getting this error when I am validating XML against my XSD. Both schema and instance are valid and I am able to validate them in XML parsers but I am getting this error in Java: cvc-elt.1: Cannot find the declaration of element 'fieldsMapper' Below is my schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="https://www.company.com/mine" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name=

How to reference global types in XSD?

早过忘川 提交于 2021-02-10 08:21:22
问题 How to implement XSD inner reference to simpleType? I am facing the error you see in the image below. XSD <?xml version="1.0" encoding="utf-8"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://example.com/ct-required" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" targetNamespace="http://example.com/know-type"> <xs:import namespace="http://www.w3.org/2005/05/xmlmime" schemaLocation="http://www.w3.org

XSD - Validate attribute value based on attribute value in parent element

霸气de小男生 提交于 2021-02-08 10:44:27
问题 Is it possible to define an XSD structure such that and attribute on an element can have a certain value only if an attribute on a parent (direct/indirect) element has a certain value? Example: <root> <child1 myAttr="true"> <child2> <child3 otherAttr="false" /> <!-- 'otherAttr' can only be 'false' if 'myAttr' is 'true' --> </child2> </child1> </root> Pseudo Solution: To add something like <rule condition="@otherAttr == true && //child1/@myAttr != false" /> to the definition of the 'child3'

Microsoft Word (OOXML/DOCX) documents formatting validation

拥有回忆 提交于 2021-02-08 06:23:17
问题 Is anyone familiar with OOXML schemas? I need to build a schema to validate the style of a specific documents based on certain rules and I can't find a certain reference or even example to start with. 回答1: The reference for OOXML is Standard ECMA-376 Office Open XML File Formats. Be forewarned that the specification is complex; expect to have to do a lot of reading/learning about both the OOXML specification and XML technologies and techniques prior to making any progress. See also: Where can

Microsoft Word (OOXML/DOCX) documents formatting validation

不羁的心 提交于 2021-02-08 06:22:07
问题 Is anyone familiar with OOXML schemas? I need to build a schema to validate the style of a specific documents based on certain rules and I can't find a certain reference or even example to start with. 回答1: The reference for OOXML is Standard ECMA-376 Office Open XML File Formats. Be forewarned that the specification is complex; expect to have to do a lot of reading/learning about both the OOXML specification and XML technologies and techniques prior to making any progress. See also: Where can

Invalid XDocument is getting validated

情到浓时终转凉″ 提交于 2021-02-05 09:31:13
问题 I have following xml schema <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.MySchema.net" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="RootElement"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="name" type="xs:string" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element

Allow XML element in any order with any number of appearance via XSD?

a 夏天 提交于 2021-02-05 09:13:09
问题 I have trouble to write XSD with these constraints: Name element is required; Value element could appear 0 or multiple times; Category element is optional. I now have XSD like this: <xs:element name="Detail" maxOccurs="unbounded" minOccurs="0"> <!-- 0 or more Details --> <xs:complexType> <xs:sequence> <xs:element type="xs:string" name="Name"/> <!-- Name element is required --> <xs:element type="xs:string" name="Value" maxOccurs="unbounded" minOccurs="0"/> <!-- 0 or more occurences of Value

Allow XML element in any order with any number of appearance via XSD?

拜拜、爱过 提交于 2021-02-05 09:12:11
问题 I have trouble to write XSD with these constraints: Name element is required; Value element could appear 0 or multiple times; Category element is optional. I now have XSD like this: <xs:element name="Detail" maxOccurs="unbounded" minOccurs="0"> <!-- 0 or more Details --> <xs:complexType> <xs:sequence> <xs:element type="xs:string" name="Name"/> <!-- Name element is required --> <xs:element type="xs:string" name="Value" maxOccurs="unbounded" minOccurs="0"/> <!-- 0 or more occurences of Value

Where to place xs:unique constraint in XSD?

≯℡__Kan透↙ 提交于 2021-02-05 07:56:46
问题 I am using XSD for XML validation. I want to add unique values constraint for the input elements. I have XML format like this: <?xml version="1.0" encoding="UTF-8"?> <test> <definitions> <input>Page</input> </definitions> <definitions> <input>Page</input> </definitions> </test> My XSD: <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="test"> <xs:complexType> <xs:sequence> <xs:element name="definitions"

XML XSD recursion and namespaces

℡╲_俬逩灬. 提交于 2021-02-05 07:44:47
问题 I'm trying to wrap my head around namespaces and recursion in XSD and I feel lost. Error: The QName value 'topic' does not resolve to a(n) element declaration Most important part is divided with whitelines, just learning xsd but I need it for one of my assignments, so please, take it easy... Code (I tried to follow this link: Recursive element in XML , unluckily no results): <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name='xmap-content'> <xs:complexType> <xs:sequence>