std.xml2 (collecting features)

Craig Dillabaugh via Digitalmars-d digitalmars-d at puremagic.com
Sat May 9 06:04:57 PDT 2015


On Saturday, 9 May 2015 at 10:28:53 UTC, Joakim wrote:
> On Monday, 4 May 2015 at 18:50:43 UTC, Marco Leise wrote:
>> On Sunday, 3 May 2015 at 17:47:15 UTC, Joakim wrote:
>>
clip
>
>> Remember that while JSON is simpler, XML is not just a
>> structured container for bool, Number and String data. It
>> comes with many official side kicks covering a broad range of
>> use cases:
>>
>> XPath:
>> * allows you to use XML files like a textual database
>> * complex enough to allow for almost any imaginable query
>> * many tools emerged to test XPath expressions against XML 
>> documents
>> * also powers XSLT
>>   (http://www.liquid-technologies.com/xpath-tutorial.aspx)
>>
>> XSL (Extensible Stylesheet Language) and
>> XSLT (XSL Transformations):
>> * written as XML documents
>> * standard way to transform XML from one structure into another
>> * convert or "compile" data to XHTML or SVG for display in a 
>> browser
>> * output to XSL-FO
>>
>> XSL-FO (XSL formatting objects):
>> * written as XSL
>> * type-setting for XML; a XSL-FO processor is similar to a 
>> LaTex processor
>> * reads an XML document (a "Format" document) and outputs to a 
>> PDF, RTF or similar format
>>
>> XML Schema Definition (XSD):
>> * written as XML
>> * linked in by an XML file
>> * defines structure and validates content to some extent
>> * can set constraints on how often an element can occur in a 
>> list
>> * can validate data type of values (length, regex, positive, 
>> etc.)
>> * database like unique IDs and references
>
> These are all incredibly dumb ideas.  I don't deny that many 
> people may use these things, but then people use hammers for 
> all kinds of things they shouldn't use them for too. :)
>
>> I think XML is the most eat-your-own-dog-food language ever
>> and nicely covers a wide range of use cases.
>
> The problem is you're still eating dog food. ;)

I have to agree with Joakim on this.  Having spent much of this 
past
week trying to get XML generated by gSOAP (project has some legacy
code) to work with JAXB (Java) has reinforced my dislike for XML.

I've used things like XPath and XLST in the past, so I can 
appreciate
their power, but think the 'jobs' they perform would be better 
supported
elsewhere (ie. language specific XML frameworks).

In trying to pass data between applications I just want a simple 
way
of packaging up the data and ideally making 
serialization/deserialization
easy for me.  At some point the programmer working on these needs
to understand and validate the data anyway.  Sure you can use 
DTD/XML Schema to
handle the validation part, but it is just easier to deal with 
that
within you own code - without having to learn a 'whole new 
language', that
is likely harder to grok than the tools you would have at your 
disposal
in your language of choice.

Having said all that.  As much as I share Joakim's sentiment that 
I wish
XML would just go away,  there is a lot of it out there, and I 
think having good support in Phobos is very valuable so I thank 
Robert for his efforts.

Craig






More information about the Digitalmars-d mailing list