[Mono-list] Help needed with XSLT transformations (documentation browser)

Scott Bronson bronson@rinspin.com
14 Oct 2002 00:22:39 -0700


--=-MIBDmR7iduu5GJDQEAUq
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

I played around with mscorlib.xml today.  Enclosed are some files to
generate a really raw set of index pages.



On Sat, 2002-10-12 at 15:59, Miguel de Icaza wrote:
> Well, the various "scripts" should be used to generate different
> presentations (class info, complete class dumping, specific member,
> member summary).  So just assume that you can jump to all of those entry
> points.

OK, right now they're generating static html files, locally browsable. 
All the information needed to generate the files is contained in the
link, i.e. 


> I would like to only ship the XML files, and have our documentation
> browser generate the various presentations on the flight using the XSLT
> transformations. 

It takes both Sablotron and xalan C++ the better part of a second just
to read in mscorlib.xml (Athlon 1800, 512 Mb RAM).  Breakdown: parsing
the input files takes 900 ms, the transform takes 150 ms.  I can cut
this down by doing a pre-transform and caching the results.

Where did mscorlib.xml come from?  Can we add class summaries to it? 
Right now, if I want to create a page that lists classes and their
summaries


> > 3) Where can I find the other XML files?  Is there a DTD or spec
> >    or something?  I've only tested against Types.xml.
> 
> I have now checked in all the XML files into the Mono CVS repository in
> the module `monodoc' (I had forgotten to push it to the anoncvs servers,
> but am forcing a push right now).


--=-MIBDmR7iduu5GJDQEAUq
Content-Disposition: attachment; filename=generate-index.pl
Content-Transfer-Encoding: quoted-printable
Content-Type: text/x-perl; name=generate-index.pl; charset=ANSI_X3.4-1968

#!/usr/bin/perl -w

my $xml =3D 'mscorlib.xml';

open(FH, "xalan -Q -XSL list-namespaces.xsl -IN $xml |")
  or die "Could not list namespaces: $!\n";
my @arr =3D <FH>;
close FH;

print "Generating (root)\n";
system("xalan -Q -XSL show-namespace.xsl -IN $xml -OUT show-namespace.xsl--=
[].html") =3D=3D 0 or die "Could not run xalan: returned $?\n";

for(@arr)
{
   chomp;
   print "Generating $_\n";
   system("xalan -Q -XSL show-namespace.xsl -IN $xml -PARAM ns \"'$_'\" -OU=
T show-namespace.xsl--[$_].html") =3D=3D 0 or die "Could not run xalan: ret=
urned $?\n";
}



--=-MIBDmR7iduu5GJDQEAUq--