AnsweredAssumed Answered

Edit Web Content Wizard

Question asked by mohanakannan.1985 on May 2, 2011
Latest reply on May 3, 2011 by sujaypillai
Hi,

      I have created a web form by using xsd, xsl and ftl. Iam trying to edit a web content and i got the following error in alfresco explorer.

      java.lang.IllegalArgumentException: instance document root tag name invalid. expected sample, got html
     
      The files are below:
sample.xsd

<?xml version="1.0"?>

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

  <xs:element name="sample">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="name" type="xs:normalizedString"/>
        <xs:element name="city" type="xs:normalizedString"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>


sample.xsl

<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
<xsl:output method="xml" encoding="utf-8" indent="yes" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
<xsl:template match="/">
<xsl:element name="html">
<xsl:element name="body">
<xsl:element name="table">
<xsl:attribute name="cellspacing">0</xsl:attribute>
<xsl:attribute name="cellpadding">0</xsl:attribute>
<xsl:attribute name="border">0</xsl:attribute>
<xsl:element name="tr">
<xsl:element name="th">
Name
</xsl:element>
<xsl:element name="th">
City
</xsl:element>
</xsl:element>
<xsl:element name="tr">
<xsl:element name="td">
Mohan
</xsl:element>
<xsl:element name="td">
Theni
</xsl:element>
</xsl:element>
<xsl:element name="tr">
<xsl:element name="td">
Dev
</xsl:element>
<xsl:element name="td">
Madurai
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>


sample.ftl

<html>
<body>
<table cellspacing="0" cellpadding="0" border="0">
<tr><th>Name</th><th>City</th></tr>
<tr><td>${sample.name}</td><td>${sample.city}</td></tr>
<tr><td>${sample.name}</td><td>${sample.city}</td></tr>
</table>
</body>
</html>

anything wrong in my code. how to resolve this error.?
Thanks in advance..

Outcomes