XML and Erlang

Michael McDaniel erlang@REDACTED
Tue Jun 21 04:23:52 CEST 2005


On Mon, Jun 20, 2005 at 10:28:42PM +0200, Tony Rogvall wrote:
> 
> 20 jun 2005 kl. 17.32 skrev Joe Armstrong (AL/EAB):
> 
> >
> >    Suppose I write
> >
> >    <!ELEMENT a (b,c,d)>
> >
> 
> Suppose I write
> 
>     <!ELEMENT a ((b & c & d)* | (c, d))>
> 
> Add some funky XHTML style INCLUDE/IGNORE macros :-)
> 
> But yes I think that many of the XML ELEMENTS could be mapped to  
> records, and I usually do this
> by hand.
> 
> I HATE XML but have to live with it every day ....
> The Industry (name any kind) use XML without any kind of DTD. And if  
> they do they tend to use it as
> some odd kind of comment. I have tons of XML that does not pass  
> through any XML validation.
> I have even seen XML (thanks luke) that contained inlined DTD that  
> did not validate!!!
> 
> This means that tools must normally turn off validation and then the  
> guessing starts ;-)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
What I did in a recent project is to {validate, true} and then when
it fails log the error and retry with {validate, false}.  Hopefully 
the {validate, false} data gets processed ok in my remaining code 
(it has so far) and the error is documented for when it doesn't.
Happily, the service provider of the XML data and DTD have been responsive
to fix the DTD.  It was only the occasional data that failed to validate so
the retries were seldom.


~Michael


> 
> Happy XML hacking everyone
> 
> /Tony
> 



More information about the erlang-questions mailing list