#!/local/bin/hs -gif
##
puts "Content-type: text/html\n\n" ;

puts "<pre>" ;

puts { "Parsing WSDL.XML, starting at ",time() } ;
xparse ( "wsdl.xml" ) ;
puts {time()," ...done" };

puts "</pre>" ;

puts "<p>" ;
puts "That was quick, now what can we find out about this schema?" ;

puts { "The top level elements and their types are: <br>" } ;
n = count schema ;
for ( i=0;i<n;i++ ) {
  list p = {
  	"Element ",
	list b = {
		str(schema[i])
	},
	" is a ",
	list i = {
		typeof(*schema[i])
	}
  } ;
  xdescribe p ;
  if ( typeof(*schema[i]) == "list" ) {
    puts { "...Its elements are: ",(*schema[i]+" ")} ;
    m = count ( *schema[i] ) ;
    for ( j=0;j<m;j++ ) {
	str token = str schema[i][j] ;
	str value = *schema[i][j] ;
	list blockquote  = { list p = { str(token)," = ",value } } ;
	xdescribe blockquote ;
    }
  }
}

puts {"<pre>Lastly, this is the Hyperscript structure<br>" } ;
describe schema ;