comp.lang.ada
 help / color / mirror / Atom feed
* SVG Doctype using xmlada
@ 2019-05-01  9:34 Bob Goddard
  2019-05-01 12:38 ` Simon Wright
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Bob Goddard @ 2019-05-01  9:34 UTC (permalink / raw)


Trying to get back into Ada after 28 years away and I am having trouble using xmlada.

I need to create an SVG file, but xmlada is sadly lacking in many areas, notably documentation.

Does anyone have example code in creating an SVG doctype XML file? Or any other doctype away from the norm to help me get started?

I don't really want to get into the whole DTD aspect of it all, just need the initial helping hand...


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

* Re: SVG Doctype using xmlada
  2019-05-01  9:34 SVG Doctype using xmlada Bob Goddard
@ 2019-05-01 12:38 ` Simon Wright
  2019-05-01 13:06   ` Bob Goddard
  2019-05-01 13:01 ` Olivier Henley
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Simon Wright @ 2019-05-01 12:38 UTC (permalink / raw)


Bob Goddard <1963bib@googlemail.com> writes:

> Trying to get back into Ada after 28 years away and I am having
> trouble using xmlada.
>
> I need to create an SVG file, but xmlada is sadly lacking in many
> areas, notably documentation.
>
> Does anyone have example code in creating an SVG doctype XML file? Or
> any other doctype away from the norm to help me get started?
>
> I don't really want to get into the whole DTD aspect of it all, just
> need the initial helping hand...

I'm not sure it's what you're looking for, but try
https://github.com/simonjwright/asis2xml - I haven't 'use'd DOM or
children, whch should make it easier to see where the xmlada calls come.

Start at
https://github.com/simonjwright/asis2xml/blob/master/asis2xml.adb#L111


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

* Re: SVG Doctype using xmlada
  2019-05-01  9:34 SVG Doctype using xmlada Bob Goddard
  2019-05-01 12:38 ` Simon Wright
@ 2019-05-01 13:01 ` Olivier Henley
  2019-05-01 13:07   ` Bob Goddard
  2019-05-01 13:08 ` Shark8
  2019-05-02  4:40 ` gautier_niouzes
  3 siblings, 1 reply; 10+ messages in thread
From: Olivier Henley @ 2019-05-01 13:01 UTC (permalink / raw)


Hi Bob.

A quick search at https://github.com/ohenley/awesome-ada got me 5 packages claiming to support xml. Now do they provide what you need is up to you...

This one looks like a capable straight shooter: https://github.com/Componolit/SXML

Please let us know if you end up with some SVG utilities. I will add it to the awesome list.

thx.





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

* Re: SVG Doctype using xmlada
  2019-05-01 12:38 ` Simon Wright
@ 2019-05-01 13:06   ` Bob Goddard
  2019-05-01 15:10     ` Simon Wright
  0 siblings, 1 reply; 10+ messages in thread
From: Bob Goddard @ 2019-05-01 13:06 UTC (permalink / raw)


I think what it is, is that xmlada produces a null document type, as the meaningful header(s) are/is:
<?xml version="1.0"?>


whereas I need headers similar to:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">

I assume I have to copy & extend all the DOM core document files & mod the private type DOM_Implementation.

Plplot would have been useful, except that it does not support cdata, scripts & tooltips etc. Plplot does not seem to use the xml libraries at all, instead creating the svg/xml file manually.


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

* Re: SVG Doctype using xmlada
  2019-05-01 13:01 ` Olivier Henley
@ 2019-05-01 13:07   ` Bob Goddard
  0 siblings, 0 replies; 10+ messages in thread
From: Bob Goddard @ 2019-05-01 13:07 UTC (permalink / raw)


On Wednesday, 1 May 2019 14:01:37 UTC+1, Olivier Henley  wrote:
> Hi Bob.
> 
> A quick search at https://github.com/ohenley/awesome-ada got me 5 packages claiming to support xml. Now do they provide what you need is up to you...
> 
> This one looks like a capable straight shooter: https://github.com/Componolit/SXML
> 
> Please let us know if you end up with some SVG utilities. I will add it to the awesome list.
> 
> thx.

Thanks Olivier, I'll have a look.


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

* Re: SVG Doctype using xmlada
  2019-05-01  9:34 SVG Doctype using xmlada Bob Goddard
  2019-05-01 12:38 ` Simon Wright
  2019-05-01 13:01 ` Olivier Henley
@ 2019-05-01 13:08 ` Shark8
  2019-05-02  4:40 ` gautier_niouzes
  3 siblings, 0 replies; 10+ messages in thread
From: Shark8 @ 2019-05-01 13:08 UTC (permalink / raw)


On Wednesday, May 1, 2019 at 3:34:40 AM UTC-6, Bob Goddard wrote:
> Trying to get back into Ada after 28 years away and I am having trouble using xmlada.

Welcome back.


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

* Re: SVG Doctype using xmlada
  2019-05-01 13:06   ` Bob Goddard
@ 2019-05-01 15:10     ` Simon Wright
  2019-05-01 17:48       ` Bob Goddard
  0 siblings, 1 reply; 10+ messages in thread
From: Simon Wright @ 2019-05-01 15:10 UTC (permalink / raw)


Bob Goddard <1963bib@googlemail.com> writes:

> I think what it is, is that xmlada produces a null document type, as
> the meaningful header(s) are/is:
> <?xml version="1.0"?>
>
>
> whereas I need headers similar to:
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
> "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
>
> I assume I have to copy & extend all the DOM core document files & mod
> the private type DOM_Implementation.

I'm using commit f4a8216 (the latest) from
https://github.com/AdaCore/xmlada.

Using

   DOM.Core.Nodes.Print (Doc,
                         Print_Comments => True,
                         Print_XML_PI   => True,
                         EOL_Sequence   => "");

I get <?xml version="1.0" encoding="utf-8"?>; output at
dom-core-nodes.adb:1436.

Are you sure you need standalone="no"?
https://www.quora.com/What-does-Xml-version-1-0-encoding-utf-8-standalone-yes-mean
says it could be left out with the same effect.

I think for the DOCTYPE you'd implement
DOM.Core.Document_Types.Create_Document_Type, which currently returns
null, and again you'd need to modify DOM.Core.Nodes.Write (:1450).

That's just a quick look ...


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

* Re: SVG Doctype using xmlada
  2019-05-01 15:10     ` Simon Wright
@ 2019-05-01 17:48       ` Bob Goddard
  0 siblings, 0 replies; 10+ messages in thread
From: Bob Goddard @ 2019-05-01 17:48 UTC (permalink / raw)


On Wednesday, 1 May 2019 16:10:50 UTC+1, Simon Wright  wrote:
[...]
> I get <?xml version="1.0" encoding="utf-8"?>; output at
> dom-core-nodes.adb:1436.
> 
> Are you sure you need standalone="no"?
> https://www.quora.com/What-does-Xml-version-1-0-encoding-utf-8-standalone-yes-mean
> says it could be left out with the same effect.
> 
> I think for the DOCTYPE you'd implement
> DOM.Core.Document_Types.Create_Document_Type, which currently returns
> null, and again you'd need to modify DOM.Core.Nodes.Write (:1450).
> 
> That's just a quick look ...

Yup, standalone=no was a bad example. It should have read yes.

I've extended dom-core-nodes.ad? & dom-core.ad? by making DOM_Implementation no longer null. Seems the logical place to put it. I'll post the code to the maintainers later and see if they are interested.

As for DOM.Core.Document_Types.Create_Document_Type, I did see that, but as it was null, I glossed over it. Need to have another look.

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

* Re: SVG Doctype using xmlada
  2019-05-01  9:34 SVG Doctype using xmlada Bob Goddard
                   ` (2 preceding siblings ...)
  2019-05-01 13:08 ` Shark8
@ 2019-05-02  4:40 ` gautier_niouzes
  2019-05-02 20:24   ` Bob Goddard
  3 siblings, 1 reply; 10+ messages in thread
From: gautier_niouzes @ 2019-05-02  4:40 UTC (permalink / raw)


You'll find an example of SVG file creation in Ada in the following project:

https://sourceforge.net/projects/ada-bar-codes/

HTH
G.


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

* Re: SVG Doctype using xmlada
  2019-05-02  4:40 ` gautier_niouzes
@ 2019-05-02 20:24   ` Bob Goddard
  0 siblings, 0 replies; 10+ messages in thread
From: Bob Goddard @ 2019-05-02 20:24 UTC (permalink / raw)


On Thursday, 2 May 2019 05:40:55 UTC+1, gautier...@hotmail.com  wrote:
> You'll find an example of SVG file creation in Ada in the following project:
> 
> https://sourceforge.net/projects/ada-bar-codes/
> 
> HTH
> G.

That's just a simplistic way of doing it, not using the xml libs. That way was always a last resort.


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

end of thread, other threads:[~2019-05-02 20:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-01  9:34 SVG Doctype using xmlada Bob Goddard
2019-05-01 12:38 ` Simon Wright
2019-05-01 13:06   ` Bob Goddard
2019-05-01 15:10     ` Simon Wright
2019-05-01 17:48       ` Bob Goddard
2019-05-01 13:01 ` Olivier Henley
2019-05-01 13:07   ` Bob Goddard
2019-05-01 13:08 ` Shark8
2019-05-02  4:40 ` gautier_niouzes
2019-05-02 20:24   ` Bob Goddard

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