cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Ma" <jim...@iona.com>
Subject RE: Question about imported element baseUri in XMLSchema
Date Tue, 06 Feb 2007 08:37:12 GMT
Thanks Dan ,

I think XMlSchema is needed to enhance . Reserializing the schemas is not
the good and ideal way
to get schema elements .

The solution [3] is simple and effective.   Can you point me the XFire
source code that works around
this problem ?

Thanks

Jim


> -----Original Message-----
> From: Dan Diephouse [mailto:dan@envoisolutions.com]
> Sent: Monday, February 05, 2007 11:29 PM
> To: cxf-dev@incubator.apache.org
> Subject: Re: Question about imported element baseUri in XMLSchema
>
>
> There isn't a very good way to get at *all* the schema documents as we
> discussed in this issue:
>
> https://issues.apache.org/jira/browse/CXF-363?page=com.atlassian.j
ira.plugin.system.issuetabpanels:all-tabpanel
>
> Calling getDocumentElement() actually reserializes the schemas.
> There are a
> couple possible solutions to this, and I would like to get feedback from
> others on them.
>
> 1. Enhance XmlSchema to store the original Elements which were the backing
> document. I'm not sure how much work or how feasible this is.
> 2. Switch to use XSOM and resolve all the schema Elements correctly
> http://xsom.dev.java.net
> 3. Don't do anything. The realization here would be that we don't actually
> need to resolve the schemas ourselves. In XFire we just gave JAXB
> the schema
> Elements that were in the WSDL and it took care of finding the imports and
> resolving them correctly. The original schema Elements can be found in
> SchemaInfo.getElement() (as oppsed to
> SchemaInfo.getSchema().getDocumentElement()].
>
>
> Regards,
> - Dan
>
> On 2/4/07, Jim Ma <jim.ma@iona.com> wrote:
> >
> > Hi ,
> >
> > I use the following code to read the schemaA which import the
> schemaB and
> > print the base uri
> >
> > for each schema element :
> >
> >
> > schemaCol.setBaseUri(schemaBaseUri);
> > schemaCol.setSchemaResolver (new XmlSchemaURIResolver());
> > XmlSchema xmlSchema = schemaCol.read(schemaA);
> >
> > When I check the imported schema element base uri , I always get null.
> >
> > Document[] docs = xmlSchema.getAllSchemas();
> > for (int i = 0; i < docs.length; i++) {
> >          Element ele = docs[i].getDocumentElement();
> >          System.out.println("--- getBaseUri---- " + ele.getBaseURI());
> > }
> >
> > I always get null value .Is there anything I need to set for schemaCol ?
> >
> > Thanks
> >
> > Jim
> >
> >
>
>
> --
> Dan Diephouse
> Envoi Solutions
> http://envoisolutions.com | http://netzooid.com/blog
>


Mime
View raw message