Circular References Inside a Schema
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 2
- Joined: Tue Jul 11, 2006 12:07 am
Circular References Inside a Schema
Hi,
I need help with a XMLBeans based App that I'm developing for a client. My client right now stores his info in some
XML's which he currently uses in a .NET based App :
I'm trying to create a XSD for that structure, however I'm stuck with the division reference inside the subdivisions. Is there any way to support this "circular" reference in XSD [/code]
I need help with a XMLBeans based App that I'm developing for a client. My client right now stores his info in some
XML's which he currently uses in a .NET based App :
Code: Select all
<company>
<division>
<manager/>
<email/>
<subdivisions>
<division>
...
</division>
</subdivisions>
<division>
</company
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
There is no problem to express such a structure in XML Schema. oXygen can generate an XML schema automatically from your sample file, for instance using the "Convert to" action and selecting XML Schema oXygen gives the following schema file that validates your XML sample:
Best Regards,
George
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="company" type="division"/>
<xs:complexType name="division">
<xs:sequence>
<xs:element ref="division"/>
</xs:sequence>
</xs:complexType>
<xs:element name="division">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="email"/>
<xs:element ref="manager"/>
<xs:element ref="subdivisions"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="email">
<xs:complexType/>
</xs:element>
<xs:element name="manager">
<xs:complexType/>
</xs:element>
<xs:element name="subdivisions" type="division"/>
</xs:schema>
George
George Cristian Bina
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service