|
-
July 9th, 2008, 03:12 AM
#1
PHP XML CDATA Problem
Hi,
I have a weird problem with CDATA in my PHP code...
The code goes like this... I query all records into a temporary variable and loop through all of them to create my own xml string.
then save the string into a file (example: file1.xml)
The problem is when I try to examine my xml file "file1.xml" I see one of my CDATA tag... is changed from <![CDATA[]] into <!YCDATA[]]..... or <![CDATA[]] into <![CDATAY]].....
This weird character Y keeps on appearing and it jack up my XML file... anybody have a solution to this... or have encountered the same problem?
Please help....
Thanks
-
July 9th, 2008, 07:32 AM
#2
Re: PHP XML CDATA Problem
Never seen that before. But, if you notice, it isn't changing both [ brackets. That would rule out any character encoding problems. To me, it seems that the only thing that could be doing this is how you are reading the XML file. Are you sure that there isn't some accidental string replacing?
Could you post your code so that we might be able to test it out as well?
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
July 22nd, 2008, 10:59 PM
#3
Re: PHP XML CDATA Problem
Hi,
Thanks for the reply,
The problem has not occur for sometimes now.... the strange thing is I never make any changes to the code....
Anyway if the problem comes out again.... I'll try to contact you... I'm not sure if I can give you an exact copy of the script as our company is very strict with that....
Anyway....
Thanks much....
-
July 28th, 2008, 02:59 PM
#4
Re: PHP XML CDATA Problem
Try typing more of the CDATA segments, just empty, if it is messing with the XML, it should change all the CDATA blocks with that Y character.
I don't know whether or not it will give you an error because the extra block are there, or they are empty, but that's what I would do.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|