🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Filip Rembiałkowski Thu, 20 Nov 2008 17:22
xsd pytanie
#10013
Author: Filip Rembiałkowski
Date: Thu, 20 Nov 2008 17:22
25 lines
1641 bytes
Czy można zrobić tak żeby element <instrument> musiał mieć atrybut id lub atrybut nazwa?

tzn. żeby schema zezwalała na

<instrument id="1" />
<instrument nazwa="fortepian" />
<instrument id="3" name="skrzypce" />

ale NIE zezwalała na
<instrument />


Ponadto chciałbym, aby w ramach rodzica (kontenera), zarówno instrument.id jak i instrument.nazwa były unikalne.
np. to jest ok:
<zestaw-instrumentow>
  <instrument id="1" />
  <instrument nazwa="fortepian" />
  <instrument id="2" name="skrzypce" />
</zestaw-instrumentow>
ale to już nie:
<zestaw-instrumentow>
  <instrument id="1" />
  <instrument id="1" name="bęben" />
</zestaw-instrumentow>
Re: xsd pytanie
#10014
Author: szomiz
Date: Thu, 20 Nov 2008 19:01
28 lines
1742 bytes
Użytkownik "Filip Rembiałkowski" <plk.zuber@gmail.com> napisał w wiadomości 
news:gg46pv$ehu$1@nemesis.news.neostrada.pl...
>
> Czy można zrobić tak żeby element <instrument> musiał mieć atrybut id lub 
> atrybut nazwa?
>
> tzn. żeby schema zezwalała na
>
> <instrument id="1" />
> <instrument nazwa="fortepian" />
> <instrument id="3" name="skrzypce" />

Nie da sie zrobic czegos takiego. Mozna (nieelegancko) kombinowac w 
przypadku, ze _albo_ @id _albo_ @nazwa.

> ale NIE zezwalała na
> <instrument />

A to juz kompletnie bez szans.

> <zestaw-instrumentow>
>  <instrument id="1" />
>  <instrument id="1" name="bęben" />
> </zestaw-instrumentow>

xs:unique

sz. 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads