www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - std.xml

reply "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= writes:
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.
Jan 09 2014
next sibling parent Jacob Carlborg <doob me.com> writes:
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
Jan 09 2014
prev sibling parent reply "Dejan Lekic" <dejan.lekic gmail.com> writes:
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
Jan 10 2014
parent reply "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= writes:
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.
Jan 13 2014
parent reply Jacob Carlborg <doob me.com> writes:
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
Jan 13 2014
parent reply "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= writes:
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.
Jan 14 2014
parent Jacob Carlborg <doob me.com> writes:
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
Jan 14 2014