TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
Subject:Re: XML - Is there a way to use parameters? From:"Simon North" <Simon -dot- North -at- quintiq -dot- com> To:<brian -dot- modreski -at- openlogic -dot- com> Date:Tue, 06 Feb 2007 22:51:06 +0100
Hi Brian,
Yes, there is a way. It relies on treating the XML document as if it
were an SGML document
and using so-called parameter entities in the DTD.
The basic mechanism of a conditional section looks like this:
This lets the DTD control the document, but you don't want that. You
want the document to control
the DTD. You can do this by placing the entity definitions in the
internal DTD declaration in the XML
dcument. That would look something like this:
!DOCTYPE foo SYSTEM "yourExternal.dtd" [
<!ENTITY % CAT "INCLUDE" >
<!ENTITY % DOG "IGNORE" >
]>
<brian>
...
</brian>
As I remember it, in SGML (or XML pretending to be SGML) you could only
have 2 conditions; one on and one off.
If you want to add 'eagle', i.e. have 3 or more, I suspect you will have
to be a little more imaginative. You might be
able to achieve this with an XML Schema, but my personal choice would be
to see if you do it with Relax-NG (which basically takes the DTD and
gives it all the power of a Schema). Hopefully parameter entities will
put you on the right track, but fel free to contact me off list.
Regards, Simon.
This message contains information that may be privileged or confidential
and is the property of Quintiq. It is only intended for the person to
whom it is addressed. If you are not the intended recipient, you are not
authorized to read, print, retain, copy, disseminate, distribute or use
this message or any part thereof. If you have received this message in
error, please notify the sender immediately and delete all copies of
this message. Please note that e-mails are susceptible to change,
therefore they are not binding.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Create HTML or Microsoft Word content and convert to Help file formats or
printed documentation. Features include single source authoring, team authoring,
Web-based technology, and PDF output. http://www.DocToHelp.com/TechwrlList
Now shipping: Help & Manual 4 with RoboHelp(r) import! New editor,
full Unicode support. Create help files, web-based help and PDF in up
to 106 languages with Help & Manual: http://www.helpandmanual.com
---
You are currently subscribed to TECHWR-L as archive -at- infoinfocus -dot- com -dot-