Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-13-2012, 04:32 PM   PM User | #1
surreal5335
Regular Coder

 
Join Date: May 2008
Posts: 446
Thanks: 23
Thanked 5 Times in 5 Posts
surreal5335 is an unknown quantity at this point
echoing simplexml problems

I have a simpleXML object that I use addChild on then use a foreach loop to echo out specific node values.

Before the addChild is performed the simpleXml gets the data just fine. Afterwards The data from the foreach will echo nothing and it will iterate through 3 times when there is only 2 nodes to loop through.

BUT....

if I run a print_r() on my simpleXml object before I run my foreach, bam problem solved. turn off the print_r() and the problem returns.

do I need to parse my data as a string for the echo? It works fine until the addChild method is run.

I have checked my xml with nodes and all to make sure that all the nodes were there as they should be, so this is not the problem.

Any thoughts?
surreal5335 is offline   Reply With Quote
Old 06-13-2012, 06:35 PM   PM User | #2
Alex Vincent
Moderator


 
Join Date: May 2002
Location: Hayward, CA
Posts: 1,427
Thanks: 1
Thanked 19 Times in 17 Posts
Alex Vincent is on a distinguished road
Post the code?
__________________
"The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
June 30, 2001
author, Verbosio prototype XML Editor
author, JavaScript Developer's Dictionary
https://alexvincent.us/blog
Alex Vincent is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:44 AM.


Advertisement
Log in to turn off these ads.