Thread overview
std.xml
Jan 10, 2014
Jacob Carlborg
Jan 10, 2014
Dejan Lekic
Jan 13, 2014
Jacob Carlborg
Jan 14, 2014
Jacob Carlborg
January 10, 2014
The std.xml documentation states "This module is considered out-dated and not up to Phobos' current standards."

Does this mean that there is some other module I should use for xml parsing? Maybe one that is not in the standard distribution yet because it is beta?

I'd like to convert a xml-based tool I have written in another language to D as an experiment, but I'd like to use libraries that are likely to stay up to date.

Bascally it entails:
- reading a xml file
- build a dom for it
- optimize it
- write it back to another xml file

What options do I have in terms of actively maintained libraries that are suitable for this kind of utility? Beta quality is ok.
January 10, 2014
On 2014-01-10 01:02, "Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang@gmail.com>" wrote:
> The std.xml documentation states "This module is considered out-dated
> and not up to Phobos' current standards."
>
> Does this mean that there is some other module I should use for xml
> parsing? Maybe one that is not in the standard distribution yet because
> it is beta?
>
> I'd like to convert a xml-based tool I have written in another language
> to D as an experiment, but I'd like to use libraries that are likely to
> stay up to date.
>
> Bascally it entails:
> - reading a xml file
> - build a dom for it
> - optimize it
> - write it back to another xml file
>
> What options do I have in terms of actively maintained libraries that
> are suitable for this kind of utility? Beta quality is ok.

As far as I know, std.xml has been considered out of date for years, nothing has replaced it yet. I'm using the XML parser from Tango. It has a pull parser and an XML document API.

Tango will most likely not get any new features but there are developers here keeping it up to date with the latest compiler changes.

http://siegelord.github.io/Tango-D2/
https://github.com/SiegeLord/Tango-D2

-- 
/Jacob Carlborg
January 10, 2014
On Friday, 10 January 2014 at 00:02:14 UTC, Ola Fosheim Grøstad wrote:
> The std.xml documentation states "This module is considered out-dated and not up to Phobos' current standards."
>
> Does this mean that there is some other module I should use for xml parsing? Maybe one that is not in the standard distribution yet because it is beta?
>
> I'd like to convert a xml-based tool I have written in another language to D as an experiment, but I'd like to use libraries that are likely to stay up to date.
>
> Bascally it entails:
> - reading a xml file
> - build a dom for it
> - optimize it
> - write it back to another xml file
>
> What options do I have in terms of actively maintained libraries that are suitable for this kind of utility? Beta quality is ok.

Here is one of the alternatives: https://github.com/opticron/kxml/blob/master/source/kxml/xml.d
January 13, 2014
Thanks Jacob and Dejan!

I guess I can just build a generic DOM using one of those and replace the nodes I am interested with subclasses after the tree building process. I was thinking more of a library that allows me to say that a specific element (like "svg") should use a specific subclass, but "mapping" after building is ok too I suppose.
January 13, 2014
On 2014-01-13 18:47, "Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang@gmail.com>" wrote:
> Thanks Jacob and Dejan!
>
> I guess I can just build a generic DOM using one of those and replace
> the nodes I am interested with subclasses after the tree building
> process. I was thinking more of a library that allows me to say that a
> specific element (like "svg") should use a specific subclass, but
> "mapping" after building is ok too I suppose.

I'm not sure what you're trying to do but the implementation in Tango uses structs for the nodes so you cannot subclass that.

-- 
/Jacob Carlborg
January 14, 2014
On Monday, 13 January 2014 at 19:54:22 UTC, Jacob Carlborg wrote:
> I'm not sure what you're trying to do but the implementation in Tango uses structs for the nodes so you cannot subclass that.

I want to read XML files and replace the nodes I care about (shapes and transforms) with my own version so that I more easily can manipulate it (using a more efficient internal representation). The kxml library appears have a node class, so maybe that is the better option.
January 14, 2014
On 2014-01-14 09:57, "Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang@gmail.com>" wrote:

> I want to read XML files and replace the nodes I care about (shapes and
> transforms) with my own version so that I more easily can manipulate it
> (using a more efficient internal representation). The kxml library
> appears have a node class, so maybe that is the better option.

The Tango XML parser is one of the fastest XML parser available:

http://dotnot.org/blog/archives/2008/03/10/xml-benchmarks-updated-graphs-with-rapidxml/

-- 
/Jacob Carlborg