[jira] Commented: (OFBIZ-571) Move the various documentation pages to the OFBTECH space on docs.ofbiz.org

Posted by Nicolas Malin (Jira) on
URL: http://ofbiz.116.s1.nabble.com/jira-Created-OFBIZ-571-Move-the-various-documentation-pages-to-the-OFBTECH-space-on-docs-ofbiz-org-tp175787p175810.html


    [ https://issues.apache.org/jira/browse/OFBIZ-571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461915 ]

Chris Howe commented on OFBIZ-571:
----------------------------------

I don't have time at the moment to work on an xslt for xsd.  I know there are some out there, I didn't see one on an initial search that was that great (and even ones that looked promising, licensing wasn't mentioned).  It seems the better ones use a generator similar to javadocs to actually produce an html page along with javascript ( xsddoc - http://xframe.sourceforge.net/xsddoc/index.html and another is xs3p - the link is currently dead http://titanium.dstc.edu.au/xml/xs3p/)  Both the generators do some pretty work, but fall to the same problem javadoc does in that they actually have to be generated (this is a good solution if someone can keep up with it).  Because they're generated there is a possibility for them to be stale.  As opposed to a pure xslt stylesheet approach that is just applying a template to a file and will apply no matter how often you change the source.

For those that would like to play with xslt this extremely brief example should let you get a feeling of how to get started.

xslt file:


<?xml version="1.0"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
  exclude-result-prefixes="xs">

  <xsl:output method="html"/>

  <xsl:template match="xs:element[@name]">
    <table border="1" width="100%">
        <tr>
            <td width="25%">
                <xsl:value-of select="@name"/>
            </td>
            <td width="75%">
                <xsl:apply-templates select="xs:annotation"/>
            </td>
        </tr>
    </table>
   </xsl:template>

</xsl:transform>

This will do a simple two column table.  The first one giving the name of the element, the second one printing out all of the annotations (in most of ofbiz's xsd files this will only be the documentation text).  This example does fail slightly as it will print the doucumentation for xs:choices when available, but because xs:choices is not xs:element nothing will print in the first column for that row.

In your xsd file simply place at the top:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xml" href="available_path_to_your_xslt_file"?>

I'd be more than happy to help with questions as they come up, but I will not be able to work on a complete solution.  I have next to zero artistic ability and too much OCD for any amount of styling to be a small task ;)

> Move the various documentation pages to the OFBTECH space on docs.ofbiz.org
> ---------------------------------------------------------------------------
>
>                 Key: OFBIZ-571
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-571
>             Project: Apache OFBiz (The Open for Business Project)
>          Issue Type: Sub-task
>          Components: site
>            Reporter: Jacopo Cappellato
>         Assigned To: Jacques Le Roux
>         Attachments: AScreenCopy.PNG
>
>
> Move the various documentation pages and even the main Docs & Books page to the OFBTECH space on docs.ofbiz.org

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira