You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by Oshani Seneviratne <os...@gmail.com> on 2006/09/07 14:41:07 UTC

[XmlSchema] An alternative to the removed mapNamespace method in XmlSchemaCollection?

Hi,

Apache Woden has been using the mapNamespace method to register all
the namespaces found in <description> element of a wsdl, in to an
xmlSchemaCollection object. This is then used to read the <schema>
element from an org.xml.sax.InputSource by using the read(InputSource
inputSource, ValidationEventHandler veh) method.

Now, with the removal of the mapNamespace method, the build is
breaking against the latest XmlSchema jars. And if the namespaces are
not registered with xmlSchemaCollection, several test cases are
failing after complaining that the 'so-and-so prefix is not bound'!

WSCOMMONS-81 [1], which had made this change talks about not
duplicating namespace handling. But IMHO, since the schema is read
from an InputSource, as in the above case, there should be some way to
externally register the namespaces, isn't it ? (unlike as with schema
read from org.w3c.dom.Document/Element)
Or else, how was it intended to handle namespaces when it comes to
reading the schema from an InputSource?

[1] http://issues.apache.org/jira/browse/WSCOMMONS-81

A cursory glance over the code for XmlSchemaCollection revealed that
there are no current usages for the field "inScopeNamespaces", which
used to record the prefixes and their relevant namspaces earlier. Are
there any plans of using it somewhere?

I would really appreciate if somebody could point out a way to fix this problem.

Thanks in advance!

Regards,
Oshani

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


Re: [XmlSchema] An alternative to the removed mapNamespace method in XmlSchemaCollection?

Posted by Oshani Seneviratne <os...@gmail.com>.
Thanks Dims, It worked!

Oshani


On 9/7/06, Davanum Srinivas <da...@gmail.com> wrote:
> See how we coped with the change in Axis2:
> http://svn.apache.org/viewvc?view=rev&revision=440231
>
> Basically use XmlSchema's setNamespaceContext method to set a namespace map.
>
> thanks,
> dims
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


Re: [XmlSchema] An alternative to the removed mapNamespace method in XmlSchemaCollection?

Posted by Davanum Srinivas <da...@gmail.com>.
See how we coped with the change in Axis2:
http://svn.apache.org/viewvc?view=rev&revision=440231

Basically use XmlSchema's setNamespaceContext method to set a namespace map.

thanks,
dims

On 9/7/06, Oshani Seneviratne <os...@gmail.com> wrote:
> Hi,
>
> Apache Woden has been using the mapNamespace method to register all
> the namespaces found in <description> element of a wsdl, in to an
> xmlSchemaCollection object. This is then used to read the <schema>
> element from an org.xml.sax.InputSource by using the read(InputSource
> inputSource, ValidationEventHandler veh) method.
>
> Now, with the removal of the mapNamespace method, the build is
> breaking against the latest XmlSchema jars. And if the namespaces are
> not registered with xmlSchemaCollection, several test cases are
> failing after complaining that the 'so-and-so prefix is not bound'!
>
> WSCOMMONS-81 [1], which had made this change talks about not
> duplicating namespace handling. But IMHO, since the schema is read
> from an InputSource, as in the above case, there should be some way to
> externally register the namespaces, isn't it ? (unlike as with schema
> read from org.w3c.dom.Document/Element)
> Or else, how was it intended to handle namespaces when it comes to
> reading the schema from an InputSource?
>
> [1] http://issues.apache.org/jira/browse/WSCOMMONS-81
>
> A cursory glance over the code for XmlSchemaCollection revealed that
> there are no current usages for the field "inScopeNamespaces", which
> used to record the prefixes and their relevant namspaces earlier. Are
> there any plans of using it somewhere?
>
> I would really appreciate if somebody could point out a way to fix this problem.
>
> Thanks in advance!
>
> Regards,
> Oshani
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: commons-dev-help@ws.apache.org
>
>


-- 
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org