Loading ...
Sorry, an error occurred while loading the content.

Re: [pcgen-xml] Feat Question

Expand Messages
  • S Woodside
    ... Can a single element have multiple legal flags? Hmm... could separate by space, I think they do that in xsl:exclude-result-prefixes ... if it were an
    Message 1 of 15 , Nov 20 2:09 PM
    • 0 Attachment
      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:
      >> 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.

      Can a single element have multiple legal flags? Hmm... could separate
      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 like
      >> <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.

      Looks like you're assuming d20 system right ? (critrange /critmult
      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:

      <element name="damage">
      <attribute name="critrange"><text/></attribute>
      <attribute name="critmult"><text/></attribute>

      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?
      >> <size sizeref='medium' />
      >> vs.
      >> <size>medium</size>
      > 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
      > XSD,

      (and in Relax NG as well, enumerations can be applied to attributes or
      elements, and by reference, e.g.
      <ref name="sizeref"/>
      <define name="sizeref">

      > but I want the option of extending lists as needed. Schema
      > definition is a meta-level thing, the range of allowable values is
      > generally -- in this setting -- a data issue.

      I don't understand that part.

      >> Also, the first example has 13 "names" to remember (element +
      >> attribute
      >> 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.

      They "may" but you are defining a schema. The schema can specify that
      any given element may only contain text contents.

    Your message has been successfully submitted and would be delivered to recipients shortly.