View Single Post
  #1 (permalink)  
Old July 1st, 2009, 04:20 PM
pdimilla pdimilla is offline
Registered User
 
Join Date: Jul 2009
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Question Using XSLT to tranform XML into JSF

Hi,

I am trying to find a example of using XSLT to transform XML into JSF. I've seen a couple of threads in other forums that indicate that this is easy; however, when I've tried it I've run into problems. Searching the web has yielded no good examples. In particular, I am having trouble with the taglibs. Here's my stylesheet:

Code:
 
<?xml version="1.0"?> 
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:b64="xalan://com.hospira.mms.mmu.core.utility.base64.Base64"
xmlns:dep="xalan://com.hospira.mms.mmu.apps.softwaremanagement.Deployer"
extension-element-prefixes="b64 dep">

<xsl:template match="TAG">
<html>
<xsl:text disable-output-escaping="yes">
&lt;%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
&lt;%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
&lt;%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
&lt;%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
</xsl:text>
<body>
<img src="../hmss/images/MedNet50.jpg" />
<h:dataTable>
<h:column>
<f:facet name="header">
<h:outputText value="tag id"/>
</f:facet>
<h:outputText value="<xsl:value-of select="tagid"/>"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="mac address"/>
</f:facet>
<h:outputText value="<xsl:value-of select="mac"/>"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="map name"/>
</f:facet>
<h:outputText value="<xsl:value-of select="posmapname"/>"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="timestamp"/>
</f:facet>
<h:outputText value="<xsl:value-of select="postimestamp"/>"/>
</h:column>
</h:dataTable>
<xsl:variable name="data" select="data_b"/>
<xsl:value-of select="b64:decodeToFile($data,'map.png')"/>
<img src="{dep:deployFile('map.png')}" />
</body>
</html>
</xsl:template>

</xsl:stylesheet>
I am using the XALAN processor. My operating system is Windows XP. My problem is strictly with the taglibs. Any help is appreciated.

Regards,
Paul
Reply With Quote