Re: XML - Is there a way to use parameters?

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:

<![ INCLUDE [
... dog-only definitions
]]>
<![ IGNORE [
... cat-only definitions
]]>

You need to be able to switch it though, so you'd need to use a
parameter entity, and the syntax would
look something like this:

<![ %CAT; [
... cat definitions
]]>
<![ %DOG; [
... dog-only definitions
]]>

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 &amp; 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 &amp; Manual: http://www.helpandmanual.com

---
You are currently subscribed to TECHWR-L as archive -at- infoinfocus -dot- com -dot-

To unsubscribe send a blank email to
techwr-l-unsubscribe -at- lists -dot- techwr-l -dot- com
or visit http://lists.techwr-l.com/mailman/options/techwr-l/archive%40infoinfocus.com


To subscribe, send a blank email to techwr-l-join -at- lists -dot- techwr-l -dot- com

Send administrative questions to admin -at- techwr-l -dot- com -dot- Visit
http://www.techwr-l.com/techwhirl/ for more resources and info.


Previous by Author: re: Indexes in the PDF era
Next by Author: RE: term need: regarding software development
Previous by Thread: Re: XML - Is there a way to use parameters?
Next by Thread: Re: XML - Is there a way to use parameters?


What this post helpful? Share it with friends and colleagues:


Sponsored Ads