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 8AA891040D for ; Fri, 18 Oct 2013 16:46:50 +0000 (UTC) Received: (qmail 64710 invoked by uid 500); 18 Oct 2013 16:46:50 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 64578 invoked by uid 500); 18 Oct 2013 16:46:48 -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 64551 invoked by uid 99); 18 Oct 2013 16:46:47 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Oct 2013 16:46:47 +0000 Date: Fri, 18 Oct 2013 16:46:47 +0000 (UTC) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CXF-5342) Letting to be absolute XSISchemaNamespace 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-5342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13799277#comment-13799277 ] Sergey Beryozkin edited comment on CXF-5342 at 10/18/13 4:46 PM: ----------------------------------------------------------------- Hi Alessandro Thanks for your input, I did not know that this attribute can have a relative value, but after downloading the xsi instance schema I can see its value space is completely open. I think we can simply add a boolean property to XSISchemaLocation annotation, set to true by default, something like "absolute"=true, you'd set it to 'false' in your case I can also make it simpler to override the relevant JAXBProvider code Thanks, Sergey was (Author: sergey_beryozkin): Hi Alessandro Thanks for your input, I did not know that this attribute can have a relative value, but after the xsi instance schema I can see its value space is completely open. I think we can simply add a boolean property to XSISchemaLocation annotation, set to true by default, something like "absolute"=true, you'd set it to 'false' in your case I can also make it simpler to override the relevant JAXBProvider code Thanks, Sergey > Letting to be absolute XSISchemaNamespace > ------------------------------------------ > > Key: CXF-5342 > URL: https://issues.apache.org/jira/browse/CXF-5342 > Project: CXF > Issue Type: Improvement > Components: JAX-RS > Affects Versions: 2.7.7 > Environment: Tomcat Spring > Reporter: Alessandro Canevese > Priority: Minor > > Hi all. It's my first contribute to CXF. Maybe it has already been solved but I've not figured out how to obtain it. > I need to have a xml produced with > xsi:schemaLocation="john andrew". > I've tried @XSISchemaLocation("john andrew") but you know it's rendered http://blabla/john%20andrew. > I've tried to configure through the bean property schemaLocation in spring/cxf xml configuration file (for a bean of class org.apache.cxf.jaxrs.provider.JAXBElementProvider), but I obtain that Spring fires an exception of operation not supported (maybe it would not work anyway). > So, in the end, I've copied the class above and I made a class of my own changing the addSchemaLocation method as follows: > private void addSchemaLocation(Marshaller ms, Annotation[] anns) > throws Exception > { > XSISchemaLocation sl = AnnotationUtils.getAnnotation(anns, > XSISchemaLocation.class); > if (sl != null) > { > log.debug("It would produce " + buildAbsoluteXMLResourceURI(sl.value())); > //String value = buildAbsoluteXMLResourceURI(sl.value()); > log.debug("It produces instead" + sl.value()); > > String value = sl.value(); > String propName = !sl.noNamespace() ? Marshaller.JAXB_SCHEMA_LOCATION > : Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION; > ms.setProperty(propName, value); > } > } > It's not the right way as it should be configured to have a choice on turning on/off absolute paths. > Maybe in a future version it will be set? > Thank you. > Excuse me if it turns out it's not an appropriate post. > Ciao > Alessandro -- This message was sent by Atlassian JIRA (v6.1#6144)