xml-validation

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

Refer to specific element of an XSD model group?

六眼飞鱼酱① 提交于 2019-12-24 07:33:14
问题 Can we create a group and refer to element of that group? For example, we have a group say <xs:group name="custGroup"> <xs:sequence> <xs:element name="customerId" type="xs:string"/> <xs:element name="customerName" type="xs:string"/> <xs:element name="Address1" type="xs:string"/> <xs:element name="Address2" type="xs:string"/> <xs:element name="mobile" type="xs:string"/> </xs:sequence> </xs:group> Suppose I want to create another element to have only customerId and mobile : <xs:element name=

Validating with DTD - connection forcibly closed

◇◆丶佛笑我妖孽 提交于 2019-12-23 17:37:53
问题 I'm validating a document with the DTD in the document which is not on my machine, it is stored on the internet. I am currently getting the following exception System.Xml.XmlException: An error has occurred while opening external DTD 'http://xml.cxml.org/schemas/cXML/1.2.020/cXML.dtd': Unable to connect to the remote server ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

How to test a WSDL

一笑奈何 提交于 2019-12-23 05:12:52
问题 How to do WSDL testing? What is Schema Validation of WSDL. Any open source tool, or any API's available to achieve the same? 回答1: If I want to verify WSDL file then I use Eclipse + Web Tools plugin. There is WSDL editor and validator. If I want to test WSDL both as client and server then I use soapUI. There is wsdl import and after that you can query real WebService or if you can create "mock" response. Both tools are free. 回答2: The WS-I organization (http://www.ws-i.org/) publishes the BSP 1

Example of extending complex types in XSD?

你离开我真会死。 提交于 2019-12-23 02:19:13
问题 I am trying to use data within an element without breaking this element existing contract. Let's simplify my case: <xs:element name="ExistingContract"> <xs:complexType> <xs:sequence> <xs:element name="first" type="FirstType"/> <xs:element name="second" type="SecondType"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="NewContract"> <xs:complexType> <xs:sequence> <xs:element name="first" type="FirstType"/> <xs:element name="second" type="SecondType"/> <xs:element name=

XML validation with XMLDSIG using XadES-BES algorithm

梦想与她 提交于 2019-12-22 17:06:09
问题 Some information a program is using uses input files in xml format. The files have the following structure. <?xml version="1.0" encoding="UTF-8"?> <Envelope xmlns="urn:envelope"> <MyData Id="MyDataId"> <!-- some data --> </MyData> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> <SignedInfo> <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /> <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig-more#rsa-sha256" /> <Reference URI="#MyDataId">

XML validation with XMLDSIG using XadES-BES algorithm

心不动则不痛 提交于 2019-12-22 17:05:31
问题 Some information a program is using uses input files in xml format. The files have the following structure. <?xml version="1.0" encoding="UTF-8"?> <Envelope xmlns="urn:envelope"> <MyData Id="MyDataId"> <!-- some data --> </MyData> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> <SignedInfo> <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /> <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig-more#rsa-sha256" /> <Reference URI="#MyDataId">

Limit number of elements with attribute via XSD?

南楼画角 提交于 2019-12-20 05:38:04
问题 There is a fragment of XML <items> <itemUID>uid-1</itemUID> <itemUID>uid-2</itemUID> <itemUID key="true">uid-3</itemUID> <itemUID>uid-4</itemUID> <itemUID>uid-5</itemUID> <itemUID key="true">uid-6</itemUID> <itemUID>uid-7</itemUID> </items> Rule : Element items can contain from 1 to unbounded elements itemUID , but only 0 or 2 or 3 elements with attribute key . Can I define this rule with XSD restrictions only? 回答1: You cannot express your constraint in XSD 1.0, but in XSD 1.1, you can use xs

How to declare element

一笑奈何 提交于 2019-12-20 05:26:36
问题 I'm looking for validate an XML document with xrm prefix as you can read here : I wrote the following XML Schema : </xsd:extension> </xsd:complexContent> </xsd:complexType> </xsd:schema> However, when I check my XML document, I get the following error: 'xrm:plugin' is not a valid value for 'NCName' I understand I can't put xrm: in my name, but how can I validate my xrm:plugin and xrm:header ? Because, if I try to validate my XML document, I get this error: Cannot find the declaration of

Validating XML files against XSD in FireMonkey

本秂侑毒 提交于 2019-12-19 19:52:20
问题 I am developing a cross-platform application (for Windows, Mac etc.) and for 32-bit and 64-bit machines. I have lots of XML files which I need to validate against their XSD . Is there any way of doing this in Delphi XE3? I have tried DTD validation but I'm always getting a "DTD prohibited" error. I have also tried solutions mentioned on lots of websites to resolve this error, but I've had no success. Thanks in advance. Below is the code I've used... function TForm2.ValidateXML(const xmlFile :