Re: [pcgen-xml] Feat Question
- On Wednesday, November 19, 2003, at 10:39 PM, Keith Davies wrote:
> On Wed, Nov 19, 2003 at 08:35:43PM -0500, S Woodside wrote:Can a single element have multiple legal flags? Hmm... could separate
>> I understand better now. Hmm. It could also be <name
>> legal="ogl">Fighter</name> (to avoid having attributes that simply
>> contain "Yes")
> Except that there are several legal flags -- OGL, PI, D20 -- and
> potentially more.
by space, I think they do that in xsl:exclude-result-prefixes ... if it
were an element you could simply allow multiple <legal> elements ;-)
(and have them inherit as well)
>> So I really don't likeLooks like you're assuming d20 system right ? (critrange /critmult
>> <damage roll='1d8' critrange='2' critmult='2' />
>> to me a better compromise would be
>> <damage critrange='2' critmult='2'>1d8</damage>
> Gah. I don't see a need for compromise, to be honest. Either way
> (attribute-based or element-based) is reasonable, mixing them like this
> is ugly.
wouldn't make sense in a different system).
Consider: every <damage> element MUST have a dice roll content. Since
it's a single required content, then it makes sense to have it be an
element value. <damage> elements may optionally have critrange,
critmult, but those would have default values (1 and 2 respectively
IIRC) so if they were left out, the software would assume defaults.
So the distinction between element value and attribute value in this
case, is between required and optional data.
BTW, in Relax NG you would specify:
This would specify that the element contents of damage can only be
plain text so no worries about people inserting element contents
>> Also an empty element with only one attribute really makes no sense?(and in Relax NG as well, enumerations can be applied to attributes or
>> <size sizeref='medium' />
> Given that -- according to DTD at least -- references are enforceable
> only in attributes, it makes sense to keep them in attributes. I am
> fully aware that we can institute measures to constrain element text in
elements, and by reference, e.g.
> but I want the option of extending lists as needed. SchemaI don't understand that part.
> definition is a meta-level thing, the range of allowable values is
> generally -- in this setting -- a data issue.
>> Also, the first example has 13 "names" to remember (element +They "may" but you are defining a schema. The schema can specify that
>> names) so by some measure (and I think that's the best measure) the
>> second is actually easier to remember!
> In a manner of speaking. The way you've proposed means having a larger
> number of elements. Elements are more complex than attributes because
> they may contain text, attributes, and other elements.
any given element may only contain text contents.