AnsweredAssumed Answered

org.xml.sax.SAXParseException

Question asked by johnmukkad on Jun 30, 2009
Latest reply on Jul 1, 2009 by johnmukkad
hai friends,
iam trying to create webcontent using webformsin alfresco 3.2 lab preview.whenever i created the webcontent it shows the error given below

Error generating rendition using style.xslt: org.xml.sax.SAXParseException: The element type "td" must be terminated by the matching end-tag "</td>".

the log file is given below

15:34:34,043 ERROR [org.alfresco.web.ui.common.Utils] Error generating rendition using style.xslt: org.xml.sax.SAXParseException: The element type "td" must be terminated by the matching end-tag "</td>".
org.alfresco.web.forms.RenderingEngine$RenderingException: org.xml.sax.SAXParseException: The element type "td" must be terminated by the matching end-tag "</td>".
   at org.alfresco.web.forms.XSLTRenderingEngine.render(XSLTRenderingEngine.java:396)
   at org.alfresco.web.forms.XSLTRenderingEngine.render(XSLTRenderingEngine.java:377)
   at org.alfresco.web.forms.RenderingEngineTemplateImpl.render(RenderingEngineTemplateImpl.java:332)
   at org.alfresco.web.forms.RenderingEngineTemplateImpl.render(RenderingEngineTemplateImpl.java:305)
   at org.alfresco.web.bean.wcm.CreateWebContentWizard.saveContent(CreateWebContentWizard.java:595)
   at org.alfresco.web.bean.wcm.CreateWebContentWizard$2.execute(CreateWebContentWizard.java:285)
   at org.alfresco.web.bean.wcm.CreateWebContentWizard$2.execute(CreateWebContentWizard.java:282)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:326)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:233)
   at org.alfresco.web.bean.wcm.CreateWebContentWizard.next(CreateWebContentWizard.java:293)
   at org.alfresco.web.bean.wizard.WizardManager.next(WizardManager.java:560)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
   at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
   at javax.faces.component.UICommand.broadcast(UICommand.java:109)
   at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
   at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
   at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
   at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:110)
   at sun.reflect.GeneratedMethodAccessor499.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:122)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy193.doFilter(Unknown Source)
   at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:88)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:74)
   at sun.reflect.GeneratedMethodAccessor499.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:122)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy193.doFilter(Unknown Source)
   at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:88)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Thread.java:595)
Caused by: org.xml.sax.SAXParseException: The element type "td" must be terminated by the matching end-tag "</td>".
   at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
   at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:98)
   at org.alfresco.web.forms.XMLUtil.parse(XMLUtil.java:163)
   at org.alfresco.web.forms.XSLTRenderingEngine.render(XSLTRenderingEngine.java:392)
   … 57 more

and the schema  pressrelease1234.xsd is given below
<?xml version="1.0"?>
<!–
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.

* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.

* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception.  You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"

Describes a press release and related assets.
–>
<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">

  <!– dynamically loads the company footer choices simple type –>
  <xs:include schemaLocation="/media/releases/get_company_footer_choices_simple_type.jsp"/>

  <xs:simpleType name="category">
    <xs:restriction base="xs:normalizedString">
      <xs:enumeration value="Product"/>
      <xs:enumeration value="Partnership"/>
      <xs:enumeration value="Company"/>
      <xs:enumeration value="Event"/>
      <xs:enumeration value="Training"/>
    </xs:restriction>
  </xs:simpleType>

  <!– defines the form for creating a press release –>
  <xs:element name="press_release1234">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="title" type="xs:normalizedString"/>
        <xs:element name="abstract" type="xs:normalizedString"/>
        <xs:element name="location" type="xs:normalizedString"/>
        <xs:element name="body" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
   <xs:element name="include_company_footer" type="pr:company_footer_choices" minOccurs="1" maxOccurs="unbounded"/>
   <xs:element name="include_media_contacts" type="xs:boolean" default="true"/>
   <xs:element name="keywords" type="xs:normalizedString" minOccurs="0" maxOccurs="unbounded"/>
   <xs:element name="category" type="pr:category" default="Company"/>
   <xs:element name="launch_date" type="xs:date"/>
   <xs:element name="expiration_date" type="xs:date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

and the  rendering xsl form style.xslt is given below

<?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>
          <!– include common navigation components using SSIs (see web.xml for more information) –>
    <xsl:comment>#include virtual="/assets/include_in_head.html"</xsl:comment>
    <title><xsl:value-of select="/pr:press_release1234/pr:title"/></title>
    <meta name="description" lang="en" >
     <xsl:attribute name="content"><xsl:value-of select="/pr:press_release1234/pr:title"/></xsl:attribute>
         </meta>
    <style type="text/css">
     p.leader {
     font-weight: 700;
     }
    </style>
  </head>
 
 
 
 
  <body>
    <table width="100%" border="1" bgcolor="LemonChiffon">
      <tr>
        <td colspan="2" width="100%">
        <h1>Header</h1>
        (common to every page of the site)</td>
      </tr>
      <tr height="300" valign="top">
        <td width="75%" bgcolor="Aqua">
            <!– BEGIN MAIN CONTENT –>
                <h1><xsl:value-of select="/pr:press_release1234/pr:title"/></h1> 
      
                <p><strong><xsl:value-of select="/pr:press_release1234/pr:abstract"/></strong></p>
      
                <p></p>
             <xsl:for-each select="/pr:press_release1234/pr:body">
                 <p>
                     <xsl:variable name="body-text"><xsl:value-of select="normalize-space(.)" disable-output-escaping="yes"/></xsl:variable>
          
               <xsl:if test="position()=1"><xsl:value-of
               select="normalize-space(/pr:press_release1234/pr:location)"/>&#8212;<xsl:value-of
               select="normalize-space(/pr:press_release1234/pr:launch_date)"/>&#8212;</xsl:if><xsl:value-of select="alf:encodeQuotes($body-text)" disable-output-escaping="yes"/>
               </p>
                </xsl:for-each>
    </td>
        <td width="25%">
        <h1>Headlines</h1>
        (common to every page of the site)


                    <xsl:for-each select="/pr:press_release1234/pr:include_company_footer">
            
                                        <xsl:variable name="cf-id"><xsl:value-of select="."/></xsl:variable>
                                        <!– load the xml document for the company footer using a built in FormDataFunction –>
                                        <xsl:variable name="cf" select="alf:parseXMLDocument($cf-id)"/>
                                             <h2>About <xsl:value-of select="$cf/pr:name"/></h2>
                                   <xsl:for-each select="$cf/pr:body">
                                       <xsl:variable name="bd-text"><xsl:value-of select="normalize-space(.)" disable-output-escaping="yes"/></xsl:variable>
                                    <p><xsl:value-of select="alf:encodeQuotes($bd-text)" disable-output-escaping="yes"/></p>
                                   </xsl:for-each>
                          </xsl:for-each>
                          <xsl:if test="/pr:press_release1234/pr:include_media_contacts='true'">
                                        <h2>Media Contacts</h2> 
                    <div><p>John Newton<br />Alfresco Software Inc.<br />+44 1628 860639<br />press@alfresco.com</p>
          </div>
                     <div>   <p>Chuck Tanowitz<br />Schwartz Communications<br />+1 781  684-0770<br/>alfresco@schwartz-pr.com</p>
          </div>
                          </xsl:if>
               <!– END MAIN CONTENT –>



          <xsl:element name="a">
         <xsl:attribute name="href">
      <xsl:value-of select="fn:replaceAll(string($alf:form_instance_data_file_name), '.xml', '.txt')"/>
         </xsl:attribute>
         <xsl:text>view plain text version</xsl:text>
       </xsl:element>
     </div>
     <!– Feature Content –>
     <div id="right_content">
       <div class="box_blue">
         <h2>Press Releases By Category</h2>

         <!– store the current category in a variable for later comparison –>
         <xsl:variable name="my_category"
             select="/pr:press_release1234/pr:category"/>
         <!– store the current title in a variable for later comparison –>
         <xsl:variable name="my_title"
             select="/pr:press_release1234/pr:title"/>
         <!– load all press releases into a variable by calling into a form data function –>
         <xsl:variable name="all_press_releases"
             select="alf:parseXMLDocuments('press-release')"/>
         <ul>
      <!– select a unique set of categories for the first level navigation –>
      <xsl:for-each select="$all_press_releases[not(pr:category=preceding-sibling::pr:press_release1234/pr:category)]">
        <xsl:sort select="pr:category"/>
        <li>
          <xsl:choose>
            <!– for the current category, present all press releases in this category –>
            <xsl:when test="pr:category=$my_category">
         <b><xsl:value-of select="pr:category"/></b>
         <ul>
           <!– iterate all press releases which are in my_category –>
           <xsl:for-each select="$all_press_releases[pr:category=$my_category]">
             <xsl:sort select="pr:title"/>
             <li>
               <xsl:element name="a">
            <xsl:if test="$my_title=pr:title">
              <xsl:attribute name="style">font-weight:bold;</xsl:attribute>
            </xsl:if>
            <xsl:attribute name="href">
              <xsl:value-of select="fn:replaceAll(string(@alf:file_name), '.xml', '.html')"/>
            </xsl:attribute>
            <xsl:value-of select="pr:title"/>
               </xsl:element>
             </li>
           </xsl:for-each>
         </ul>
            </xsl:when>
            <xsl:otherwise>
         <!–
         for other categories present a link to the first document in that category
         with the category label
         –>
         <xsl:element name="a">
           <xsl:attribute name="href">
             <xsl:value-of select="fn:replaceAll(string(@alf:file_name), '.xml', '.html')"/>
           </xsl:attribute>
           <xsl:value-of select="pr:category"/>
         </xsl:element>
            </xsl:otherwise>
          </xsl:choose>
        </li>
      </xsl:for-each>
         </ul>
         <h2>Press Release Archive</h2>
         <ul>
      <li><a href="/media/releases/archives/index.html">View Archived Releases</a></li>
         </ul>
       </div>
     </div>
     <div id="clear">&#160;</div>
   </div>
   <!–All Three End –>
   <xsl:comment>#include virtual="/assets/footer.html"</xsl:comment>

   
   
   
   </td>
      </tr>
    </table>
  </body>







</html>
</xsl:template>



</xsl:stylesheet>


please help meto solve this error.iam expecting your valuable response.thank you in advance
Regards,
Johnmukkad

Outcomes