This topic may be similar to several other questions out there, but as far as I can see this is a unique problem I'm trying to solve. FWIW, I'm primarily a designer; I'm dangerous with Flash and HTML and CSS, but a bit in the weeds with everything else. From searching around, I appear to be heading for a ajax/jquery solution, which I need some help with.

To begin, I have built a fairly complex Flash interface which pulls content from a well-formed and validated XML file. This part is done, works beautifully.

However, the client wants to create a simple(r) javsScript version of the interface to be in place for viewers who don't have Flash. AND, they would like this version to pull values (text) from the SAME XML file, so they only need to edit the one file to make changes.

Seems like a reasonable request, but executing it doesn't appear to be quite so simple. The biggest hurdle is that I do not want to loop the XML for output - I want to call specific node values into specific elements.

They key is that each div has a different id, in order for each 'page' to have unique background colors and formatting. The idea is then that I would use a simple overlapping div script to show/hide each of these 'sections' within the same footprint.

Hopefully this makes sense, please don't hesitate for clarification. Any and all help is appreciated.

4 Answers
4

Sounds like you are trying to do a transformation from XML to HTML. For this you can use a technology called XSLT but commonly known by many as an xslt transformation. You can use xslt in conjunction with xpath (query language for xml) to do exactly what you describe in your question.

+1 for using the technology that's designed to solve the problem, instead of forcing the technology you want to use to fashion an ugly, non-intuitive, half-broken solution.
–
nearlymonolithJul 1 '10 at 21:16

1

Thanks Doug. I'd actually already played with XLST and gotten some promising results, but didn't/don't know anything about xpath. Will check it out. Don't have enough rep or I'd give you +1.
–
OICJCJul 1 '10 at 21:50

@Doug - Thanks so much for the help. Between your answer and the others below (which are remarkably similar, telling me this is the right way to go!), I've got the XML formatting beautifully with an XSL file. The only part I'm missing is how to bring the XLS-transformed XML into my HTML page with the overlapping div script. Maybe that should be a separate question?
–
OICJCJul 2 '10 at 5:16

Can you clarify what problem you are experiencing? Sounds like you are doing the xsl transform and have the resultant html - are you doing the transform outside of the page? What technology are you using - straight html, php, asp, asp.net
–
DougJul 2 '10 at 15:30