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

Scott Bronson bronson@rinspin.com
20 Oct 2002 04:28:52 -0700


OK, things are finally starting to take shape.


First, some sample output generated from monodoc/class/mscorlib

    http://www.rinspin.com/~bronson/mono/statidoc-0.1/output/


There are a lot of broken links but that's because there are a lot of
missing files.  If you find a broken link for a file that isn't listed
in "Missing Doc Files", please tell me.  Also, I've only finished 1/2 a
summary page.  Now that I have summaries working, though, the rest
should be very quick to make.


All these files are generated using xslt.  They are named so that they
can be entirely regenerated from only the URL.  This makes them easy to
process dynamically.  The URL is of the format:

     file.xml,style.xsl[params].html

     i.e.   System/Object.xml,summary.xsl[l=en].html

(l=en tells the processor to use the the english xml files).


I used relative links so that the trees can be copied around without
breakage.  However, that means that some links will appear like

    ../.././en/System/Object.xml,summary.xsl[l=en].html

No problem: "/./" always marks the root in a relative URL.  To make any
relative URL absolute (to the root of the doc tree), delete everything
up to and including "/./".


To generate the files on your machine:
  - make sure you have the sablotron XML processor installed.
     (it's slower, but Xalan keeps bus erroring on me.)
  - download the tar file from
        http://www.rinspin.com/~bronson/mono/statidoc-0.1/
  - untar it in the monodoc directory (i.e. monodoc/statidoc-0.1)
  - run generate.pl.  Everything appears in the output directory.


TODO:

Methods, Fields, Properties pages.
Anchors, including overloaded functions.
What do we do about langwords?
Broken link checker
Figure out a way of merging different masterdocs into one tree


Weirdness: what is with System.Delegate.xml, line 34?  "%20null"????  I
had to special-case this in generate.pl.

    - Scott



On Thu, 2002-10-10 at 19:15, Miguel de Icaza wrote:
> Hello guys,
> 
>     I was going to do this manually, but the more code I wrote, the more
> I realized that this is the kind of thing that should really be done
> with Xslt.  But I do not know Xslt, nor "better practices" with Xslt,
> and I fear that this will have a fair amount of duplication. 
> 
>     I have attached the ECMA documentation for Type.xml, the idea of
> what I want to achieve is to process the XML document and extract a
> number of things from it:
> 
>         * The type page, something like:
> 
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemtypeclasstopic.asp
> 
>         * The methods page, something like:
> 
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemTypeMethodsTopic.asp
> 
>         * The fields page, something like:
> 
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemTypeFieldsTopic.asp
> 
>         * The properties page, something like:
> 
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemTypePropertiesTopic.asp
> 
>     Then the tricky ones, given a member (field, property, method,
> constructor, operator, do not worry about matching the method signature
> correctly, we will figure that out later), render the page with the
> data.  
> 
>     This is a sample for the property:
> 
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemtypeclassassemblytopic.asp
> 
>     Can someone help?
> 
> Miguel.