Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.wtal.de!news.tal.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: Best way to generate XSD from Java Date: Fri, 28 Sep 2012 21:34:51 +0200 Lines: 46 Message-ID: References: <1lz5htc7ru4px.y4dvutffaftd$.dlg@40tude.net> <5065f23e$0$285$14726298@news.sunsite.dk> <1w8k70m8bfjn7.g6ysc3inyk4d$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: individual.net ZwC8FJCKBTQraqOrfbEyfgvDdK1Ln1LIO5Iq3+EA9Pyn9y0Aq4Xo9ORCGIrbQ2H40= Cancel-Lock: sha1:XAeTEf82bZH6jjSLVjmVGRdz5Js= User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 In-Reply-To: <1w8k70m8bfjn7.g6ysc3inyk4d$.dlg@40tude.net> Xref: csiph.com comp.lang.java.programmer:18979 On 28.09.2012 21:21, the don wrote: > On Fri, 28 Sep 2012 14:53:43 -0400, Arne Vajh=F8j wrote: > >> On 9/28/2012 2:30 PM, the don wrote: >>> Want to tag Methods first, then input tagged Java file to code genera= tor, >>> like JavaDoc or Velocity, then output XML Schema with elements genera= ted >>> according to parameters provided by tags. >>> >>> Better to use JavaDoc Tags or Annotations? What Templating engine(s) = do you >>> recommend? >> >> Annotations are a lot easier to process than source code parsing. >> >> And I assume that you want to write a customer generator. >> >> The easy solution is JAXB annotations and schemagen. >> >> Arne > > Thank you, I will take a look Just a side note: I prefer to create the schema _first_ because that is=20 something the user will face (I am thinking of configuration files=20 here). So first comes usability for the user and only then I bother how = that will be transferred into Java land. I use "trang" to generate an=20 XSD and modify it manually afterwards. http://www.thaiopensource.com/relaxng/trang.html If you are designing XML based persistence of Java classes then of=20 course your approach is at least equally valid. But I would do that=20 only if I am sure no human being needs to edit those XML files. Kind regards robert --=20 remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/