I got answer from the SDL Tridion forum that we can enable inline editing for embedded schema "paragraph" that has "text" field in it.
It would be verty helpful if someone helps me to enable it for simple field.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="//*[local-name()='paragraph']">
<div>
<tcdl:ComponentField name="paragraph[{position() -1}].text" index="0">
<xsl:apply-templates select="./*[local-name()='text']"/>
</tcdl:ComponentField>
</div>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
This code loops through each embedded paragraph field, outputs the text field's value and wraps it with the appropriate SiteEdit TCDL syntax.
I am using Tridion 2011 SP1 and the XSLT mediator from SDLTridionworld.com.
Say my component has a field named "pageHeader". How can we enable inline editing in XSLT TBB.
Off the top of my head I think the following should work:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="//*[local-name()='pageHeader']">
<div>
<tcdl:ComponentField name="pageHeader[{position() -1}]" index="0">
<xsl:apply-templates select="."/>
</tcdl:ComponentField>
</div>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Or if it is a single value field:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<h1>
<tcdl:ComponentField name="pageHeader" index="0">
<xsl:value-of select="//*[local-name()='pageHeader'"/>
</tcdl:ComponentField>
</h1>
</xsl:template>
</xsl:stylesheet>