cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Nelson" <jeremy.nel...@library.utah.edu>
Subject Dynamic generation of jx templates...
Date Sun, 20 Feb 2005 23:43:15 GMT
Hi,

I am trying to use jx templates to control the flow of a WebApp. What I
want to do is from a source XML document (in this case hr_resume.xml)
transform it into an intermediary HTML page that includes jx processing.
Is this possible? Here is what I have tried to do so far:

In my sitemap I first tired to do this:

<map:pipeline>
 <map:match pattern="page.jx">
  <map:generate type="jx" src="documents/hr_resume.xml" />
  <map:transform type="xslt" src="xsl/resume2HTML" />
  <map:serialize type="xhtml" />
 </map:match>
</map:pipeline>

My idea is to dynamically generate the jx template from an XML source
but when I tried to do this in the sitemap, the jx variables are not
showing up in the transformed HTML.

XML Excerpt:
<Resume xml:lang="en"
xmlns="http://ns.hr-xml.org/2_3/HR-XML-2_3/SEP/Resume.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink" >
<StructuredXMLResume>
<ContactInfo>
 <PersonName>
  <GivenName>Sally</GivenName>
  <FamilyName>Krup</FamilyName>
  .
  .
  .
</ContactInfo>
</StructuredXMLResume>
</Resume>

The XSLT:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:hr="http://ns.hr-xml.org/2_3/HR-XML-2_3/SEP/Resume.xsd"
  xmlns:jx="xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"">

<xsl:output type="html" />

<xsl:template match="/">
<html>
<head>
 <title>Resume Form</title>
</head>
<body>
 <form action="POST">
 <xsl:attribute
name="action">${cocoon.continuation.id}.kont</xsl:attribute>
 <input name="first_name" type="text" size="30">
 <xsl:attribute name="value"><xsl:value-of
select="//hr:Resume/hr:StructuredXMLResume/hr:ContactInfo/hr:PersonName/
hr:GivenName/." />
 </xsl:attribute>
 </input>
 <input type="submit" />
 </form>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

The Flowscript that calls page.jx:
function wizard()
{
   while(true) 
   {
     cocoon.sendPageAndWait("holiday",{"first_name": name});
   }

}

Thanks for your help.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message