Related to my previous post (http://p2p.wrox.com/topic.asp?TOPIC_ID=40752
), I have a document filled with elements that I'm turning into an HTML form. I have:
1. An XML document describing each of the form fields that should appear on the page (these are dynamic based on what the user is doing, so I don't know the names of the elements).
2. A block I'm adding to the XML at run-time that provides existing content to populate the form elements with.
3. As an additional point of confusion, there can be more than one piece of content in #2; in these cases, I want to show one copy of the relevant form element from #1 for each piece of content.
<?xml version="1.0" encoding="utf-8" ?>
<keywords formelement="textarea" maxlength="255"></keywords>
<description formelement="textarea" maxlength="255"></description>
<title formelement="text" validation="notempty" errormessage="Please provide a title" sortable="alpha" maxlength="255"></title>
<strapline formelement="text" maxlength="255"></strapline>
<headerimage formelement="library" library="headerimages"></headerimage>
<tagline formelement="library" library="taglines"></tagline>
<maincontent formelement="richtext" allowmultiple="true" maincontent="true"></maincontent>
<focusareas formelement="noidea" allowmultiple="true"></focusareas>
I'm inserting a block in <page> called <contents>. For every item that has content, I'm inserting a child into <contents> named the same as the tag inside screens (e.g., /page/contents/maincontent) and then inserting each piece of content as an <item> child of that block.
What I've read suggests there's no dynamic XPath in XSLT 1.0. Given that, is there some way for me to get at the proper contents during a transformation?
Apologies for the confusing mess of a question. Let me know how best to clarify.