Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.text.xml > #777

Re: Specifying an executable string in XML terms

From Peter Flynn <peter@silmaril.ie>
Newsgroups comp.text.xml
Subject Re: Specifying an executable string in XML terms
Date 2014-07-13 23:44 +0100
Message-ID <c2ggekFpqp3U1@mid.individual.net> (permalink)
References <lon0oi$371$1@speranza.aioe.org> <lon0vm$371$2@speranza.aioe.org>

Show all headers | View raw


On 06/28/2014 07:19 PM, Victor Porton wrote:
> Victor Porton wrote:
> 
>> The following XML fragment is intended to specify that python executable
>> should be called with a script provided by a user:
>>
>> There are two variants, which of the two is better? Why?
>>
>> 1.
>>
>> <command>python %s</command>
>>
>> 2.
>>
>> <command>python <script/></command>
> 
> The first variant is easier to process with software which reads the XML, 
> because it is simpler to manipulate with strings than with XML data.

It depends what you are trying to do.

If you are writing documentation for humans, then consider something like:

   <command>python <replaceable>filename.py</replaceable></command>

This lets you highlight the mnemonic according to convention (italics,
underline, etc), and you can use the same in the text, eg

  <para>To run a Python program (script), type the command followed by
the name of the script, eg <command>python
<replaceable>filename.py</replaceable></command> (replacing
<replaceable>filename.py</replaceable> by the name of your program).</para>

On the other hand, if you are writing a document from which actual code
is going to be extracted, you probably want to use something like DocBook's

	<cmdsynopsis>
	  <command>python</command>
	  <arg>%s</arg>
	</cmdsynopsis>

so that it is quite unambiguous. Don't skimp on markup: lack of it will
come back and bite you later :-)

///Peter
-- 
XML FAQ: http://xml.silmaril.ie/

Back to comp.text.xml | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Specifying an executable string in XML terms Victor Porton <porton@narod.ru> - 2014-06-28 21:15 +0300
  Re: Specifying an executable string in XML terms Victor Porton <porton@narod.ru> - 2014-06-28 21:19 +0300
    Re: Specifying an executable string in XML terms Peter Flynn <peter@silmaril.ie> - 2014-07-13 23:44 +0100
  Re: Specifying an executable string in XML terms richard@cogsci.ed.ac.uk (Richard Tobin) - 2014-06-29 11:40 +0000

csiph-web