W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2002

ID & IDREF Schema Confusion

From: Andy Del Rio <adelrio@decadesystems.com>
Date: Mon, 25 Mar 2002 10:28:49 -0500
To: <xmlschema-dev@w3.org>
Message-ID: <PJEGLHABDMFKMBPDFGKAGEIECAAA.adelrio@decadesystems.com>
Good Morning All,

I'm a little confused on how to properly relate an entity to another in XML
Schema.  For example, I have would like to relate an entity I called
"BORROWER" to the "PARTY" element.  Below is an example.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:element name="LENDING_TRANSACTION">
			<xs:documentation>Comment describing your root element</xs:documentation>
				<xs:element name="PARTY" maxOccurs="unbounded">
							<xs:element name="BORROWER" maxOccurs="unbounded">
									<xs:attribute ref="Party_ID"/>
									<xs:attribute name="Borrower_Name" type="xs:string"/>
						<xs:attribute name="Party_ID" type="xs:IDREF" use="required"/>
			<xs:attribute name="Party_ID" type="xs:ID" use="required"/>
			<xs:attribute name="Name" type="xs:string" use="optional"/>

Basically, I am trying to covert a datamodel into an XML Schema.  Therefore,
it's imperative that I understand how to relate an entity to another for
reference purposes.

Does this looks like I'm referencing these element's correctly?


Received on Monday, 25 March 2002 10:28:51 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:55 UTC