Hi guys,
I'm a little bit green when it comes to XSL and I've got some code that I've got to tweak, can't really get my head round it so I thought I'd ask here.
Ok, I've got an XML document that looks something like this...
code:
<document xmlns:xf="http://apache.org/cocoon/jxforms/1.0">
<xf:form id="generic-refer" action="refer" method="GET">
<xf:group class="patientDetails">
<xf:label>Patient Details</xf:label>
<error>
<xf:violations class="error"/>
</error>
<xf:input ref="/title">
<xf:label>Title</xf:label>
<xf:violations class="error"/>
</xf:input>
<xf:input ref="/surname">
<xf:label>Surname</xf:label>
<xf:violations class="error"/>
</xf:input>
<xf:input ref="/firstname">
<xf:label>Firstname</xf:label>
<xf:violations class="error"/>
</xf:input>
</xf:group>
<xf:submit id="refer" continuation="foward" class="button">
<xf:label>Refer</xf:label>
<xf:hint>Click to refer</xf:hint>
</xf:submit>
</xf:form>
</document>
You can see here that it basically holds information about HTML form objects eg. input boxes, with their name and a label.
My XSL looks something like this...
code:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xf="http://apache.org/cocoon/jxforms/1.0">
<xsl:output method="xml" omit-xml-declaration="no"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="xf:input">
<input name="{@ref}" type="text" value="{xf:value/text()}" class="refTbox">
<!-- copy all attributes from the original markup, except for "ref" -->
<xsl:copy-of select="@*[not(name()='ref')]"/>
<xsl:apply-templates select="xf:hint"/>
</input>
</xsl:template>
</xsl:stylesheet>
*phew!
Ok, so when I run this I get a list of my items, but I want is to display them in a table layout, instead of them all being rendered one after the other on teh page, is there a way to do this with the XSL?
Sorry if this question is vague but any help or guidance would be appreciated.
Cheers,
Blaise.