How to retrieve targetNamespace of XSModel for a given schema file?

View: New views
2 Messages — Rating Filter:   Alert me  

How to retrieve targetNamespace of XSModel for a given schema file?

by vinitha :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I created a XSModel using XSLoader.loadURI(), but Iam not able to retrieve the value of the targetNamespace as defined in the schema document.  I was able to retrieve the getNamespaceItemList() which is referring all the namespaces being loaded in the schema document. But how do I identify which is the targetNamespace for the schema document loaded into the XSModel. Any help will be appreciated.

Thanks,
vinitha



Re: How to retrieve targetNamespace of XSModel for a given schema file?

by Michael Glavassevich-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Vinitha,

Each XSNamespaceItem carries a list [1] of the URIs that contributed to the components of that target namespace. So you need to walk through the list of each XSNamespaceItem until you find the schema location you're looking for.

Thanks.

[1] http://xerces.apache.org/xerces2-j/javadocs/xs/org/apache/xerces/xs/XSNamespaceItem.html#getDocumentLocations()

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@...

E-mail: mrglavas@...

vinitha <praavich@...> wrote on 06/25/2008 05:12:00 PM:

> Hi,
>
> I created a XSModel using XSLoader.loadURI(), but Iam not able to retrieve
> the value of the targetNamespace as defined in the schema document.  I was
> able to retrieve the getNamespaceItemList() which is referring all the
> namespaces being loaded in the schema document. But how do I identify which
> is the targetNamespace for the schema document loaded into the XSModel. Any
> help will be appreciated.
>
> Thanks,
> vinitha
>
>
>
> --
> View this message in context: http://www.nabble.com/How-to-retrieve-
> targetNamespace-of--XSModel-for-a-given-schema-file--tp18121873p18121873.html
> Sent from the Xerces - J - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@...
> For additional commands, e-mail: j-users-help@...

LightInTheBox - Buy quality products at wholesale price