xsd

How do I defined an XSD attribute name as a regular expression?

半腔热情 提交于 2020-01-24 21:37:05
问题 The XML allows a variable number of attributes of Q followed by a number, like this <recognitionPattern Q0="12.5" Q1="12.5" Q2="12.5" Q3="12.5" Q4="12.5" Q5="12.5" Q6="12.5" Q7="12.5"/> My current solution looks something like this: <xs:complexType name="PerQuarterDoubleHack"> <!-- YUCK! /> --> <xs:attribute name="Q0" type="xs:double" /> <xs:attribute name="Q1" type="xs:double" /> <xs:attribute name="Q2" type="xs:double" /> <xs:attribute name="Q3" type="xs:double" /> <xs:attribute name="Q4"

libxml2 fails on xsd schema validation for element type anyURI containing special characters like “[”, “[”

纵然是瞬间 提交于 2020-01-24 17:51:29
问题 I am using go-libxml2 for my xsd schema validation. I have an XML element which takes url as a value. My xsd also contains its type as anyURI as follows <xs:element name="url" type="xs:anyURI"> The following code throws error on validation url which contains "[]" xsd.schema.Validate(xml) The following is the sample url which throws an error <url> <![CDATA[ http://example.com/orda/var[div]=super ]]> </url> Error: 'http://example.com/orda/var[div]=super is not a valid value of the atomic type

Empty elements for primitve datatypes forbidden in XSD

ぐ巨炮叔叔 提交于 2020-01-24 15:51:31
问题 I encountered a parsing error with Apache CXF while processing a webservice response. What it comes down to is an empty element being returned: <myValue /> The element definition is as follows: <xsd:element name="myValue" type="xsd:float" minOccurs="0"> Now I've read on the CXF mailing list that an empty value is not allowed by the XSD-spec: Well, there isn't a workaround for this as it's not a bug. An empty element is not valid for any Decimal or Date type or anything like that. Thus, it

Add metadata to an XSD definition

旧时模样 提交于 2020-01-24 11:15:31
问题 Not all that familiar with XSD, I wonder if it is possible to do the following: <xs:group name="SomeGroup"> <xs:sequence> <xs:element name="Groupingcode" type="OurType" origin="DB" /> <xs:element name="Description" type="StringType" origin="XML" /> To explain: I have an XSD schema file. I need to generate an XML file according to the XSD (this part works fine) containing database data. However, some elements need additional data to be able to find the proper field to get from the database.

Add metadata to an XSD definition

╄→гoц情女王★ 提交于 2020-01-24 11:15:05
问题 Not all that familiar with XSD, I wonder if it is possible to do the following: <xs:group name="SomeGroup"> <xs:sequence> <xs:element name="Groupingcode" type="OurType" origin="DB" /> <xs:element name="Description" type="StringType" origin="XML" /> To explain: I have an XSD schema file. I need to generate an XML file according to the XSD (this part works fine) containing database data. However, some elements need additional data to be able to find the proper field to get from the database.

XmlAdapter for base64Binary results in String

我是研究僧i 提交于 2020-01-24 11:10:07
问题 I've an XSD file containing this: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jaxb:extensionBindingPrefixes="xjc" elementFormDefault="qualified" targetNamespace="http://example.org/"> <xsd:complexType name="Certificate"> <xsd:sequence> <xsd:element name="certificate" type="xsd:base64Binary"> <xsd:annotation> <xsd:appinfo> <xjc:javaType name="java.security.cert.X509Certificate" adapter=

XML Parsing using a schema in C#

时间秒杀一切 提交于 2020-01-24 09:48:29
问题 I'm working on some code that loads an xml file at run time. At the minute, we're using the XmlDocument type to read the xml file and wrapping a try-catch around SelectSingleNode statement (this is done on the off chance that a node is null, or isn't there as we're parsing user created xml files). Please note : I realise that XmlDocument has been replaced by XDocument. However since we're working with .NET version 3 (according to this MSDN document XDocument isn't available in .NET 3), we're

XSD validates wrong format of xs:date and xs:dateTime

旧巷老猫 提交于 2020-01-24 08:20:46
问题 When I set the year section like below (20512 or anything like this), XSD still validates XML. Any idea. Is this a flaw or do I have to use simpleType with given pattern? Thanks XSD <xs:attribute name="date" type="xs:date" /> <xs:attribute name="timestamp" type="xs:dateTime" /> XML <store date="20512-07-11" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="items.xsd"> <store timestamp="20512-07-11T21:50:16" xmlns:xsi="http://www.w3.org/2001/XMLSchema

XSD validates wrong format of xs:date and xs:dateTime

不问归期 提交于 2020-01-24 08:19:50
问题 When I set the year section like below (20512 or anything like this), XSD still validates XML. Any idea. Is this a flaw or do I have to use simpleType with given pattern? Thanks XSD <xs:attribute name="date" type="xs:date" /> <xs:attribute name="timestamp" type="xs:dateTime" /> XML <store date="20512-07-11" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="items.xsd"> <store timestamp="20512-07-11T21:50:16" xmlns:xsi="http://www.w3.org/2001/XMLSchema

Spring 3.0: “The prefix” X “for attribute” Y “associated with an element type” Z “is not bound”

时光毁灭记忆、已成空白 提交于 2020-01-22 20:40:17
问题 My app was working fine until this morning but I started getting the errors below after I renamed my Netbeans 6.9 project this morning. I'm getting the following error when building my Spring 3.0.4 app: The prefix "p" for attribute "p:driverClassName" associated with an element type "beans:bean" is not bound applicationContext.xml: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns