Insert data from XML doc into XHTML template

knowbetter

Usenet Archive
Joined
Jun 25, 2004
Messages
1
Reaction score
0
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
 

GIMME

Usenet Archive
Joined
Jun 3, 2003
Messages
107
Reaction score
0
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
548,042
Messages
3,104,224
Members
248,132
Latest member
henrywalsh

Latest Threads

Top