[relaxng-user] recursion with an except.
Alex Peshkov
peshkov at renderx.com
Wed Feb 25 19:42:03 ICT 2004
Hello, David.
You just can't do it this way in RelaxNG. <ref/> is an empty element
(you can see appropriate message issued by jing). The only possible
solution I can think of is to redefine content of the definition using
a trick with inclusion of separate grammar:
inlines.rng:
<grammar>
<define name="Inline.group">
<choice>
<text/>
<ref name="Em"/>
<ref name="Strong"/>
...
<choice>
</define>
<define name="Em">
<notAllowed/>
</define>
...
</grammar>
driver.rng:
<grammar>
<include href="inline.rng"/>
...
<define name="Inline-content">
<include href="inline.rng">
<define name="Em">
<element name="em">
<parentRef name="Inline.group"/>
</element>
</define>
...
</include>
</define>
...
</grammar>
Hope this helps.
Best regards,
Alexander Peshkov mailto:peshkov at renderx.com
RenderX
DProu> I have a definition of a bunch of inlines.
DProu> I want to exclude recursion, say in the em element
DProu> <define name="Em">
DProu> <element name="em">
DProu> <ref name="Inline.group">
DProu> <except>
DProu> <ref name="Em"/>
DProu> </except>
DProu> </ref>
DProu> </element>
DProu> </define>
DProu> Seemed about right, but jing tells me
DProu> inlines.rng:120: error: found "except" element but expected empty content
DProu> Is it necessary to list out all the elements,
DProu> making the definition redundant?
DProu> Since its mixed content, I'm unsure if this is possible anyway,
DProu> from the Inline.group definition.
DProu> Any suggestions please?
DProu> TIA, DaveP
DProu> Regards DaveP.
DProu> **** snip here *****
DProu> -
DProu> DISCLAIMER:
DProu> NOTICE: The information contained in this email and any attachments is
DProu> confidential and may be privileged. If you are not the intended
DProu> recipient you should not use, disclose, distribute or copy any of the
DProu> content of it or of any attachment; you are requested to notify the
DProu> sender immediately of your receipt of the email and then to delete it
DProu> and any attachments from your system.
DProu> RNIB endeavours to ensure that emails and any attachments generated by
DProu> its staff are free from viruses or other contaminants. However, it
DProu> cannot accept any responsibility for any such which are transmitted.
DProu> We therefore recommend you scan all attachments.
DProu> Please note that the statements and views expressed in this email and
DProu> any attachments are those of the author and do not necessarily represent
DProu> those of RNIB.
DProu> RNIB Registered Charity Number: 226227
DProu> Website: http://www.rnib.org.uk
DProu> _______________________________________________
DProu> relaxng-user mailing list
DProu> relaxng-user at relaxng.org
DProu> http://relaxng.org/mailman/listinfo/relaxng-user
Best regards,
Alexander Peshkov mailto:peshkov at renderx.com
RenderX
More information about the relaxng-user
mailing list