users@jaxb.java.net

RE: XSD annotation/documentation to Javadoc request

From: Robert Koberg <rob_at_koberg.com>
Date: Fri, 8 Aug 2003 12:17:28 -0700

Hi,

Agood first attempt, but your XSL below should not even get parsed. You have
not declared the jaxb namespace. I think you want something like (not
tested):


<?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"
  xmlns:jaxb="whatever">

  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  
  <xsl:template match="node()|@*">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>
  
  <xsl:template match="xsd:documentation">
    <xsd:appinfo>
      <jaxb:class>
        <jaxb:javadoc>
          <xsl:apply-templates/>
        </jaxb:javadoc>
      </jaxb:class>
    </xsd:appinfo>
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>
  
</xsl:stylesheet>

Best,
-Rob


> -----Original Message-----
> From: David Walend [mailto:david_at_walend.net]
> Sent: Friday, August 08, 2003 11:47 AM
> To: users_at_jaxb.dev.java.net
>
> 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


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net