Can Trang handle <mixed>?

P

Paul A. Hoadley

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?
 
B

Bob Foster

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
 
P

Paul A. Hoadley

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,006
Latest member
LauraSkx64

Latest Threads

Top