cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Diephouse" <...@envoisolutions.com>
Subject Re: Question about imported element baseUri in XMLSchema
Date Mon, 05 Feb 2007 15:29:17 GMT
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.jira.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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message