xsd

XML schema - No matching global declaration available for the validation root

旧巷老猫 提交于 2021-02-11 10:24:28
问题 Im am trying to create an XML schema for the following XML document. https://www.nationalbanken.dk/_vti_bin/DN/DataService.svc/CurrencyRatesHistoryXML?lang=en Then I have installed installed the XML tools plugin to my Notepad++ and tried to validate the XML doc agains the schema. <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ecb.int/vocabulary/2002-08-01/eurofxref" xmlns="http://www.ecb.int/vocabulary/2002-08-01

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 two elements have different names but same type in XSD?

泪湿孤枕 提交于 2021-02-11 07:13:46
问题 Consider the two scenarios: I have one XML that looks like: <personinfo> <info> <option1>Coke</option1> </info> </personinfo> where I should have a choice between an option1 and option2 element. I have another XML that looks like: <personinfo> <info> <firstname>Yair</firstname> <lastname>Zaslavsky</lastname> </info> </personinfo> where both firstname and lastname should appear (hence a sequence). I have tried to use the following schema: <?xml version="1.0" encoding="UTF-8" ?> <xs:schema

Require element based on position and attribute value

送分小仙女□ 提交于 2021-02-10 20:22:36
问题 I have the following XSD (part of the XSD) <xs:element name="sourceValue" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:normalizedString"> <xs:attribute name="label" type="xs:normalizedString" use="required"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> In my XML I have: <?xml version="1.0" encoding="UTF-8"?> <Record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="assertion.xsd">

Require element based on position and attribute value

不打扰是莪最后的温柔 提交于 2021-02-10 20:19:23
问题 I have the following XSD (part of the XSD) <xs:element name="sourceValue" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:normalizedString"> <xs:attribute name="label" type="xs:normalizedString" use="required"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> In my XML I have: <?xml version="1.0" encoding="UTF-8"?> <Record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="assertion.xsd">

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=