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

Subject: Re: XML - Is there a way to use parameters?
From: "Lech Rzedzicki" <xchaotic -at- gmail -dot- com>
To: "Brian Modreski" <brian -dot- modreski -at- openlogic -dot- com>
Date: Wed, 7 Feb 2007 12:23:40 +0100

XML is a Markup Language, used for describing content. Why do you want to
put logical operations where they don't belong? The concept is clearly
beyond me, after all if you want to do anything with XML, you have to
process it, be it via XSL Transformation, or parsing using libraries of your
choice in Perl, Java etc I think that if you have requirements to do such
operations, you should put them, where they belong - in the application
logic, not in the XML.
Furthermore your particular example shows use of CDATA and it's content is
not XML anymore. Such usage also goes again the whole idea of XML: document
should be readable to both machines and Human beings.
All this leads me to think that you don't need to use XML at and you might
be better off, at least performance-wise, with some binary encoding of the
data.
If you need to stick to W3.org standars, use XSLT to do what you describe
above and leave XML as readable as possible.



On 2/6/07, Brian Modreski <brian -dot- modreski -at- openlogic -dot- com> wrote:


I think my question may be misleading, because what I am thinking of as
parameters comes from a programming context, not an XML context. Not
only am I not sure how to do this, I'm not sure what the correct
terminology is, so I was hoping someone could point me in the right
direction.



What I would like to do is be able to define an XML entity that can have
a 'parameter' to be filled in when the entity is referenced.

For a really simple example, lets imagine that what I want is something
like this:



<!ENTITY Critter "<![CDATA[The animal: ]]> &animal; <![CDATA[ is a ]]>
&type; <![CDATA[.]]> ">



Which will then be used to display things like:

The animal: cat is a feline.

The animal: eagle is a bird.



So, I want &animal; and &type; to, rather than being entity references,
to be able to dynamically declared, such that I can write something like
this (keeping in mind that I am just inventing syntax here since I don't
know how to do this):

<!ENTITY Dog_desc "&Critter(dog, canine)">



Where the 'dog' and 'canine' will be used to populate the animal and
type references, so I will end up displaying the entity 'Dog_desc' as:



The animal: dog is a canine.



I use the term "parameters", because passing parameters is what I want
to do in programming terms.

Is this possible in XML? I'd appreciate any information.



Brian





Brian Modreski | Technical Writer
brian -dot- modreski -at- openlogic -dot- com



720 240 4531 | phone
720 240 4556 | fax
1 888 OpenLogic | toll free
www.openlogic.com <http://www.openlogic.com/>

OpenLogic, Inc.
Headquarters, Broomfield, Colorado 80021





^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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 xchaotic -at- gmail -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/xchaotic%40gmail.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.




--
Lech Rzedzicki
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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.


References:
XML - Is there a way to use parameters?: From: Brian Modreski

Previous by Author: Looking for DISA Templates
Next by Author: Re: Color-bar behind text in browsers
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