On Fri, Feb 28, 2003 at 10:23:28PM +0900, Robert Klemme wrote:
> "Brian Candler" <B.Candler / pobox.com> schrieb im Newsbeitrag
> news:20030227205352.A91492 / linnet.org...
> > > http://www.pault.com/pault/pxml/xmlalternatives.html
> 
> Btw: I couldn't access this site (no DNS). Has anybody experienced the
> same?

Right now the DNS is OK (it maps to an IP) but the webserver is down:

$ telnet www.pault.com 80
Trying 66.33.50.162...
telnet: connect to address 66.33.50.162: Connection refused
telnet: Unable to connect to remote host

> > Not really "being displeased", but XML is a language for marking up text,
> > and doesn't by default have semantics for doing data-handling jobs (like
> > storing config files or serialising objects).
> 
> I'd say this is at least not 100% true.  XML application is typically
> distinguished as "document centric" and "data centric".

What I was trying to say is, the XML *spec* does not define any particular
"data centric" ways of working. I can have a very simple database (say one
table with rows of customers) and I can make up my own way of turning this
into XML; but someone else will have chosen a different way.

Some examples might be:

  <customers>
    <customer id=1>
      <name>Joe Bloggs</name>
      <address>1 Disk Drive</address>
    </customer>
  </customers>

  <customers>
    <customer>
      <id>
        <integer>1</integer>
      </id>
      <name>
        <string>Joe Bloggs</string>
      </name>
      <address>
        <string>1 Disk Drive</string>
      </address>
    </customer>
  </customers>

And here is the version which XML RPC would give:

irb(main):002:0> require 'xmlrpc/marshal'
true
irb(main):003:0> XMLRPC::Marshal.dump_call('addcust',[{"Name"=>"Joe Bloggs","Address"=>"1 Disk Drive"}])

<?xml version="1.0" ?>
<methodCall>
 <methodName>addcust</methodName>
 <params>
  <param>
   <value>
    <array>
     <data>
      <value>
       <struct>
        <member>
         <name>Name</name>
         <value>
          <string>Joe Bloggs</string>
         </value>
        </member>
        <member>
         <name>Address</name>
         <value>
          <string>1 Disk Drive</string>
         </value>
        </member>
       </struct>
      </value>
     </data>
    </array>
   </value>
  </param>
 </params>
</methodCall>

So this isn't a very good situation to be in: if I write (say) Ruby code to
implement the first case, and then I need to import the XML into (say) Perl,
I will have to rewrite everything from scratch in Perl, save the actual
low-level parsing of the XML.

> Personally I would model an XML schema for a hash different.

That's the point - it's (unfortunately) a personal choice - even for
something as simple as a hash.

With YAML, it's defined for you: and therefore, it will interoperate with
other YAML implementations, in the sense that a hash created on machine A
will be turned into the same hash on machine B. It also defines ways of
encoding common scalar data types, graph structures where the same object
appears at several points, user-defined types, and so forth.

Regards,

Brian.