comp.lang.ada
 help / color / mirror / Atom feed
* Using Quotes in Quotes (if you see what I mean
@ 2011-08-04 16:28 tonyg
  2011-08-04 17:47 ` J-P. Rosen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: tonyg @ 2011-08-04 16:28 UTC (permalink / raw)



I'm playing with some xml in ada. I want to use "d="3"" but
unfortunately the 3 is not contained (according to ada) within the
string. Is there a nice quick dirty solution I can use here ?

btw thanks to whoever recommended ada on debian, its awesome!



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Using Quotes in Quotes (if you see what I mean
  2011-08-04 16:28 Using Quotes in Quotes (if you see what I mean tonyg
@ 2011-08-04 17:47 ` J-P. Rosen
  2011-08-04 17:52   ` Jeffrey Carter
  2011-08-04 20:12 ` Ludovic Brenta
  2011-08-05  7:47 ` Simon Wright
  2 siblings, 1 reply; 5+ messages in thread
From: J-P. Rosen @ 2011-08-04 17:47 UTC (permalink / raw)


Le 04/08/2011 18:28, tonyg a �crit :
> 
> I'm playing with some xml in ada. I want to use "d="3"" but
> unfortunately the 3 is not contained (according to ada) within the
> string. Is there a nice quick dirty solution I can use here ?

There is a nice quick clean solution: quotes in strings must be doubled:
"d=""3"""

-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Adalog a d�m�nag� / Adalog has moved:
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Using Quotes in Quotes (if you see what I mean
  2011-08-04 17:47 ` J-P. Rosen
@ 2011-08-04 17:52   ` Jeffrey Carter
  0 siblings, 0 replies; 5+ messages in thread
From: Jeffrey Carter @ 2011-08-04 17:52 UTC (permalink / raw)


On 08/04/2011 10:47 AM, J-P. Rosen wrote:
>
> There is a nice quick clean solution: quotes in strings must be doubled:
> "d=""3"""

A more readable solution is to concatenate double-quote characters into the string:

"d=" & '"' & '3' & '"'

-- 
Jeff Carter
"This scene's supposed to be in a saloon, but
the censor cut it out. It'll play just as well
this way." [in a soda fountain]
Never Give a Sucker an Even Break
113



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Using Quotes in Quotes (if you see what I mean
  2011-08-04 16:28 Using Quotes in Quotes (if you see what I mean tonyg
  2011-08-04 17:47 ` J-P. Rosen
@ 2011-08-04 20:12 ` Ludovic Brenta
  2011-08-05  7:47 ` Simon Wright
  2 siblings, 0 replies; 5+ messages in thread
From: Ludovic Brenta @ 2011-08-04 20:12 UTC (permalink / raw)


tonyg <tonythegair@gmail.com> writes:
> btw thanks to whoever recommended ada on debian, its awesome!

Thanks for the compliment, I appreciate it and I'm sure the other Ada in
Debian maintainers do, too.

-- 
Ludovic Brenta.
Well-communicated tactics generate a selectivity. 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Using Quotes in Quotes (if you see what I mean
  2011-08-04 16:28 Using Quotes in Quotes (if you see what I mean tonyg
  2011-08-04 17:47 ` J-P. Rosen
  2011-08-04 20:12 ` Ludovic Brenta
@ 2011-08-05  7:47 ` Simon Wright
  2 siblings, 0 replies; 5+ messages in thread
From: Simon Wright @ 2011-08-05  7:47 UTC (permalink / raw)


tonyg <tonythegair@gmail.com> writes:

> I'm playing with some xml in ada. I want to use "d="3"" but
> unfortunately the 3 is not contained (according to ada) within the
> string. Is there a nice quick dirty solution I can use here ?

XML allows either single or double quotes, so

  <foo d="3"/>

and

  <foo d='3'/>

and for that matter

  <foo d = '3'/>

are semantically identical.

Have you looked at XML/Ada? http://libre.adacore.com/libre/tools/xmlada/



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-08-05  7:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-04 16:28 Using Quotes in Quotes (if you see what I mean tonyg
2011-08-04 17:47 ` J-P. Rosen
2011-08-04 17:52   ` Jeffrey Carter
2011-08-04 20:12 ` Ludovic Brenta
2011-08-05  7:47 ` Simon Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox