Simple Method String error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Simple Method String error

madppiper-2
Hey there,

I got quite an unusual error here. I am trying to parse a url to a java class that I created. The url is created dynamically and then parsed to another method of mine... :

       
        <simple-method method-name="generateProductPriceImagesAll"
                short-description="Refresh the Productprice Images for all Products">

               

                <entity-condition entity-name="ProductsAndPrices"
                        list-name="productList">
                </entity-condition>



               

                <iterate entry-name="products" list-name="productList">
                        <if>
                                <condition>
                                        <not>
                                                <if-empty field-name="products.productName"></if-empty>
                                        </not>
                                </condition>
                                <then>

                                       

                                        <set field="productOutMap.message"
                                                value="imgname=${products.productId}_price.png&v1=${products.productPrice}&v2=${products.productPrice}"
                                               
                                                type="PlainString" />


                                        <call-service service-name="generatePriceImagesAll2"
                                                in-map-name="productOutMap">
                                        </call-service>


                                </then>
                        </if>
                </iterate>



        </simple-method>






This should work, but the following error arises on call:

 
Service dispatcher threw an exceptionError running simple method [generateProductPriceImagesAll] in XML file [org/brandsparadise/solr/SimpleMethodServices.xml]: (Could not parse XML file (The reference to entity "v1" must end with the ';' delimiter.))
Reply | Threaded
Open this post in threaded view
|

Re: Simple Method String error

Adrian Crum
You need to escape the & characters:

value="imgname=${products.productId}_price.png&amp;v1=${products.productPrice}&amp;v2=${products.productPrice}"

-Adrian


madppiper wrote:

> Hey there,
>
> I got quite an unusual error here. I am trying to parse a url to a java
> class that I created. The url is created dynamically and then parsed to
> another method of mine... :
>
> <!-- Toolset Function -->
> <simple-method method-name="generateProductPriceImagesAll"
> short-description="Refresh the Productprice Images for all Products">
>
> <!-- Retrieve all Products from Entity Engine -->
>
> <entity-condition entity-name="ProductsAndPrices"
> list-name="productList">
> </entity-condition>
>
>
>
> <!-- Run through Productlist and generate the ProductPriceImages -->
>
> <iterate entry-name="products" list-name="productList">
> <if>
> <condition>
> <not>
> <if-empty field-name="products.productName"></if-empty>
> </not>
> </condition>
> <then>
>
> <!-- Generate Product Map File -->
>
> <set field="productOutMap.message"
>
> value="imgname=${products.productId}_price.png&v1=${products.productPrice}&v2=${products.productPrice}"
>
> type="PlainString" />
>
>
> <call-service service-name="generatePriceImagesAll2"
> in-map-name="productOutMap">
> </call-service>
>
>
> </then>
> </if>
> </iterate>
>
>
>
> </simple-method>
>
>
>
>
>
> This should work, but the following error arises on call:
>
>  
> Service dispatcher threw an exceptionError running simple method
> [generateProductPriceImagesAll] in XML file
> [org/brandsparadise/solr/SimpleMethodServices.xml]: (Could not parse XML
> file (The reference to entity "v1" must end with the ';' delimiter.))
Reply | Threaded
Open this post in threaded view
|

Re: Simple Method String error

madppiper-2
Right, and how do i do that?

I tried using:

value="imgname=${products.productId}_price.png\&v1=${products.productPrice}\&v2=${products.productPrice}"

since a backslash is the usual way of escaping. But this won't work...

Adrian Crum wrote
You need to escape the & characters:

value="imgname=${products.productId}_price.png&v1=${products.productPrice}&v2=${products.productPrice}"

-Adrian


madppiper wrote:
> Hey there,
>
> I got quite an unusual error here. I am trying to parse a url to a java
> class that I created. The url is created dynamically and then parsed to
> another method of mine... :
>
>
> <simple-method method-name="generateProductPriceImagesAll"
>  short-description="Refresh the Productprice Images for all Products">
>
>
>
> <entity-condition entity-name="ProductsAndPrices"
>  list-name="productList">
> </entity-condition>
>
>
>
>
>
> <iterate entry-name="products" list-name="productList">
> <if>
> <condition>
> <not>
> <if-empty field-name="products.productName"></if-empty>
> </not>
> </condition>
> <then>
>
>
>
> <set field="productOutMap.message"

> value="imgname=${products.productId}_price.png&v1=${products.productPrice}&v2=${products.productPrice}"
>
> type="PlainString" />
>
>
> <call-service service-name="generatePriceImagesAll2"
>  in-map-name="productOutMap">
> </call-service>
>
>
> </then>
> </if>
> </iterate>
>
>
>
> </simple-method>
>
>
>
>
>
> This should work, but the following error arises on call:
>
>  
> Service dispatcher threw an exceptionError running simple method
> [generateProductPriceImagesAll] in XML file
> [org/brandsparadise/solr/SimpleMethodServices.xml]: (Could not parse XML
> file (The reference to entity "v1" must end with the ';' delimiter.))
Reply | Threaded
Open this post in threaded view
|

Re: Simple Method String error

Adrian Crum
I showed you how. Look closer at my reply.

-Adrian

madppiper wrote:

> Right, and how do i do that?
>
> I tried using:
>
> value="imgname=${products.productId}_price.png\&amp;v1=${products.productPrice}\&amp;v2=${products.productPrice}"
>
> since a backslash is the usual way of escaping. But this won't work...
>
>
> Adrian Crum wrote:
>> You need to escape the & characters:
>>
>> value="imgname=${products.productId}_price.png&amp;v1=${products.productPrice}&amp;v2=${products.productPrice}"
>>
>> -Adrian
>>
>>
>> madppiper wrote:
>>> Hey there,
>>>
>>> I got quite an unusual error here. I am trying to parse a url to a java
>>> class that I created. The url is created dynamically and then parsed to
>>> another method of mine... :
>>>
>>> <!-- Toolset Function -->
>>> <simple-method method-name="generateProductPriceImagesAll"
>>> short-description="Refresh the Productprice Images for all Products">
>>>
>>> <!-- Retrieve all Products from Entity Engine -->
>>>
>>> <entity-condition entity-name="ProductsAndPrices"
>>> list-name="productList">
>>> </entity-condition>
>>>
>>>
>>>
>>> <!-- Run through Productlist and generate the ProductPriceImages -->
>>>
>>> <iterate entry-name="products" list-name="productList">
>>> <if>
>>> <condition>
>>> <not>
>>> <if-empty field-name="products.productName"></if-empty>
>>> </not>
>>> </condition>
>>> <then>
>>>
>>> <!-- Generate Product Map File -->
>>>
>>> <set field="productOutMap.message"
>>>
>>> value="imgname=${products.productId}_price.png&v1=${products.productPrice}&v2=${products.productPrice}"
>>>
>>> type="PlainString" />
>>>
>>>
>>> <call-service service-name="generatePriceImagesAll2"
>>> in-map-name="productOutMap">
>>> </call-service>
>>>
>>>
>>> </then>
>>> </if>
>>> </iterate>
>>>
>>>
>>>
>>> </simple-method>
>>>
>>>
>>>
>>>
>>>
>>> This should work, but the following error arises on call:
>>>
>>>  
>>> Service dispatcher threw an exceptionError running simple method
>>> [generateProductPriceImagesAll] in XML file
>>> [org/brandsparadise/solr/SimpleMethodServices.xml]: (Could not parse XML
>>> file (The reference to entity "v1" must end with the ';' delimiter.))
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Simple Method String error

madppiper-2
looking really close here, but even when I go through each character one by one, I cannot find the darnest difference:


yours value="imgname=${products.productId}_price.png&v1=${products.productPrice}&v2=${products.productPrice}"

mine value="imgname=${products.productId}_price.png&v1=${products.productPrice}&v2=${products.productPrice}"


;)
Reply | Threaded
Open this post in threaded view
|

Re: Simple Method String error

Christopher Vollick
You must be using a mail client that is rendering HTML, or nabble.

In yours you had the ampersand character. He actually had the  
ampersand character then amp;.

I'm not sure what my client does with escaping, so I'll try three  
things.

You need to replace the ampersands with
&amp;
&amp;amp;
"Ampersand Character"+"amp;"

I'm not sure which of the above will appear right, but I hope I got  
the idea across.


Reply | Threaded
Open this post in threaded view
|

Re: Simple Method String error

Jacques Le Roux
Administrator
In reply to this post by madppiper-2
http://www.w3.org/TR/REC-xml/#dt-chardata

Jacques

From: "madppiper" <[hidden email]>

>
> Right, and how do i do that?
>
> I tried using:
>
> value="imgname=${products.productId}_price.png\&amp;v1=${products.productPrice}\&amp;v2=${products.productPrice}"
>
> since a backslash is the usual way of escaping. But this won't work...
>
>
> Adrian Crum wrote:
>>
>> You need to escape the & characters:
>>
>> value="imgname=${products.productId}_price.png&amp;v1=${products.productPrice}&amp;v2=${products.productPrice}"
>>
>> -Adrian
>>
>>
>> madppiper wrote:
>>> Hey there,
>>>
>>> I got quite an unusual error here. I am trying to parse a url to a java
>>> class that I created. The url is created dynamically and then parsed to
>>> another method of mine... :
>>>
>>> <!-- Toolset Function -->
>>> <simple-method method-name="generateProductPriceImagesAll"
>>> short-description="Refresh the Productprice Images for all Products">
>>>
>>> <!-- Retrieve all Products from Entity Engine -->
>>>
>>> <entity-condition entity-name="ProductsAndPrices"
>>> list-name="productList">
>>> </entity-condition>
>>>
>>>
>>>
>>> <!-- Run through Productlist and generate the ProductPriceImages -->
>>>
>>> <iterate entry-name="products" list-name="productList">
>>> <if>
>>> <condition>
>>> <not>
>>> <if-empty field-name="products.productName"></if-empty>
>>> </not>
>>> </condition>
>>> <then>
>>>
>>> <!-- Generate Product Map File -->
>>>
>>> <set field="productOutMap.message"
>>>
>>> value="imgname=${products.productId}_price.png&v1=${products.productPrice}&v2=${products.productPrice}"
>>>
>>> type="PlainString" />
>>>
>>>
>>> <call-service service-name="generatePriceImagesAll2"
>>> in-map-name="productOutMap">
>>> </call-service>
>>>
>>>
>>> </then>
>>> </if>
>>> </iterate>
>>>
>>>
>>>
>>> </simple-method>
>>>
>>>
>>>
>>>
>>>
>>> This should work, but the following error arises on call:
>>>
>>>  
>>> Service dispatcher threw an exceptionError running simple method
>>> [generateProductPriceImagesAll] in XML file
>>> [org/brandsparadise/solr/SimpleMethodServices.xml]: (Could not parse XML
>>> file (The reference to entity "v1" must end with the ';' delimiter.))
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Simple-Method-String-error-tp20920803p20921780.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Simple Method String error

Adrian Crum
In reply to this post by madppiper-2
madppiper wrote:
> yours
> value="imgname=${products.productId}_price.png&v1=${products.productPrice}&v2=${products.productPrice}"

That was not in my reply. I repeat:

value="imgname=${products.productId}_price.png&amp;v1=${products.productPrice}&amp;v2=${products.productPrice}"

-Adrian
Reply | Threaded
Open this post in threaded view
|

Re: Simple Method String error

BJ Freeman
In reply to this post by madppiper-2
I use a text based email.
I can see the difference.

madppiper sent the following on 12/9/2008 11:59 AM:

> looking really close here, but even when I go through each character one by
> one, I cannot find the darnest difference:
>
>
> yours
> value="imgname=${products.productId}_price.png&v1=${products.productPrice}&v2=${products.productPrice}"
>
> mine
> value="imgname=${products.productId}_price.png&v1=${products.productPrice}&v2=${products.productPrice}"
>
>
> ;)