LISTSERV mailing list manager LISTSERV 15.5

Help for XML-L Archives


XML-L Archives

XML-L Archives


View:

Next Message | Previous Message
Next in Topic | Previous in Topic
Next by Same Author | Previous by Same Author
Chronologically | Most Recent First
Proportional Font | Monospaced Font

Options:

Join or Leave XML-L
Reply | Post New Message
Search Archives


Subject: Re: Tieing a complex type to the attribute of an element
From: "G. Ken Holman" <[log in to unmask]>
Reply-To:General discussion of Extensible Markup Language <[log in to unmask]>
Date:Fri, 28 Jul 2006 10:14:27 -0400
Content-Type:text/plain
Parts/Attachments:
Parts/Attachments

text/plain (60 lines)


At 2006-07-28 08:53 -0400, Keith R Wood wrote:
>I am trying to define a document that has the 
>elements of a node, dependent on an attribute of the node.

That is called "a co-occurrence constraint".

>For example:
><PARTY type="lender">
>    :
>    :
></PARTY>
><PARTY type="seller">
>    :
>    :
><PARTY>
>
>I have a complex type that defines my buyer, and 
>a complex type that defines my lender.

Sounds to me like you are using W3C Schema ... 
that technology does not accommodate co-occurrence constraints.

>I want to define my schema so that the allowable 
>elements within PARTY are dependent on the type 
>attribute. I am not sure how to do this, or if it can be done.

In can be done with RELAX-NG:

element PARTY {
  (
   (
    attribute type { "lender" },
    ...
   ) |
   (
    attribute type ( "seller" },
    ...
   )
  )

I hope this helps.

. . . . . . . . . . Ken

p.s. given your example attribute values, are you 
perhaps trying to re-invent business documents 
such as invoice, purchase order, etc?  If so, you 
could consider using UBL: 
http://www.oasis-open.org/committees/ubl ... it 
is a license-free unencumbered suite of 31 
document types for business documents

--
UBL/XML/XSLT/XSL-FO training:         Vårø, Denmark 06-09-25/10-06
World-wide corporate, govt. & user group UBL, XSL, & XML training.
G. Ken Holman                 mailto:[log in to unmask]
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/l/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/l/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Back to: Top of Message | Previous Page | Main XML-L Page

Permalink



LISTSERV.HEANET.IE

CataList Email List Search Powered by the LISTSERV Email List Manager