Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Nasir on Mar 27, 2008 06:22
open dhtmlx forum
Combobox load xml error character

HI,

I'm using the dhtmlxcombo with filtering mode, where i load the content trough a php file. However, i get the load xml error. when i open the php file. it indicates that whitespace is not allowed at this location. I only get this error in one string where the string contains the "&" character in the combo list.

the following string indicates an whitespace error after the "&" character

Aann.mij. De Vries & v.d. Wiel BV

how to solve this problem?

kind regards,
Nasir
Answer posted by Support on Mar 27, 2008 07:24
The & is prohibited by XML rules, it must be replaced with &
There are two ways
a) direct escaping
    <option value="123">Aann.mij. De Vries &amp; v.d. Wiel BV </option>
b) using CDATA
    <option value="123"><![CDATA[ Aann.mij. De Vries & v.d. Wiel BV ]]></option>
Answer posted by Nasir on Mar 27, 2008 07:30
Thnx! it worked like a charm.
Answer posted by Nasir on Apr 10, 2008 06:14

Hi,

I'm again fasing a problem with illegal chracters in the combobox. I'm using filteringmode and loading data from a php file. The problem i'm fasing is that when i replace strings containing '&' with the &amp; it does not show any load xml error however, when i submit the form it does not pass the option value. i tried checkking the following variable NAME_new_value, but it displays the value true. From what i have read this mean that the value typed does not match any item in the list. But in my case i select the option using the arrow keys which is already in the list. Can u please tell me what a possible soloution to this is?

Thnx!

Answer posted by Support on Apr 10, 2008 08:00
There are two possible solution

a) use double escaping for & char in XML ( first escaping - to accommodate  XML rules, second for correct HTML rendering )

        <option value="4">A &amp;amp; B</option>

b) update dhtmlxcombo.js , comment line 197
    value=value.replace(/&/g,"&amp;")
Answer posted by Nasir on May 14, 2009 01:27

Hi,

I'm getting a load xml error when i enter a single quote in the dhtmlxcombo. Can you tell me a way to fix this?

Kind Ragrds,

Nasir

Answer posted by Alex (support) on May 14, 2009 01:31

Hello, 

could you please provide the example of the problematic xml.

Answer posted by Nasir on May 14, 2009 01:48

Hi,

please see the following situation.

<option value="28">Akzo Nobel Base Chemicals R'dam</option>

when I type the single quote i get tje load xml error. I use php file to load the data from the database.

King regards,

Nasir

Answer posted by Alex (support) on May 14, 2009 02:10

There shouldn't be issues with this xml...

Try to place the text into CDATA tag. Possibly it'll help:

<option value="28"><![CDATA[ some text ' some text ]]></option>

Answer posted by Nasir on May 14, 2009 02:21

It still doesn't seem to fix the problem. Please find attached a sample of the xml file.

Kind regards,

Nasir

Attachments (1)
test.xml5.26 Kb
Answer posted by Alex (support) on May 14, 2009 02:58
locally the same xml works.We have attached the sample.
Attachments (1)
Answer posted by Nasir on May 14, 2009 05:56

it seamed that i had old version of the .js files.

thanx!