i hate xml. xml... has the optimal syntax: it compresses perfectly is much hyped, so must be...

Post on 30-Jan-2016

217 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

I Hate XML

XML...

has the optimal syntax: it compresses perfectly

is much hyped, so must be excellent

is well supported in Java, so available to anyone!

... and Perl support?

is used everywhere (help!)

XML...

has a complicated content describing formalism, described in schema's

is easily extensible

XML its noting more than Yet Another Syntax!!!!with an optional formalism

Need

XML HASHValidatingtranslation

Schema/ WSDL

file

validating complete simple fast

Need

XMLHASH Validatingtranslation

Schema/ WSDL

file

validating complete simple fast

Many (unmaintained) XML modules

XML::Smart Dec 2004WSDL::Generator Sep 2002 SOAP::Lite Jan 2006XML::asData Feb 2004 SOAP::WSDL Aug 2004XML::Generator Mar 2004XML::Quick May 2006XML::Records Nov 2001XML::Registry Oct 1998XML::Simple Jan 2005XML::Structured Apr 2006XML::Ximple Nov 2002 XML::Schema Jan 2003... more ...

Translate HASH to XML (and/or back) by

None complete, usually slow: they just DWIM

Examples

simpleType

<answer>42</answer>

answer => 42

Examples

complexType and complexType/complexContent

<zoo name=”Burgers Zoo”> <location>Arnhem</location> <animal>monkey</animal> <animal>donkey</animal></zoo>

zoo => { name => 'Burgers Zoo' , location => 'Arnhem' , animal => [ 'monkey', 'donkey' ] };

Examples

complexType/simpleContent

<price currency=”euro”>300</price>

price => { currency => 'euro' , _ => 300 };

Why another?

No run-time xpath searches: need for speed!

int should not become 1.9999, but long long 2

Integer is BigInt; must support minimal 18 digits- 121 21 363462 32461532 1

support for list, union, subtitutionGroup

Real qualified/unqualified name-space support

Examples

my $rules = XML::Compile::Schema->new($xml_string);my $read = $rules->compile(READER => 'mytype');my $hash = $read->($xml);

my $doc = XML::LibXML::Document->new('1.0', 'UTF-8');my $write = $rules->compile(WRITER => 'mytype');my $xml = $write->($doc, $hash);

create a reader; XML to HASH

create a writer; HASH to XML

based on XML::LibXML

Complete?

No, but...

many optimizations are implemented

needs real-life testing

W3C TRs are unreadable

only newest schema spec, prepared to extend.

Future

WSDL

SOAP

CPAN6

I Love YAML(Syck, SOX, SLiP)

What is the expected structure?

Is it documented?

Can it be checked?

XML to YAML

XML HASH

Schema

YAML

YAML validation

XML HASH

Schema

YAML

YAML schema's

XML HASH

XML

Schema

YAML

HASH YAML

I Hate XML

I Love YAML

I Hate XML

I Love YAML

It's just syntax!!!!

It's just syntax!!!!

The real problem is:design the data-structure in a waythat it can last for a very long time

AND DOCUMENT THAT

top related