XSD Recursive just one time..why
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 2
- Joined: Mon Sep 17, 2012 12:46 pm
XSD Recursive just one time..why
Hey guys,
I'm trying to build a schema with a recursive element inside that call's itself.
What happens is that is just recursive one time and not unlimited as I was expecting.
Can anyone help me ?!
Means that by click on the list AssetChild it opens another list, so far so good, but then if click on the next AssetChild it is not recursive anymore
, why is just limited to one call?
I'm trying to build a schema with a recursive element inside that call's itself.
What happens is that is just recursive one time and not unlimited as I was expecting.

Can anyone help me ?!
Code: Select all
<xs:element name="Response" type="Response"/>
<xs:complexType name="Response">
<xs:sequence>
<xs:element name="Asset" type="Recursive" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Recursive">
<xs:sequence>
<xs:element name="Id" type="xs:long" minOccurs="0"/>
<xs:element name="CreatedBy" type="xs:string" minOccurs="0"/>
<xs:element name="CreatedOn" type="xs:dateTime" minOccurs="0"/>
<xs:element name="ModifiedBy" type="xs:string" minOccurs="0"/>
<xs:element name="ModifiedOn" type="xs:dateTime" minOccurs="0"/>
<xs:element name="VersionNr" type="xs:long" minOccurs="0"/>
<xs:element name="AcctId" type="xs:long" minOccurs="0"/>
<xs:element name="AssetChild" type="Recursive" minOccurs="0" maxOccurs="unbounded"/> <------ Unlimited times
</xs:sequence>
</xs:complexType>

-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: XSD Recursive just one time..why
Hi,
The schema looks fine to me. If I create an XML instance with recursive AssetChild elements, it validates.
e.g.
If you edit the schema in Oxygen, in the Design mode, it will show you a loop icon next to the Recursive type of the AssetChild.
Regards,
Adrian
The schema looks fine to me. If I create an XML instance with recursive AssetChild elements, it validates.
e.g.
Code: Select all
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="recursive.xsd">
<Asset>
<AssetChild>
<AssetChild>
<AssetChild></AssetChild>
</AssetChild>
</AssetChild>
</Asset>
</Response>
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
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