You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by pattabi <Pa...@aig.com> on 2009/01/29 01:07:24 UTC

setLoadSubstituteNamespaces not working for me

Hi,
The Javadoc and found in many user grps that setLoadSubstituteNamespaces
would work for parsing xml without namespace. The code below is not working
for me. Could anyone help?

		String product =
"<Products><ProductCd>LOCNW110</ProductCd><ProductCd>LOCNF160</ProductCd><ProductCd>LOCNG100</ProductCd><ProductCd>LOCNA500</ProductCd></Products>";
		try {
			ProductsDocument doc = ProductsDocument.Factory.parse(product,new
XmlOptions().
					setLoadSubstituteNamespaces(Collections.singletonMap(
							"", "http://reportordr")));
		} catch (XmlException e1) {
-- 
View this message in context: http://www.nabble.com/setLoadSubstituteNamespaces-not-working-for-me-tp21718188p21718188.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: setLoadSubstituteNamespaces not working for me

Posted by pattabi <Pa...@aig.com>.
Thank you. Yes It was a mistake elsewhere that I was calling a overloaded
method of my class without the xmloptions.
Thanks and sorry for the misleading post. (Would it be possible for the
admin to delete this thread?)
Thanks 

Radu Preotiuc-Pietro-2 wrote:
> 
> Hm, this works for me, can you give more details of why do you say it is
> not working and maybe a Schema snippet, maybe there is an error
> somewhere else; the code is good.
> 
> Radu
> 
> On Wed, 2009-01-28 at 19:07 -0500, pattabi wrote:
>>                 String product =
>> "<Products><ProductCd>LOCNW110</ProductCd><ProductCd>LOCNF160</ProductCd><ProductCd>LOCNG100</ProductCd><ProductCd>LOCNA500</ProductCd></Products>";
>>                 try {
>>                         ProductsDocument doc =
>> ProductsDocument.Factory.parse(product,new
>> XmlOptions().
>>                                        
>> setLoadSubstituteNamespaces(Collections.singletonMap(
>>                                                         "",
>> "http://reportordr")));
>>                 } catch (XmlException e1) {
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/setLoadSubstituteNamespaces-not-working-for-me-tp21718188p21744953.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: setLoadSubstituteNamespaces not working for me

Posted by pattabi <Pa...@aig.com>.
In debug mode, I could see that the xmloptions is being set at the Factory
class but down the line, it is giving error. I am attaching the stacktrace.
Hope that provides some detail.

http://www.nabble.com/file/p21744652/xmlbeans.txt xmlbeans.txt 

Thanks


Radu Preotiuc-Pietro-2 wrote:
> 
> Hm, this works for me, can you give more details of why do you say it is
> not working and maybe a Schema snippet, maybe there is an error
> somewhere else; the code is good.
> 
> Radu
> 
> On Wed, 2009-01-28 at 19:07 -0500, pattabi wrote:
>>                 String product =
>> "<Products><ProductCd>LOCNW110</ProductCd><ProductCd>LOCNF160</ProductCd><ProductCd>LOCNG100</ProductCd><ProductCd>LOCNA500</ProductCd></Products>";
>>                 try {
>>                         ProductsDocument doc =
>> ProductsDocument.Factory.parse(product,new
>> XmlOptions().
>>                                        
>> setLoadSubstituteNamespaces(Collections.singletonMap(
>>                                                         "",
>> "http://reportordr")));
>>                 } catch (XmlException e1) {
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/setLoadSubstituteNamespaces-not-working-for-me-tp21718188p21744652.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: setLoadSubstituteNamespaces not working for me

Posted by Radu Preotiuc <ra...@oracle.com>.
Hm, this works for me, can you give more details of why do you say it is
not working and maybe a Schema snippet, maybe there is an error
somewhere else; the code is good.

Radu

On Wed, 2009-01-28 at 19:07 -0500, pattabi wrote:
>                 String product =
> "<Products><ProductCd>LOCNW110</ProductCd><ProductCd>LOCNF160</ProductCd><ProductCd>LOCNG100</ProductCd><ProductCd>LOCNA500</ProductCd></Products>";
>                 try {
>                         ProductsDocument doc =
> ProductsDocument.Factory.parse(product,new
> XmlOptions().
>                                         setLoadSubstituteNamespaces(Collections.singletonMap(
>                                                         "",
> "http://reportordr")));
>                 } catch (XmlException e1) {
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org