OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] S-expressions vs. XML

[ Lists Home | Date Index | Thread Index ]

>>Actually, since S-expressions are isomorphic to the basic XML data model,
>>one could argue that X# == LISP :-)
> 
> I've heard this claim asserted many, many times,
> but I still don't believe it.

Let's see, an XML element is
      <x attr1=value1...>content</x>
So the attributes are an assoc list, the content is a (recursive) list 
of text strings or nodes. That could be represented in S-expr as
     (x ( (attr1 value1)... ) content )
If there are no attributes
     (x () content )

For example:
     <foo attr='text'><bar>hello</bar><bar a='b'>world</bar>!</foo>
would be
     (foo ( ('attr' 'text'))
          (bar () 'hello')
          (bar ( ('a' 'b')) 'world')
           '!'
      )

> h = XPath(ancestor::*/following-sibling::*).

Don't have enough neurons to figure out why the above is "tricky."
	/r$






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS