Jump to content

xml parsing and smarty templates


bullchina

Recommended Posts

What results do you want to display? What do you want to parse the XML for? Why not simply use an XSL stylesheet to do your transformation, if that is indeed what you are doing? That's more standard than Smarty, anyway. :)
well i have this xml code:

[code]<?xml version="1.0" encoding="ISO-8859-1"?>
<projects>
<project>
<name>Test Project</name>
<date>2006</date>
<location>Barcelona, Spain</location>
<description><![CDATA[<p>This is a test project description with two paragraphs</p><p>this is the second paragraph</p> ]]></description>
<type>Corporate Garden</type>
<info>this is a field for extra information, about the clients, the size, price, etc...</info>
<directory>test</directory>
<images>
<image name="test.porch.jpg" title="this is image 1." />
<image name="test.firstfloor.jpg" title="this is image 2." />
<image name="test.firstfloor2.jpg" title="this is image 2." />
</images>
<files>
<file />
<file />
</files>
<status>built</status>
</project>
</projects>[/code]

and i want to be able to display the projects (there will be a lot of them) sorted by different parameters, like by type, by date, by location, and also be able to print out image thumbnails, hyperlinks to the big images, etc...

I also know very little about XSL, and i wouldn't even know where to start. I'm just learning smarty, and i have the whole rest of the site working in smarty.
Kind of depends how fast you learn things. It can be anywhere from fairly simple to magnificently comjplicated, depending on what you need to do.

XPath really isn't all that hard; it is XSLT that gets difficult.

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.