xsd

XML Schema: replacing imports with corresponding schema

…衆ロ難τιáo~ 提交于 2021-02-20 06:16:23
问题 I have a XML Schema that contains multiple imports which in turn contain imports. I need to generate semantically equal schema where all imports are inlined. I want to replace these: <xs:import namespace="http://some.name/" schemaLocation="./path/to/it.xsd"/> with the contents of referenced schemata. And I need to get output as a string, not as some internal representation. I tried Apache Xerces but did not find a way to write XSModel to a string. Is there? I tried Apache XmlSchema 2 but when

XML Schema: replacing imports with corresponding schema

前提是你 提交于 2021-02-20 06:13:58
问题 I have a XML Schema that contains multiple imports which in turn contain imports. I need to generate semantically equal schema where all imports are inlined. I want to replace these: <xs:import namespace="http://some.name/" schemaLocation="./path/to/it.xsd"/> with the contents of referenced schemata. And I need to get output as a string, not as some internal representation. I tried Apache Xerces but did not find a way to write XSModel to a string. Is there? I tried Apache XmlSchema 2 but when

XML Schema: replacing imports with corresponding schema

冷暖自知 提交于 2021-02-20 06:13:08
问题 I have a XML Schema that contains multiple imports which in turn contain imports. I need to generate semantically equal schema where all imports are inlined. I want to replace these: <xs:import namespace="http://some.name/" schemaLocation="./path/to/it.xsd"/> with the contents of referenced schemata. And I need to get output as a string, not as some internal representation. I tried Apache Xerces but did not find a way to write XSModel to a string. Is there? I tried Apache XmlSchema 2 but when

xsd:any + other elements inside choice

半城伤御伤魂 提交于 2021-02-19 11:19:49
问题 How can I achieve something like this: <xs:element name="getSubjectProductsResponse"> <xs:complexType> <xs:sequence minOccurs="0" maxOccurs="unbounded"> <xs:element name="Products"> <xs:complexType> <xs:sequence> <xs:element name="Date" type="xs:date"/> <xs:element name="Branch" type="xs:date" minOccurs="0"/> <xs:element name="State" type="xs:string"> <xs:element name="ProductDetail"> <xs:complexType> **<xs:choice> <xs:element name="Account" type="ns:TAccount"/> <xs:element name="KK" type="ns

xsd:any + other elements inside choice

泪湿孤枕 提交于 2021-02-19 11:17:55
问题 How can I achieve something like this: <xs:element name="getSubjectProductsResponse"> <xs:complexType> <xs:sequence minOccurs="0" maxOccurs="unbounded"> <xs:element name="Products"> <xs:complexType> <xs:sequence> <xs:element name="Date" type="xs:date"/> <xs:element name="Branch" type="xs:date" minOccurs="0"/> <xs:element name="State" type="xs:string"> <xs:element name="ProductDetail"> <xs:complexType> **<xs:choice> <xs:element name="Account" type="ns:TAccount"/> <xs:element name="KK" type="ns

XSD Error: Type is not declared, or is not a simple type

狂风中的少年 提交于 2021-02-19 04:46:26
问题 For this explanation I am using 2 different XSDs: customEntry.xsd : <?xml version="1.0" encoding="utf-8"?> <xs:schema id="customEntry" targetNamespace="http://tempuri.org/customEntry.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/customEntry.xsd" xmlns:mstns="http://tempuri.org/customEntry.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" > <xs:simpleType name="customEntry"> <xs:restriction base="xs:string"> <xs:pattern value="[A-Za-z0-9_%./]*"/> </xs:restriction> </xs

XSD design patterns

纵然是瞬间 提交于 2021-02-19 03:43:27
问题 I start with XML and almost all everything that is involved, working in XML Oxygen editor. I have met 3 basic design patterns of XSD schema and I don't know which one should suit my needs the most and in general. I want to create a large schema validating a XML file containing teams with players. My question is which one is the best and is considered to be the most well-arranged, user-friendliest and professional for my purpose and in general? Which one is practically the most common and what

Should I be using XSD 1.1 to build an open standard?

独自空忆成欢 提交于 2021-02-19 00:55:09
问题 We have been asked to put together a set of schemas for an open XML standard. XSD 1.0 would cope with most of the rules, but it would be a bit messy in places (especially to allow for extensibility) it would also rely on implementers reading free text descriptions of some rules in the form of annotations. Pretty much all of the rules could be implemented using XSD 1.1, however we are not sure if this would limit implementers unduly. So my question, is XSD 1.1 mature enough to be used in the

Error: It was detected that 'sites' has no namespace, but components with no target namespace are not referenceable from schema document

纵饮孤独 提交于 2021-02-18 10:56:05
问题 I have been working on this "advanced" schema for days with the flu and I cannot figure out why it keeps telling me that "sites" is not found. I re-read the chapter and even created a copy to experiment with (which worked before) and I do not understand. I am trying to import and combine schemas and I am not sure how to get it to work properly... Here are the errors: Ln 16 Col 84 - cvc-elt.1: Cannot find the declaration of element 'sites'. 1 Errors [Xerces-J 2.9.1] Validating XML Schema

How to extend a complex type in a different namespace without changing name

断了今生、忘了曾经 提交于 2021-02-18 07:09:09
问题 I have an existing namespace that I cannot change. I need to add elements to a complex type such that the resulting XML looks like this: Original XML: <?xml version="1.0"?> <Book xmlns="http://bookshop.com"> <Author>Frank Herbert</Author> <Title>Dune</Title> </Book> New XML: <?xml version="1.0"?> <Book xmlns="http://bookshop.com" xlmns:custom="http://custombookshop.com> <Author>Frank Herbert</Author> <Title>Dune</Title> <custom:Publisher>Ace</custom:Publisher> </Book> I have requirements that