I want to have files like this:


Title1 goes here

Content1 goes here

and then use this data with something like:


Place <contents of titletag from File1.xml> here


Is this a reasonable request? How would I do such a thing?



Recommended Answers

All 5 Replies

Not sure daviddoria, but you could parse the XML in javascript.

Is there no "built in" function to extract the contents of a tag? This seems like a pretty basic thing to do - if it is no built in, does anyone have a script that I could use?

The goal is to do this:


<a href=...> <Event1 Title> </a>
<a href=...> <Event2 Title> </a>

Where I can have the same "template", a page that displays the <Event N title> and <Event N Body>. I currently have Event1.html, ... EventN.html but it seems silly to have the same code copied over and over in all of the Event*.html pages, so I was trying to have an EventTemplate.html and "pass" it the contents of the Nth event to display (which were extracted from the <titletag> and <bodytag> tags of the "xml" style file.

Any thoughts?



Hey David

Glad you solved it. I thought that you should be able to find something on that link that will help you, and you did.

Good luck

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.