AnsweredAssumed Answered

cannot capture the content thru XSLT

Question asked by hansraj on Sep 29, 2008
Hi,

We are very new to Alfresco. Our requirement is displaying content in preview template.

We created a form using XSD and a template using XSL. we have given input in the form, when we are trying to preview the data in preview template, the given data is not gettig displayed.

code in XSD file - myctd.xsd:
———————————-

<?xml version="1.0"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:pr="http://www.alfresco.org/alfresco/pr"
           targetNamespace="http://www.alfresco.org/alfresco/pr"
           elementFormDefault="qualified">


  <!– defines the form for creating a company footer –>
  <xs:element name="myctd">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="name1" type="xs:normalizedString"/>
        <xs:element name="name2" type="xs:normalizedString"/>

    </xs:sequence>
   </xs:complexType>
  </xs:element>

</xs:schema>

—————————————————————————————–

code in XSL file - mytemp.xsl:
———————————-

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"
      xmlns:xhtml="http://www.w3.org/1999/xhtml"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:pr="http://www.alfresco.org/alfresco/pr"
      xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
      exclude-result-prefixes="xhtml">

  <xsl:output method="html"  encoding="UTF-8" indent="yes"
              doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
              doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'/>

  <xsl:preserve-space elements="*"/>

  <xsl:template match="/">

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
     <head>
   
   
      </head>
      <body>
      <h1>hello<h1>

      <h1><xsl:value-of select="/pr:myctd/pr:name1"/></h1>
    
      </body>
  </html>
  </xsl:template>
</xsl:stylesheet>

———————————————————–

could anybody tell us where are we going wrong ?
Thanks in advance.


Regards,
swamy

Outcomes