Jump to content

begginer xml simple confusion on the images path ( any one above begginner will be able to help cheers )


hansolo

Recommended Posts

in the xml file to load the image. is this reffering below to a folder named images with a pic of a jpg named image.<image source="images/image.jpg"then what is the thumbnail reffering to would that not be duplicate of the image <images><image source="images/image.jpg" thumb="thumbnails"/image1.jpg">description= description of image</image></images>thumb="thumbnails"/image1.jpg"

Link to comment
Share on other sites

Assuming you match the quotation marks correctly:thumb="thumbnails/image1.jpg"refers to a directory called "thumbnails" that contains a file called "image1.jpg". So it really is a different file.Should the filenames be "image.jpg" and "image1.jpg", or is that just an error?

Link to comment
Share on other sites

If you are creating the XML document yourself, it would be better practice for the source, thumb, and description data to be elements, not attributes, like this:

<images>   <image>	  <source>images/image.jpg</source>	  <thumb>thumbnails/image1.jpg</thumb>	  <description>blah</description>   </image></images>

Link to comment
Share on other sites

If you are creating the XML document yourself, it would be better practice for the source, thumb, and description data to be elements, not attributes, like this:
I'd say it depends on the scenario really. I mean just look at the majority of standard specs - it's always an attribute, because all paths and/or URIs are a single string, and that's unlikely to ever change. Well, the allowed characters change, but not the fact that we're still talking about a single plain string.Excluding the "description=" part (which is pure nonsence here), I think:
<image source="images/image.jpg" thumb="thumbnails/image1.jpg">description of image</image>

is actually a nice design.But it's a matter of opinion, so yeah... an element or an attribute... doesn't exactly matter.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...