users@jaxb.java.net

Re: XSD annotation/documentation to Javadoc request

From: David Walend <david_at_walend.net>
Date: Fri, 08 Aug 2003 14:47:21 -0400

No word from the original poster in a week...

Here's the xslt I came up with to get my xsd:documentation into
jaxb:javadoc tags. If it looks like "my first xslt," that's because it
is. If you've got xslt skills, I'd love some help making it better. I'll
put it in the jaxb wiki once it's more refined.

Thanks,

Dave
--
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="node() | @*" >
        <xsl:copy>
            <xsl:apply-templates select="@* | node()">
            </xsl:apply-templates>
        </xsl:copy>
    </xsl:template>
<!-- todo combine with complexTypes -->
    <xsl:template match="xsd:element/xsd:annotation/xsd:documentation">
        <xsd:appinfo>
            <jaxb:class>
                <jaxb:javadoc>
                    <xsl:apply-templates select="node() | @*" 
 ></xsl:apply-templates>
                </jaxb:javadoc>
            </jaxb:class>
        </xsd:appinfo>
        <xsd:documentation>
            <xsl:apply-templates select="node() | @*" 
 ></xsl:apply-templates>
        </xsd:documentation>
    </xsl:template>
    <xsl:template match="xsd:complexType/xsd:annotation/xsd:documentation">
        <xsd:appinfo>
            <jaxb:class>
                <jaxb:javadoc>
                    <xsl:apply-templates select="node() | @*" 
 ></xsl:apply-templates>
                </jaxb:javadoc>
            </jaxb:class>
        </xsd:appinfo>
        <xsd:documentation>
            <xsl:apply-templates select="node() | @*" 
 ></xsl:apply-templates>
        </xsd:documentation>
    </xsl:template>
</xsl:stylesheet>
--
Date: Fri, 01 Aug 2003 07:59:48 -0600
From: David Walend <dwalend_at_ALPHATECH.COM>
Subject: XSD annotation/documentation to Javadoc request
Content-type: TEXT/PLAIN
Gary,
I'm new to xslt, and I need exactly what you describe. (I have lots of .xsd
with lots of documentation filled in, and want that documentation as
javadoc.) Can you post your xslt?
Thanks,
Dave
------------------
On Thu, 26 Jun 2003 13:46:52 -0400, Gary Gregory <ggregory_at_seagullsw.com> wrote:
>Perhaps I could! I'll give it a go. Right back at you: It would be nice if
>one could then tell XJC, please apply this stylesheet and use the result for
>the XSD and/or Bindings file input. FYI, we always use a separate binding
>file to keep our XSDs as "clean" as possible.
>
>Thanks,
>Gary
-- 
David Walend
david_at_walend.net
http://www.walend.net
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net