xsd

Can one concatenate two given XSD data types into a new XSD data type?

跟風遠走 提交于 2019-12-24 09:35:56
问题 Given two simple data types, say, restricted strings type1 , type2 , is there a possibility to define type3 describing all strings formed by concatenating one type1 string plus one type2 string? For example, consider <xsd:simpleType name="type1"> <xsd:restriction base="xsd:string"> <xsd:pattern value="[A-Z]"></xsd:pattern> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="type2"> <xsd:restriction base="xsd:string"> <xsd:pattern value="[0-9]"></xsd:pattern> </xsd:restriction> </xsd

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

MOXY- Multiple XSDs import the same schema definition- error: 'element' is already defined

自作多情 提交于 2019-12-24 09:27:59
问题 I have 3 XSDs linked together: schema1.xsd imports namespace="x:y:z" schemaLocation= "schemaDefinitions.xsd" includes schema2.xsd schema2.xsd imports namespace="x:y:z" schemaLocation= "schemaDefinitions.xsd" includes schema3.xsd schema3.xsd imports namespace="x:y:z" schemaLocation= "schemaDefinitions.xsd" These xsds are provided by an outside source and cannot be changed. Previously my project used standard JAXB with classes created at compile time. I currently am switching to Dynamic JAXB

Optional/mandatory element based on non-sibling element value using xsd:assert?

别说谁变了你拦得住时间么 提交于 2019-12-24 08:46:29
问题 I am trying to apply validation of mandatory and optional on one element of XML which is depending upon value of other element. Below is XSD: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" vc:minVersion="1.1"> <xs:element name="root" type="root"></xs:element> <xs:complexType name="root"> <xs:sequence> <xs:element name="P1Message" type="p1Message"> </xs:element> </xs:sequence> </xs:complexType

Location of drools-spring.xsd on git hub (or reliable source)

岁酱吖の 提交于 2019-12-24 08:44:17
问题 My project depends on drools 5.6.0.Final version. As part of that I'm trying to find a uri that I can rely for the drools-spring.xsd file. I'm trying to locate a reliable URI for that file I can reference, so that eclipses doesn't show issues, and so that spring can also intercept the requests and replace with the files in the jar as it sees fit. I can drill into drools-spring-5.6.0.Final.jar in eclipse and see the xsd files in org.drools.container.spring . I also can see the xsd file here:

xs:any wrapper xml schema validation

冷暖自知 提交于 2019-12-24 08:35:59
问题 Hi I'm trying to find a way to develop a schema that extends another schema validate XML structures. Lets say we have Schema A and it contains an extension point using the <xs:any> element So that we have a schema like this: Source.xsd : <xs:complexType name="AType"> <xs:complexContent> <xs:sequence> <xs:element name="B"/> <xs:any/> </xs:sequence> </xs:complexContent> </xs:complexType> <xs:element name="A" type="AType"/> Can I make another schema that will validate this XML with a reference

xsd validation is failing

馋奶兔 提交于 2019-12-24 08:24:06
问题 My xml validation is failing with the following reason: Failed to execute goal se.ericsson.jcat.ebs:xml-validation-plugin:1.0.2:validate (default) on project ebs-extensions: Unable to execute mojo: While parsing /home/xchoshu/latestWorkspace/ebs-extensions/src/main/resources/log4j2.xml, at file:/home/xchoshu/latestWorkspace/ebs-extensions/src/main/resources/log4j.xsd, line 18, column 64: src-resolve.4.1: Error resolving component 'ConfigurationType'. It was detected that 'ConfigurationType'

How should I use line number and column number to get element in XML in JAVA

泄露秘密 提交于 2019-12-24 08:11:11
问题 Hi I am using JAXB and Marshal/Unmarshal Schema Validation. I have a XML file and XSD schema for validation. Code are like this: Validation.java try{ SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = sf.newSchema(new File("./src/main/resources/validation.xsd")); JAXBContext jc = JAXBContext.newInstance(AddCustomer.class); Unmarshaller unmarshaller = jc.createUnmarshaller(); unmarshaller.setSchema(schema); unmarshaller.setEventHandler(new

Validating XML against schema - cannot find declaration of element

那年仲夏 提交于 2019-12-24 08:06:09
问题 I am quite new to XML validation so sorry for the elementary question. I have the following document: <tincan xmlns="http://projecttincan.com/tincan.xsd"> <activities> <activity id="TestActivity" type="course"> <name lang="und">MyCourse</name> <description lang="und"/> <launch lang="und">start.html</launch> </activity> <activity id="p001" type="objective"> <name lang="und">First Page</name> <description lang="und">First Page</description> </activity> </activities> </tincan> I am trying to

Xerces-c: XML file validation with xsd file c++

荒凉一梦 提交于 2019-12-24 07:58:11
问题 I am attempting to use Xerces-c. I have a .xsd scheme and want to use it to to validate an XML file. I've define the xsd file and an error handler, but for some reason the xsd is not throwing errors. Any insights to what I may be missing? XercesDOMParser* parser = new XercesDOMParser(); parser->setExternalNoNamespaceSchemaLocation("parser.xsd"); parser->setExitOnFirstFatalError(true); parser->setValidationConstraintFatal(true); parser->setValidationScheme(XercesDOMParser::Val_Auto); parser-