Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7DF6510C54 for ; Sun, 9 Jun 2013 15:57:28 +0000 (UTC) Received: (qmail 60108 invoked by uid 500); 9 Jun 2013 15:57:28 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 59841 invoked by uid 500); 9 Jun 2013 15:57:22 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 59811 invoked by uid 99); 9 Jun 2013 15:57:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Jun 2013 15:57:20 +0000 Date: Sun, 9 Jun 2013 15:57:20 +0000 (UTC) From: "Alain Pannetier (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-5070) CDATA sections are not taken into account by wsdl2java but are by xjc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13679095#comment-13679095 ] Alain Pannetier commented on CXF-5070: -------------------------------------- Looks like the workaround should also be added in one or two other places. I discovered because my WSDL imports a bunch of additional XSDs (shared among various WSDLs). So I had to add your workaround in 2 other places (both in org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding#addSchemas) {code:java|title=JAXBDataBinding#addSchemas line 660} InputSource is = new InputSource((InputStream)null); //key = key.replaceFirst("#types[0-9]+$", ""); is.setSystemId(key); is.setPublicId(key); opts.addGrammar(is); try { XMLStreamReader reader = new StreamReaderDelegate(StaxUtils.createXMLStreamReader(ele, key)) { public int next() throws XMLStreamException { int i = super.next(); return i == XMLStreamReader.CDATA ? XMLStreamReader.CHARACTERS : i; } }; schemaCompiler.parseSchema(key, reader); } catch (XMLStreamException e) { throw new ToolException(e); } {code} And just below (adapted to the desired createXMLStreamReader overload) {code:java|title=JAXBDataBinding#addSchemas line 690} XMLStreamReader reader = new StreamReaderDelegate(StaxUtils.createXMLStreamReader(key, in)) { public int next() throws XMLStreamException { int i = super.next(); return i == XMLStreamReader.CDATA ? XMLStreamReader.CHARACTERS : i; } }; reader = new LocationFilterReader(reader, catalog); InputSource is = new InputSource(key); opts.addGrammar(is); schemaCompiler.parseSchema(key, reader); reader.close(); {code} I might have overlooked other places (this is a huge class). > CDATA sections are not taken into account by wsdl2java but are by xjc > --------------------------------------------------------------------- > > Key: CXF-5070 > URL: https://issues.apache.org/jira/browse/CXF-5070 > Project: CXF > Issue Type: Bug > Components: Tooling > Affects Versions: 2.7.4 > Environment: Java 1.7 (Sun JDK, Linux Mint 14) > Reporter: Alain Pannetier > Assignee: Daniel Kulp > Priority: Minor > Labels: newbie > > When generating javadoc comments in emitted java classes from xsd:documentation/xsd:annotation, CDATA are systematically disregarded by wsdl2java. > Narrowed down to a simple test > 1/ wsdl2java -d src stuff.wsdl > 2/ xjc -wsdl -d src stuff.wsdl > Simple wsdl: > {code:xml} > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > xmlns:tns="http:/com.example/" > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" > targetNamespace="http:/com.example/" > jaxb:version="1.0" > > > > targetNamespace="http:/com.example/"> > > > > > This does show up > > > > > This does show up > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira