You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Hans Bakker <ma...@antwebsystems.com> on 2009/09/01 07:56:29 UTC

Re: Google Base Code is broken after commit r808410 - Please provide your suggestion to solve the problem

Hi Ashish

i had a quick look at the code but could not find any xalan dependable
code there....It uses however UtilXml.java.

This file you should scan with the string: setNamespaceAware(true)
and see what is used within the google base component.

Regards, Hans


On Tue, 2009-09-01 at 10:39 +0530, Ashish Vijaywargiya wrote:
> Thanks Hans for your comment on this - I will explore it and will get back
> to you if needed.
> Rest comments Inline:
> 
> --
> Ashish
> 
> On Tue, Sep 1, 2009 at 5:15 AM, Hans Bakker
> <ma...@antwebsystems.com>wrote:
> 
> > Hi Ashish,
> >
> > xalan is required for the generation of html documents from the xml/xsl
> > combination files.
> >
> > It could be that that the xalan overrides the xercess libraries.
> >
> > with xalan you can set the namespace awareness the following way:
> >
> > SAXParserFactory pfactory= SAXParserFactory.newInstance();
> >                pfactory.setNamespaceAware(true);
> >
> > an example you can find in the XslTransform.java file where i added the
> > code.
> >
> > let me know which xml processing code  Google base is using, i will have
> > a look at it...
> >
> 
> You can refer method "buildDataItemsXml" present inside
> ProductsExportToGoogle.java file present inside GoogleBase component.
> 
> 
> 
> >
> > Regards,
> > Hans
> >
> >
> > On Mon, 2009-08-31 at 21:26 +0530, Ashish Vijaywargiya wrote:
> > > Hello Hans,
> > >
> > > I am working on Google Base.
> > > The code was working fine till revision r808332.
> > >
> > > But it stopped working after your commit r808410 (Big one in which you
> > have
> > > added docbook related things)
> > > The reason is the addition of
> > > xalan-2.7.1.jar<
> > http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/lib/xalan-2.7.1.jar?limit_changes=0&view=markup&pathrev=808410
> > >in
> > > the trunk.
> > > Can you please let me know the purpose for the addition of this file -
> > this
> > > will help me to find some alternate to solve this issue?
> > >
> > > Here is the String generated on r808332 (Till this revision code was
> > working
> > > fine).
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="
> > > http://purl.org/atom/app#" xmlns:batch="
> > > http://schemas.google.com/gdata/batch" xmlns:g="
> > > http://base.google.com/ns/1.0" xmlns:gm="
> > > http://base.google.com/ns-metadata/1.0" xmlns:openSearch="
> > > http://a9.com/-/spec/opensearchrss/1.0/">
> > >     <entry>
> > >         <batch:operation type="insert"/>
> > >         <app:control>
> > >             <gm:publishing_priority>high</gm:publishing_priority>
> > >         </app:control>
> > >         <title>Tiny Gizmo</title>
> > >         <content type="xhtml">The smallest gizmo in town.</content>
> > >         <g:id>
> > > http://demo.ofbiz.org/ecommerce/control/product/~product_id=GZ-1000<http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-1000>
> > </g:id>
> > >         <link href="
> > > http://demo.ofbiz.org/ecommerce/control/product/~product_id=GZ-1000<http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-1000>
> > "
> > > rel="alternate" type="text/html"/>
> > >         <g:item_type>products</g:item_type>
> > >         <g:product_type>Electronics</g:product_type>
> > >         <g:product_type>Business &amp; Industrial</g:product_type>
> > >         <g:price>15.990</g:price>
> > >         <g:currency>USD</g:currency>
> > >         <g:target_country>US</g:target_country>
> > >         <g:ean>12345</g:ean>
> > >         <g:condition>new</g:condition>
> > >         <g:image_link>
> > > http://demo.ofbiz.org/images/products/large/web_browser.png
> > </g:image_link>
> > >     </entry>
> > > </feed>
> > >
> > > After your changes done at r808410 the string looks like - NamespaceURL
> > is
> > > being added in each generated tag.
> > > Google Base server don't like the generated string format in which we
> > have
> > > namespace tag so the Google Base stopped working.
> > >
> > > <?xml version="1.0" encoding="UTF-8"?><feed xmlns:openSearch="
> > > http://a9.com/-/spec/opensearchrss/1.0/">
> > >     <entry>
> > >         <batch:operation xmlns:batch="
> > http://schemas.google.com/gdata/batch"
> > > type="insert"/>
> > >         <app:control xmlns:app="http://purl.org/atom/app#">
> > >             <gm:publishing_priority xmlns:gm="
> > > http://base.google.com/ns-metadata/1.0">high</gm:publishing_priority>
> > >         </app:control>
> > >         <title>Square Gizmo</title>
> > >         <content type="xhtml">A square gizmo</content>
> > >         <g:id xmlns:g="http://base.google.com/ns/1.0">
> > > http://demo.ofbiz.org/ecommerce/control/product/~product_id=GZ-2002<http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-2002>
> > </g:id>
> > >         <link href="
> > > http://demo.ofbiz.org/ecommerce/control/product/~product_id=GZ-2002<http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-2002>
> > "
> > > rel="alternate" type="text/html"/>
> > >         <g:item_type xmlns:g="http://base.google.com/ns/1.0
> > > ">products</g:item_type>
> > >         <g:product_type xmlns:g="http://base.google.com/ns/1.0
> > > ">Electronics</g:product_type>
> > >         <g:product_type xmlns:g="http://base.google.com/ns/1.0">Business
> > > &amp; Industrial</g:product_type>
> > >         <g:price xmlns:g="http://base.google.com/ns/1.0
> > ">47.990</g:price>
> > >         <g:currency xmlns:g="http://base.google.com/ns/1.0
> > ">USD</g:currency>
> > >         <g:target_country xmlns:g="http://base.google.com/ns/1.0
> > > ">US</g:target_country>
> > >         <g:condition xmlns:g="http://base.google.com/ns/1.0
> > > ">new</g:condition>
> > >         <g:image_link xmlns:g="http://base.google.com/ns/1.0">
> > > http://demo.ofbiz.org/images/products/large/server_mimooh.png
> > </g:image_link>
> > >     </entry>
> > > </feed>
> > >
> > > --
> > > Ashish
> > --
> > Antwebsystems.com: Quality OFBiz services for competitive rates
> >
> >
-- 
Antwebsystems.com: Quality OFBiz services for competitive rates


Re: Google Base Code is broken after commit r808410 - Please provide your suggestion to solve the problem

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
It is now fixed in rev. 810857

Jacopo

On Sep 1, 2009, at 8:19 AM, Ashish Vijaywargiya wrote:

> The code uses makeEmptyXmlDocument() method of UtilXml.java file.
> The default value of namespace aware is kept commented - which is  
> good in
> case of Google Base.
> // factory.setNamespaceAware(true);
>
> If I remove Xalan*.jar then Google Base code works fine.
> I am exploring the root cause of this problem.
>
> Thanks for your comment on this.
> --
> Ashish
>
> On Tue, Sep 1, 2009 at 11:26 AM, Hans Bakker
> <ma...@antwebsystems.com>wrote:
>
>> Hi Ashish
>>
>> i had a quick look at the code but could not find any xalan  
>> dependable
>> code there....It uses however UtilXml.java.
>>
>> This file you should scan with the string: setNamespaceAware(true)
>> and see what is used within the google base component.
>>
>> Regards, Hans
>>
>>
>> On Tue, 2009-09-01 at 10:39 +0530, Ashish Vijaywargiya wrote:
>>> Thanks Hans for your comment on this - I will explore it and will  
>>> get
>> back
>>> to you if needed.
>>> Rest comments Inline:
>>>
>>> --
>>> Ashish
>>>
>>> On Tue, Sep 1, 2009 at 5:15 AM, Hans Bakker
>>> <ma...@antwebsystems.com>wrote:
>>>
>>>> Hi Ashish,
>>>>
>>>> xalan is required for the generation of html documents from the  
>>>> xml/xsl
>>>> combination files.
>>>>
>>>> It could be that that the xalan overrides the xercess libraries.
>>>>
>>>> with xalan you can set the namespace awareness the following way:
>>>>
>>>> SAXParserFactory pfactory= SAXParserFactory.newInstance();
>>>>               pfactory.setNamespaceAware(true);
>>>>
>>>> an example you can find in the XslTransform.java file where i  
>>>> added the
>>>> code.
>>>>
>>>> let me know which xml processing code  Google base is using, i will
>> have
>>>> a look at it...
>>>>
>>>
>>> You can refer method "buildDataItemsXml" present inside
>>> ProductsExportToGoogle.java file present inside GoogleBase  
>>> component.
>>>
>>>
>>>
>>>>
>>>> Regards,
>>>> Hans
>>>>
>>>>
>>>> On Mon, 2009-08-31 at 21:26 +0530, Ashish Vijaywargiya wrote:
>>>>> Hello Hans,
>>>>>
>>>>> I am working on Google Base.
>>>>> The code was working fine till revision r808332.
>>>>>
>>>>> But it stopped working after your commit r808410 (Big one in which
>> you
>>>> have
>>>>> added docbook related things)
>>>>> The reason is the addition of
>>>>> xalan-2.7.1.jar<
>>>>
>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/lib/xalan-2.7.1.jar?limit_changes=0&view=markup&pathrev=808410
>>>>> in
>>>>> the trunk.
>>>>> Can you please let me know the purpose for the addition of this  
>>>>> file
>> -
>>>> this
>>>>> will help me to find some alternate to solve this issue?
>>>>>
>>>>> Here is the String generated on r808332 (Till this revision code  
>>>>> was
>>>> working
>>>>> fine).
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="
>>>>> http://purl.org/atom/app#" xmlns:batch="
>>>>> http://schemas.google.com/gdata/batch" xmlns:g="
>>>>> http://base.google.com/ns/1.0" xmlns:gm="
>>>>> http://base.google.com/ns-metadata/1.0" xmlns:openSearch="
>>>>> http://a9.com/-/spec/opensearchrss/1.0/">
>>>>>    <entry>
>>>>>        <batch:operation type="insert"/>
>>>>>        <app:control>
>>>>>            <gm:publishing_priority>high</gm:publishing_priority>
>>>>>        </app:control>
>>>>>        <title>Tiny Gizmo</title>
>>>>>        <content type="xhtml">The smallest gizmo in town.</content>
>>>>>        <g:id>
>>>>> http://demo.ofbiz.org/ecommerce/control/product/ 
>>>>> ~product_id=GZ-1000<http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-1000 
>>>>> >
>> <http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-1000 
>> >
>>>> </g:id>
>>>>>        <link href="
>>>>> http://demo.ofbiz.org/ecommerce/control/product/ 
>>>>> ~product_id=GZ-1000<http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-1000 
>>>>> >
>> <http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-1000 
>> >
>>>> "
>>>>> rel="alternate" type="text/html"/>
>>>>>        <g:item_type>products</g:item_type>
>>>>>        <g:product_type>Electronics</g:product_type>
>>>>>        <g:product_type>Business &amp; Industrial</g:product_type>
>>>>>        <g:price>15.990</g:price>
>>>>>        <g:currency>USD</g:currency>
>>>>>        <g:target_country>US</g:target_country>
>>>>>        <g:ean>12345</g:ean>
>>>>>        <g:condition>new</g:condition>
>>>>>        <g:image_link>
>>>>> http://demo.ofbiz.org/images/products/large/web_browser.png
>>>> </g:image_link>
>>>>>    </entry>
>>>>> </feed>
>>>>>
>>>>> After your changes done at r808410 the string looks like -
>> NamespaceURL
>>>> is
>>>>> being added in each generated tag.
>>>>> Google Base server don't like the generated string format in  
>>>>> which we
>>>> have
>>>>> namespace tag so the Google Base stopped working.
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8"?><feed xmlns:openSearch="
>>>>> http://a9.com/-/spec/opensearchrss/1.0/">
>>>>>    <entry>
>>>>>        <batch:operation xmlns:batch="
>>>> http://schemas.google.com/gdata/batch"
>>>>> type="insert"/>
>>>>>        <app:control xmlns:app="http://purl.org/atom/app#">
>>>>>            <gm:publishing_priority xmlns:gm="
>>>>> http://base.google.com/ns-metadata/1.0
>> ">high</gm:publishing_priority>
>>>>>        </app:control>
>>>>>        <title>Square Gizmo</title>
>>>>>        <content type="xhtml">A square gizmo</content>
>>>>>        <g:id xmlns:g="http://base.google.com/ns/1.0">
>>>>> http://demo.ofbiz.org/ecommerce/control/product/ 
>>>>> ~product_id=GZ-2002<http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-2002 
>>>>> >
>> <http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-2002 
>> >
>>>> </g:id>
>>>>>        <link href="
>>>>> http://demo.ofbiz.org/ecommerce/control/product/ 
>>>>> ~product_id=GZ-2002<http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-2002 
>>>>> >
>> <http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-2002 
>> >
>>>> "
>>>>> rel="alternate" type="text/html"/>
>>>>>        <g:item_type xmlns:g="http://base.google.com/ns/1.0
>>>>> ">products</g:item_type>
>>>>>        <g:product_type xmlns:g="http://base.google.com/ns/1.0
>>>>> ">Electronics</g:product_type>
>>>>>        <g:product_type xmlns:g="http://base.google.com/ns/1.0
>> ">Business
>>>>> &amp; Industrial</g:product_type>
>>>>>        <g:price xmlns:g="http://base.google.com/ns/1.0
>>>> ">47.990</g:price>
>>>>>        <g:currency xmlns:g="http://base.google.com/ns/1.0
>>>> ">USD</g:currency>
>>>>>        <g:target_country xmlns:g="http://base.google.com/ns/1.0
>>>>> ">US</g:target_country>
>>>>>        <g:condition xmlns:g="http://base.google.com/ns/1.0
>>>>> ">new</g:condition>
>>>>>        <g:image_link xmlns:g="http://base.google.com/ns/1.0">
>>>>> http://demo.ofbiz.org/images/products/large/server_mimooh.png
>>>> </g:image_link>
>>>>>    </entry>
>>>>> </feed>
>>>>>
>>>>> --
>>>>> Ashish
>>>> --
>>>> Antwebsystems.com: Quality OFBiz services for competitive rates
>>>>
>>>>
>> --
>> Antwebsystems.com: Quality OFBiz services for competitive rates
>>
>>


Re: Google Base Code is broken after commit r808410 - Please provide your suggestion to solve the problem

Posted by Ashish Vijaywargiya <vi...@gmail.com>.
The code uses makeEmptyXmlDocument() method of UtilXml.java file.
The default value of namespace aware is kept commented - which is good in
case of Google Base.
// factory.setNamespaceAware(true);

If I remove Xalan*.jar then Google Base code works fine.
I am exploring the root cause of this problem.

Thanks for your comment on this.
--
Ashish

On Tue, Sep 1, 2009 at 11:26 AM, Hans Bakker
<ma...@antwebsystems.com>wrote:

> Hi Ashish
>
> i had a quick look at the code but could not find any xalan dependable
> code there....It uses however UtilXml.java.
>
> This file you should scan with the string: setNamespaceAware(true)
> and see what is used within the google base component.
>
> Regards, Hans
>
>
> On Tue, 2009-09-01 at 10:39 +0530, Ashish Vijaywargiya wrote:
> > Thanks Hans for your comment on this - I will explore it and will get
> back
> > to you if needed.
> > Rest comments Inline:
> >
> > --
> > Ashish
> >
> > On Tue, Sep 1, 2009 at 5:15 AM, Hans Bakker
> > <ma...@antwebsystems.com>wrote:
> >
> > > Hi Ashish,
> > >
> > > xalan is required for the generation of html documents from the xml/xsl
> > > combination files.
> > >
> > > It could be that that the xalan overrides the xercess libraries.
> > >
> > > with xalan you can set the namespace awareness the following way:
> > >
> > > SAXParserFactory pfactory= SAXParserFactory.newInstance();
> > >                pfactory.setNamespaceAware(true);
> > >
> > > an example you can find in the XslTransform.java file where i added the
> > > code.
> > >
> > > let me know which xml processing code  Google base is using, i will
> have
> > > a look at it...
> > >
> >
> > You can refer method "buildDataItemsXml" present inside
> > ProductsExportToGoogle.java file present inside GoogleBase component.
> >
> >
> >
> > >
> > > Regards,
> > > Hans
> > >
> > >
> > > On Mon, 2009-08-31 at 21:26 +0530, Ashish Vijaywargiya wrote:
> > > > Hello Hans,
> > > >
> > > > I am working on Google Base.
> > > > The code was working fine till revision r808332.
> > > >
> > > > But it stopped working after your commit r808410 (Big one in which
> you
> > > have
> > > > added docbook related things)
> > > > The reason is the addition of
> > > > xalan-2.7.1.jar<
> > >
> http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/lib/xalan-2.7.1.jar?limit_changes=0&view=markup&pathrev=808410
> > > >in
> > > > the trunk.
> > > > Can you please let me know the purpose for the addition of this file
> -
> > > this
> > > > will help me to find some alternate to solve this issue?
> > > >
> > > > Here is the String generated on r808332 (Till this revision code was
> > > working
> > > > fine).
> > > >
> > > > <?xml version="1.0" encoding="UTF-8"?>
> > > > <feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="
> > > > http://purl.org/atom/app#" xmlns:batch="
> > > > http://schemas.google.com/gdata/batch" xmlns:g="
> > > > http://base.google.com/ns/1.0" xmlns:gm="
> > > > http://base.google.com/ns-metadata/1.0" xmlns:openSearch="
> > > > http://a9.com/-/spec/opensearchrss/1.0/">
> > > >     <entry>
> > > >         <batch:operation type="insert"/>
> > > >         <app:control>
> > > >             <gm:publishing_priority>high</gm:publishing_priority>
> > > >         </app:control>
> > > >         <title>Tiny Gizmo</title>
> > > >         <content type="xhtml">The smallest gizmo in town.</content>
> > > >         <g:id>
> > > > http://demo.ofbiz.org/ecommerce/control/product/~product_id=GZ-1000<http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-1000>
> <http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-1000>
> > > </g:id>
> > > >         <link href="
> > > > http://demo.ofbiz.org/ecommerce/control/product/~product_id=GZ-1000<http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-1000>
> <http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-1000>
> > > "
> > > > rel="alternate" type="text/html"/>
> > > >         <g:item_type>products</g:item_type>
> > > >         <g:product_type>Electronics</g:product_type>
> > > >         <g:product_type>Business &amp; Industrial</g:product_type>
> > > >         <g:price>15.990</g:price>
> > > >         <g:currency>USD</g:currency>
> > > >         <g:target_country>US</g:target_country>
> > > >         <g:ean>12345</g:ean>
> > > >         <g:condition>new</g:condition>
> > > >         <g:image_link>
> > > > http://demo.ofbiz.org/images/products/large/web_browser.png
> > > </g:image_link>
> > > >     </entry>
> > > > </feed>
> > > >
> > > > After your changes done at r808410 the string looks like -
> NamespaceURL
> > > is
> > > > being added in each generated tag.
> > > > Google Base server don't like the generated string format in which we
> > > have
> > > > namespace tag so the Google Base stopped working.
> > > >
> > > > <?xml version="1.0" encoding="UTF-8"?><feed xmlns:openSearch="
> > > > http://a9.com/-/spec/opensearchrss/1.0/">
> > > >     <entry>
> > > >         <batch:operation xmlns:batch="
> > > http://schemas.google.com/gdata/batch"
> > > > type="insert"/>
> > > >         <app:control xmlns:app="http://purl.org/atom/app#">
> > > >             <gm:publishing_priority xmlns:gm="
> > > > http://base.google.com/ns-metadata/1.0
> ">high</gm:publishing_priority>
> > > >         </app:control>
> > > >         <title>Square Gizmo</title>
> > > >         <content type="xhtml">A square gizmo</content>
> > > >         <g:id xmlns:g="http://base.google.com/ns/1.0">
> > > > http://demo.ofbiz.org/ecommerce/control/product/~product_id=GZ-2002<http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-2002>
> <http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-2002>
> > > </g:id>
> > > >         <link href="
> > > > http://demo.ofbiz.org/ecommerce/control/product/~product_id=GZ-2002<http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-2002>
> <http://demo.ofbiz.org/ecommerce/control/product/%7Eproduct_id=GZ-2002>
> > > "
> > > > rel="alternate" type="text/html"/>
> > > >         <g:item_type xmlns:g="http://base.google.com/ns/1.0
> > > > ">products</g:item_type>
> > > >         <g:product_type xmlns:g="http://base.google.com/ns/1.0
> > > > ">Electronics</g:product_type>
> > > >         <g:product_type xmlns:g="http://base.google.com/ns/1.0
> ">Business
> > > > &amp; Industrial</g:product_type>
> > > >         <g:price xmlns:g="http://base.google.com/ns/1.0
> > > ">47.990</g:price>
> > > >         <g:currency xmlns:g="http://base.google.com/ns/1.0
> > > ">USD</g:currency>
> > > >         <g:target_country xmlns:g="http://base.google.com/ns/1.0
> > > > ">US</g:target_country>
> > > >         <g:condition xmlns:g="http://base.google.com/ns/1.0
> > > > ">new</g:condition>
> > > >         <g:image_link xmlns:g="http://base.google.com/ns/1.0">
> > > > http://demo.ofbiz.org/images/products/large/server_mimooh.png
> > > </g:image_link>
> > > >     </entry>
> > > > </feed>
> > > >
> > > > --
> > > > Ashish
> > > --
> > > Antwebsystems.com: Quality OFBiz services for competitive rates
> > >
> > >
> --
> Antwebsystems.com: Quality OFBiz services for competitive rates
>
>