Insert data from XML doc into XHTML template

K

knowbetter

Hi all,

I've got two XML docs in memory as strings. One doc contains data, the
other contains an XHTML-based template with custom tags for my
application. What would be the best way to get the data into the
template? Right now the custom tags are in the form <xxx:field
name="fieldname"> ...#ItemData#... </xxx:field>. Where xxx is a custom
namespace prefix "field" is the actual tag name, and "fieldname"
corresponds to the tag in my data XML doc. #ItemData# is a placeholder
representing where the user wants me to insert the actual data from
the field.

My goal here is similar to many Content Management templates. However,
I want to have the option of easily adding new custom tags in the
future should the need arise. I thought about using XSLT, but I'm not
sure how to properly combine these two docs into a 3rd (and,
critically, these are both in-memory strings, not files, so I assume
document() might not work). Can someone point me in the right
direction. Or is there a better way to go about this?

TIA,
Kelly
 
G

GIMME

Post a simple example of what you have and what you want ...

Right now the custom tags are in the form <xxx:field name="fieldname">
....#ItemData#... </xxx:field>.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top