Export Images as Nested Elements
-
Hi,
I’m creating an XML feed, using the custom XML format, that needs to list images like this:
<images> <image id="1"> <url>http://domain.com/imagefile.jpg</url> </image> </images>There doesn’t seem to be a way to do this using the XML Editor, so I’ve written a custom function which looks like this:
function image( $url = null) { $i = 1; foreach ( $url as $image ) { $output .= '<image id="' . $i . '"><url>' . $image . '</url\></image>'; $i++; } return htmlentities($output); }I’ve tried various different things, and it’s always output as text rather than XML, so isn’t passing validation.
Any help to get this working as needed would be greatly appreciated.
Thank you,
Mike
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Export Images as Nested Elements’ is closed to new replies.