Announcement: Typeful [x]html combinators -- pre-release 0

Ketil Malde ketil+haskell at ii.uib.no
Thu Jan 10 04:05:49 EST 2008


Mattias Bengtsson <moonlite at dtek.chalmers.se> writes:

>> If so, how do you specify where foreign namespaces
>> are legal?  If the top-level DTD specifies -- and thus needs to know,
>> in advance, the details about -- the sub-namespaces, then what's the
>> point of namespaces at all? 

> This is exactly what i'm also having trouble understanding. Need to read
> more!

>> I'm confused.

> So am i. :)

Well - I just found some links.  A schema can contain import
statements, basically #include'ing other schemas:

  http://lists.xml.org/archives/xml-dev/200211/msg00880.html

For DTD's, I think you'd have to write the DTD to use the prefix
(I forget the proper name for it) and the local name - but I've lost
the link that said so.

So for both Schema and DTD validation, you'd need to know in advance
all the tags you'd like to use, but Schema lets you more easily reuse
'chunks' of the document definition (or XML grammar).

Stray thought:

I'm currently working on a storage for various data types.  Due to the
variety, I'm considering XML rather than SQL, and it occurs to me that
SQL relations are product types, while XML defines an algebraic data
type.

E.g., we can straightforwardly translate:

<!ELEMENT element-name (child-name)> 
          => data ElementName = ElementName ChildName
<!ELEMENT element-name (child1,child2)> 
          => data ElementName = ElementName Child1 Child2
<!ELEMENT element-name (child?)> 
          => data ElementName = ElementName (Maybe Child)
<!ELEMENT element-name (child*)> 
          => data ElementName = ElementName [Child]
<!ELEMENT element-name (child1|child2)> 
          => data ElementName = ElementName1 Child1 | ElementName2 Child2

Well - presumably, something like that is exactly what you do to
produce verifiable XML, right?  In my mind, the 'algebraic' data types
have always been a practical thing, but I suppose there is a formal
framework where both Haskell data types and XML are unified as
examples of 'algebraically complete' systems?

Basica stuff I guess, it just never occurred to me to combine
the terms 'universal algebra' and 'XML' before.  :-)

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants


More information about the Libraries mailing list