Can Trang handle <mixed>?

Discussion in 'XML' started by Paul A. Hoadley, Nov 22, 2003.

  1. Hello,

    I am trying to convert a RELAX NG schema to DTD using Trang. I am
    currently trying to add some inline elements to the schema, such as
    <emph> for marking emphasised text. Here is an excerpt from the
    schema:

    <define name="description">
    <element name="description">
    <mixed>
    <element name="emph">
    <text/>
    </element>
    </mixed>
    </element>
    </define>

    Trang complains:

    593: error: sorry, cannot handle this kind of "mixed"

    Am I botching the RELAX NG syntax there, or is this a limitation of
    Trang?


    --
    Paul.

    mailto:paulh_logicsquad_net (make the obvious substitutions)
    Paul A. Hoadley, Nov 22, 2003
    #1
    1. Advertising

  2. Paul A. Hoadley

    Bob Foster Guest

    What you have written in <mixed> is the equivalent of:

    <interleave>
    <element name="emph">
    <text/>
    </element>
    <text/>
    </interleave>

    (One instance of <emph> possibly bracketed by text.) This has no direct
    translation into a DTD, and is probably not what you mean, either. You
    probably intend to allow more than one instance of <emph> in the mixed
    sequence, which would be written:

    <mixed>
    <zeroOrMore>
    <element name="emph">
    <text/>
    </element>
    </zeroOrMore>
    </mixed>

    Trang will translate this to the expected:

    <!ELEMENT description (#PCDATA|emph)*>

    Bob Foster

    "Paul A. Hoadley" <> wrote in message
    news:...
    > Hello,
    >
    > I am trying to convert a RELAX NG schema to DTD using Trang. I am
    > currently trying to add some inline elements to the schema, such as
    > <emph> for marking emphasised text. Here is an excerpt from the
    > schema:
    >
    > <define name="description">
    > <element name="description">
    > <mixed>
    > <element name="emph">
    > <text/>
    > </element>
    > </mixed>
    > </element>
    > </define>
    >
    > Trang complains:
    >
    > 593: error: sorry, cannot handle this kind of "mixed"
    >
    > Am I botching the RELAX NG syntax there, or is this a limitation of
    > Trang?
    >
    >
    > --
    > Paul.
    >
    > mailto:paulh_logicsquad_net (make the obvious substitutions)
    Bob Foster, Nov 23, 2003
    #2
    1. Advertising

  3. On Sun, 23 Nov 2003 21:23:54 GMT, Bob Foster <> wrote:

    > This has no direct translation into a DTD, and is probably not what
    > you mean, either. You probably intend to allow more than one
    > instance of <emph> in the mixed sequence, which would be written:
    >
    ><mixed>
    > <zeroOrMore>
    > <element name="emph">
    > <text/>
    > </element>
    > </zeroOrMore>
    ></mixed>


    Thanks a lot, Bob. That is, indeed, what I meant. And it does, of
    course, work.


    --
    Paul.

    mailto:paulh_logicsquad_net (make the obvious substitutions)
    Paul A. Hoadley, Nov 23, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dietrich
    Replies:
    1
    Views:
    625
    Joe Smith
    Jul 22, 2004
  2. Fender Mussel
    Replies:
    0
    Views:
    543
    Fender Mussel
    Sep 14, 2004
  3. David Abrahams

    Help with RelaxNG and Trang (and Emacs)

    David Abrahams, Feb 9, 2005, in forum: XML
    Replies:
    0
    Views:
    561
    David Abrahams
    Feb 9, 2005
  4. Leon
    Replies:
    2
    Views:
    508
  5. =?ISO-8859-1?Q?KLEIN_St=E9phane?=
    Replies:
    3
    Views:
    440
    hanumizzle
    Oct 6, 2006
Loading...

Share This Page