Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am creating a table using DataGridView that displays columns based on the nodes in an xml file.

The cell values are contained within each node like simple xml.

The issue I am having is that some of the cells value contain '<','>', and other recognized xml symbols.
This is preventing the DataGridView to display the formatted xml file.

Any help would be greatly appreciated.
Posted
Updated 11-Jul-11 21:39pm
v3
Comments
Dalek Dave 12-Jul-11 3:34am    
Edited for Readability.

Hi,

Try to see this link if it could help...

Getting an Exception in process of loading xml file in javascript

I think this is similar to what you want


Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Regards,

Algem
 
Share this answer
 
Under the rules of XML special characters line < have to be handled differently.

Consider this snippet
<place>MyHome</place>


Now if I want to express the text "MyHome > 1" then a different XML syntax is required:
<place><![CDATA[MyHome > 1]]></place>


How you parse it is a design issue. For example in my applications I don't cater for special characters, but if I enter <![CDATA[MyHome > 1> in a text box it will save as valid XML and reload.
Now if I needed that feature more often I could build some parsing in to detect special characters and provide CDATA wrapping / unwrapping.

I have verified the example by applying a schema using Altova and it is both well formed and valid.]
 
Share this answer
 
v7
Comments
Dalek Dave 12-Jul-11 3:35am    
Good answer.
(I did an edit for some atrocious spelling though :))
Ger Hayden 12-Jul-11 4:22am    
Thanks - I'll write them out 10 times (without using copy and paste).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900