xml-validation

xsd:any + other elements inside choice

半城伤御伤魂 提交于 2021-02-19 11:19:49
问题 How can I achieve something like this: <xs:element name="getSubjectProductsResponse"> <xs:complexType> <xs:sequence minOccurs="0" maxOccurs="unbounded"> <xs:element name="Products"> <xs:complexType> <xs:sequence> <xs:element name="Date" type="xs:date"/> <xs:element name="Branch" type="xs:date" minOccurs="0"/> <xs:element name="State" type="xs:string"> <xs:element name="ProductDetail"> <xs:complexType> **<xs:choice> <xs:element name="Account" type="ns:TAccount"/> <xs:element name="KK" type="ns

xsd:any + other elements inside choice

泪湿孤枕 提交于 2021-02-19 11:17:55
问题 How can I achieve something like this: <xs:element name="getSubjectProductsResponse"> <xs:complexType> <xs:sequence minOccurs="0" maxOccurs="unbounded"> <xs:element name="Products"> <xs:complexType> <xs:sequence> <xs:element name="Date" type="xs:date"/> <xs:element name="Branch" type="xs:date" minOccurs="0"/> <xs:element name="State" type="xs:string"> <xs:element name="ProductDetail"> <xs:complexType> **<xs:choice> <xs:element name="Account" type="ns:TAccount"/> <xs:element name="KK" type="ns

XSD Error: Type is not declared, or is not a simple type

狂风中的少年 提交于 2021-02-19 04:46:26
问题 For this explanation I am using 2 different XSDs: customEntry.xsd : <?xml version="1.0" encoding="utf-8"?> <xs:schema id="customEntry" targetNamespace="http://tempuri.org/customEntry.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/customEntry.xsd" xmlns:mstns="http://tempuri.org/customEntry.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" > <xs:simpleType name="customEntry"> <xs:restriction base="xs:string"> <xs:pattern value="[A-Za-z0-9_%./]*"/> </xs:restriction> </xs

Error: It was detected that 'sites' has no namespace, but components with no target namespace are not referenceable from schema document

纵饮孤独 提交于 2021-02-18 10:56:05
问题 I have been working on this "advanced" schema for days with the flu and I cannot figure out why it keeps telling me that "sites" is not found. I re-read the chapter and even created a copy to experiment with (which worked before) and I do not understand. I am trying to import and combine schemas and I am not sure how to get it to work properly... Here are the errors: Ln 16 Col 84 - cvc-elt.1: Cannot find the declaration of element 'sites'. 1 Errors [Xerces-J 2.9.1] Validating XML Schema

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

Can I validate polymorphic XML elements based on a child Type element value?

跟風遠走 提交于 2021-02-10 18:48:14
问题 I want to validate polymorphic Shape elements, differentiated by the Type child element ( not attribute) value. Below are sibling Circle and Rectangle Shape elements. Circles have a Radius and only 1 Point . Rectangles don't have Radius and have 4 Point elements: <?xml version="1.0" encoding="UTF-8" ?> <Shapes> <Shape> <Type>Circle</Type> <ID>A1234</ID> <Label>This is round</Label> <Radius>5.4</Radius> <Points> <Point> <X>5.00</X> <Y>2.00</Y> </Point> </Points> </Shape> <Shape> <Type

Can I validate polymorphic XML elements based on a child Type element value?

我与影子孤独终老i 提交于 2021-02-10 18:47:47
问题 I want to validate polymorphic Shape elements, differentiated by the Type child element ( not attribute) value. Below are sibling Circle and Rectangle Shape elements. Circles have a Radius and only 1 Point . Rectangles don't have Radius and have 4 Point elements: <?xml version="1.0" encoding="UTF-8" ?> <Shapes> <Shape> <Type>Circle</Type> <ID>A1234</ID> <Label>This is round</Label> <Radius>5.4</Radius> <Points> <Point> <X>5.00</X> <Y>2.00</Y> </Point> </Points> </Shape> <Shape> <Type

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=