Can Trang handle <mixed>?

Paul A. Hoadley

Usenet Archive
Joined
Feb 8, 2001
Messages
30
Reaction score
0
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?
 

Bob Foster

Usenet Archive
Joined
Aug 14, 2002
Messages
220
Reaction score
0
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

Usenet Archive
Joined
Feb 8, 2001
Messages
30
Reaction score
0
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

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top