Link to home
Start Free TrialLog in
Avatar of Schuyler Kuhl
Schuyler Kuhl

asked on

remove one row from xml data

Greetings,

I have some xml data containing colums "image number" and "image path".

How do I remove one row where image number=10 before I display the images?

The row with image number=10 is the "Main" image.  I can pull that one image out to display it separately and I can display the entire set as a group but I can't figure out how to remove that one row before displaying the rest of the images.

I am using php with SimpleXMLElement and a foreach loop to run through the xml data and display each image.

I hope I am describing this accurately enough.  Thank you in advance for your help.

Best regards,

Sky
Avatar of Kent Dyer
Kent Dyer
Flag of United States of America image

Please post an XML string that contains your test data.  I'll be glad to show you the code.
Avatar of Schuyler Kuhl
Schuyler Kuhl

ASKER

Thank you very much.

There are perhaps 8-15 <PropertyImg> and the main one always seems to be imageNo=10


<Property> 
<PropertyImg>
<propertyId>2290</propertyId> 
 <imageNo>10</imageNo> 
 <imagepath>http://agent.barefoot.com/corp/vre/v3ckl0325/images/properties/2290/main.jpg</imagepath> 
 <imageDesc /> 
 </PropertyImg> 
  <PropertyImg> 
  <propertyId>2290</propertyId> 
  <imageNo>1000</imageNo> 
  <imagepath>http://agent.barefoot.com/corp/vre/v3ckl0325/images/properties/2290/1998.jpg</imagepath> 
  <imageDesc xml:space="preserve"> </imageDesc>
  </PropertyImg> 
</Property>

Open in new window

Sorry to be "picky" but if I remove one image (image number 10) from this, there is nothing left.  Can you please give us something with maybe one or two image numbers (10 and some others that are not 10)?  Thanks, ~Ray
Sorry for the delay.

That example has two items of  <PropertyImg>

One is property image =10 and he next is property image = 1000

After that it continues on with every  <PropertyImg>  incrementing by 10.  But I know that those numbers don't really represent anything but they are just used to sort the order of the images.  So 1010 will come before 1020 and so on.

Best regards,

Sky
ASKER CERTIFIED SOLUTION
Avatar of Schuyler Kuhl
Schuyler Kuhl

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Glad you got it sorted.  My apologies -- I guess I misread the XML string.  Probably the indentation confused me.  Now that I look at it again with fresh eyes I can see there are really two nodes at the PropertyImg level.
No worries. Thanks for your help as always.

What shoud I do with the points on this one?
I discoverd the solution by researching it and then posted the answer.