PhotoDune

XML Node Path

732 posts
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 5-6 years
URanimEnigma says
<?xml version="1.0" encoding="ISO-8859-1"?>
  <list>
    <item>
        <id>1</id>
        <images>images/img1.jpg</images>
        <title>Lorem Ipsum</title>
        <info>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut id nibh. Nulla sodales risus at tellus. Nulla congue laoreet neque. Pellentesque ut est. Nulla id sapien et sem dapibus blandit. Aenean nisi. Nunc justo. Phasellus suscipit. Vivamus molestie, pede vitae ultrices facilisis, felis nisi fermentum mauris, et placerat enim est at arcu. Fusce non enim tincidunt quam molestie volutpat.
        </info>
        <url>http://www.flashden.net</url>
        <linkname>www.flashden.net</linkname>
        <loadpic>
            <images img="pictures/pic1.jpg" />
            <images img="pictures/pic2.jpg" />
            <images img="pictures/pic3.jpg" />
        </loadpic>
        <preview>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut id nibh.</pre>

I'm trying to target the img attributes within the <images /> node. 

Anyone got any ideas how that would be accomplished? 
So far I've got...

<pre>
 portfolioXML.firstChild.childNodes[i].childNodes[6].childNodes
</pre>

But, I can't figure out where to go from there. 

Any help would be appreciated. 
Peace.

// Ben --
900 posts
  • Bought between 100 and 499 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 200 and 499 users
  • Sold between 100 000 and 250 000 dollars
  • United States
michaelhejja says

If you are going to have various amounts of images in there, since the tags are nested, you need a second loop within your loop to get inside.

732 posts
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 5-6 years
URanimEnigma says

Yeah, I tried that. But, it was hard to target the buttons. Anyway, since I am already using [i] for the first loop, do I use something other than [i] (like [j]) for the second loop? Or do I keep it [i]?

Thanks michealhejja.

412 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 1 and 9 users
  • Sold between 100 and 1 000 dollars
AlexH says
instead of
<images>images/img1.jpg</images>
dont you mean something like
<image path="folder/file.extension" />
or
<images>
   <image path="folder/file1.extension">
   <image path="folder/file2.extension">
   <image path="folder/file3.extension">
</image></image></image></images>
412 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 1 and 9 users
  • Sold between 100 and 1 000 dollars
AlexH says
Yeah, I tried that. But, it was hard to target the buttons. Anyway, since I am already using [i] for the first loop, do I use something other than [i] (like [j]) for the second loop? Or do I keep it [i]?

Thanks michealhejja.

you need to use a different variable than i or else it will conflict or become an endless loop or something. You don’t want endless loops, and you don’t want conflicts. so j will do fine.

And sorry for the double post. Anyway, good luck with it, i’m going to sleep :)

732 posts
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 5-6 years
URanimEnigma says

alright. I should be able to figure it out. If not, I’ll be back with more questions.

Thanks.

732 posts
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 5-6 years
URanimEnigma says

Thanks. With your help I figured it out.

Peace.

// URanimEnigma—

732 posts
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 5-6 years
URanimEnigma says

How exactly do you use cacheAsBitmap.

I have a mouse scroller but the darn thing works all crappy like. It jumps every few pixels.

CHECK IT

I’m trying to improve the portfolio I have already made. I’ve gotten everything done. I’m just left with this one problem.

Can someone answer me this. Does the jumping have to do with Bitmap caching?

by
by
by
by
by