|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ok i am using a php script which calls an html template, in the html template the script dynamically populates an xml data island....
i like the way xml translates into html with a minimum of coding required, but is there anyway to pull an html link from the xml...ive tried a couple ways calling them all like so: <td> <span datafld="href"></span> <span datafld="label"></span></a> </td> here is the segment of the data island i am using <link> <label>Link Text</label> <href><a href=this.html></href> </link> -or- <href><a href=this.html></href> -or- <href><![CDATA[<a href=this.html>]]></href> and everytime i returns the full string in place instead of turning it into the proper html tag......how do you work around this?? is it possible to embed html tags in xml or is there another way to put the dynamic content into an html link??? thanks in advance |
|
#2
|
||||
|
||||
|
<UPDATE> Ha! This was posted 3 years ago!
Don't suppose you're still having the problem are you? I've used a data island with html tags in it before: This displays a picture and some information from a gallery of pictures. Buttons underneath call Javascript which selects the next or previous PHOTO node. Basically, the HTML tags aren't embedded inside the XML, they are described in the HTML file itself, with the XML providing only the data that fills the tags, (which I think is the correct separation of formatting versus data). example.htm: Code:
<html> <head> <xml src="photoalbum.xml" id="xmldso" async="false"></xml> </head> <body> <p> Title: <span datasrc="#xmldso" datafld="TITLE"></span> </p> <p> Description:<br /> <span datasrc="#xmldso" datafld="DESCRIPTION"></span> </p> <a datasrc="#xmldso" datafld="IMAGE" target="_blank"> <img alt="Click For Large Version" datasrc="#xmldso" datafld="THUMBNAIL" border="0"></img> </a> ... Buttons to move forward and back through the xml tree. </body> </html> example.xml: Code:
<PHOTO_ALBUM>
<PHOTO>
<TITLE>Picture Title</TITLE>
<DESCRIPTION>Picture Description</DESCRIPTION>
<THUMBNAIL>Picture TN.jpg</THUMBNAIL>
<IMAGE>Picture.jpg</IMAGE>
<CATEGORY>My Category</CATEGORY>
</PHOTO>
</PHOTO_ALBUM>
Everybody feel free to comment on this if it's wrong, as I'm new at XML myself! Hope this helps, Jamie.
__________________
Practise Random Kindness Last edited by majelbstoat : February 27th, 2004 at 07:58 PM. |
|
#3
|
||||
|
||||
|
Is that IE specific?
__________________
Hello, old friend... |
|
#4
|
||||
|
||||
|
Yeah the <XML> tag is IE specific I think. Is there a good, recommended way to do data extraction from an XML source document that is cross-browser compatible?
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > xml data island transformations |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|