xsd

Define simple type such as xsd:string in a new namespace?

本秂侑毒 提交于 2020-01-15 04:51:07
问题 This should be straight forward but everywhere I look it seems to have information only about complex types. Let's say that I have defined a namespace xmlns:address="http://...." . Now from what I have read it seams like I could do the following: <xsd:element name="street" type="address:sAdd"/> and then define the complex type <xsd:complexType name="sAdd"> . However, I cannot find what happens in the case of a non complex type like a xsd:string . My guess would be something like <xsd:element

Import namespace - Cannot resolve the name to a(n) 'type definition' component

房东的猫 提交于 2020-01-15 01:19:46
问题 Context: I am generating java classes from xsd files using maven-jaxb plugin. All my .xsd files are in a single location - src/main/resource directory. Problem: Everything works fine when xsd's don't reference/import other xsd's with a different target namespace. However when the following xsd below (with targetNamespace="http://www.companyA.com/someservice") imports another xsd filename.xsd from a different namespace (namespace="http://www.companyB.com/"), I get the above error: Cannot

Import namespace - Cannot resolve the name to a(n) 'type definition' component

痴心易碎 提交于 2020-01-15 01:19:18
问题 Context: I am generating java classes from xsd files using maven-jaxb plugin. All my .xsd files are in a single location - src/main/resource directory. Problem: Everything works fine when xsd's don't reference/import other xsd's with a different target namespace. However when the following xsd below (with targetNamespace="http://www.companyA.com/someservice") imports another xsd filename.xsd from a different namespace (namespace="http://www.companyB.com/"), I get the above error: Cannot

Use <xs:all> in XML schema's complexType?

我是研究僧i 提交于 2020-01-14 22:42:48
问题 I have the following XML complexType s defined: <xs:complexType name="loss"> <xs:all> <xs:element name="lossCause" type="xs:string"/> <xs:element name="lossDate" type="xs:dateTime"/> <xs:element name="lossDescription" type="xs:string"/> <xs:element name="lossLocation" type="address" minOccurs="0"/> <xs:element name="lossTime" type="xs:string" minOccurs="0"/> <xs:element name="officials" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element name="official" type="official" minOccurs="0"

Convert xs:string to java.util.UUID in jaxb

故事扮演 提交于 2020-01-14 08:15:50
问题 In jaxb, how do you convert a string in xsd to java.util.UUID? Is there a built-in data type converter or do I have to create my own custom converter? 回答1: This is much easier to do if you start with Java classes and use JAXB annotations. However, to do this using schema you must use a custom bindings file. Here is an example: Schema: (example.xsd) <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.com" xmlns="http://www.example

XML: Milestones or Elements that cross other elements

好久不见. 提交于 2020-01-13 20:17:09
问题 I'm working with OSIS (Open Scriptural Information Standard), an XML schema for describing scripture and related text. When I first looked at a sample of the XML I noticed some oddities that I have not seen in XML before. Mainly tags being closed followed by content that would logically belong inside the closed tag. After looking through the documentation, I found that they call this type of markup "Milestones." In this instance it is being used because a quote can begin in one verse and span

Where are the JAXB schemas published?

我的未来我决定 提交于 2020-01-13 14:01:39
问题 The JAXB 1.0 and JAXB 2.0 schemas are supposed to be available from the Bindings Schema for JAXB site. Unfortunately, it was last updated in 2005 and all of the links are broken. What is the official location of the schemas? There should be some authoritative source for v1.0, 2.0, 2.1 and 2.2. 回答1: JAXB XML Schemas JAXB 1.0 XML Schema JAXB 2.0 XML Schema It seems that there is no version 2.2 of the schema. The most recent would be 2.1. And an old post from the java.net forums (now defunct)

How to find XSD root element in C#

那年仲夏 提交于 2020-01-13 11:29:28
问题 Good day. As i know. There is a root element in XML file. But from the XSD file structure, it is not easy to get the root element value. Is there any method to do it? (I wouldn't like to take use of hard code to find XSD root element value in my project. i want to find the root element of "RootValueHere" <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="RootValueHere"> <xsd:complexType> <xsd:sequence> <xsd:element ref="DocumentInfo" minOccurs="1" maxOccurs="1" />

Unmarshaller and schema in JAXB

烈酒焚心 提交于 2020-01-13 11:08:09
问题 I have application that can save file in various formats (all of them is xml). So I should solve problem with determination in what format file have been saved. So, I see 2 solutions different formats have different schemas, so I could determine it by them. I set schemas in way that I get from here marshaller.setProperty(Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION, "bla-bla.xsd"); so I suppose I can get it using unmarshaller.getProperty(Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION) but it

XSD: How to redefine the data type of a simpleType eg. from xs:string to xs:integer

我与影子孤独终老i 提交于 2020-01-13 09:50:09
问题 I am trying to extend and tailor an external xsd schema (of the fixml standard). I need to change the data type of some of the elements, without touching the original schema, but by redefining it; but have been finding it exceedingly cumbersome. What exists: fields-base.xsd <xs:simpleType name="LastUpdateTime_t"> <xs:restriction base="UTCTimestamp"> <xs:simpleType> what I want it to become: <xs:simpleType name="LastUpdateTime_t"> <xs:restriction base="xs:string"> <xs:simpleType> What I have