how to map the image in html file

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 10:54 AM
hi friends
I am new to alfresco and i am facing some difficulty in it that is.
I have used xsd and xsl to create a webform. I have captured data using the web form, which gave me an HTML and an xml output. While capturing data in the webform i selected the image which is in root ,and click next every thing is ok but
I am unable to see the gif in the generated html.
my XSD file is
=================================
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:nf="http://www.alfresco.org/alfresco/nf"
targetNamespace="http://www.alfresco.org/alfresco/nf"
elementFormDefault="qualified">
<!– defines the form for creating a navigation hierarchy –>
<xs:element name="Template1">
<xs:complexType>
<xs:sequence>
<xs:element name="Author" type="xs:normalizedString" />
<xs:element name="Description" type="xs:string"/>
<xs:element name="Image" type="xs:anyURI"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
my xsl file is
====================
<?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:nf="http://www.alfresco.org/alfresco/nf"
xmlns:fn="http://www.w3.org/2005/02/xpath-functions" exclude-result-prefixes="xhtml">
<xsl
utput 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
reserve-space elements="*"/>
<xsl:template match="/">
<table>
<tr>
<td>
<xsl:value-of select="/nf:Template1/nf:Author"/>
</td>
</tr>
<tr>
<td colspan="2">
<xsl:value-of select="/nf:Template1/nf
escription" disable-output-escaping="yes"/>
</td>
</tr>
<tr>
<td>
<img alt="abc">
<xsl:attribute name="src">
<xsl:value-of select="concat($alf:request_context_path,./container/header_image)"/>
</xsl:attribute>
</img>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
please help me
thanks in advance
amit
I am new to alfresco and i am facing some difficulty in it that is.
I have used xsd and xsl to create a webform. I have captured data using the web form, which gave me an HTML and an xml output. While capturing data in the webform i selected the image which is in root ,and click next every thing is ok but
I am unable to see the gif in the generated html.
my XSD file is
=================================
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:nf="http://www.alfresco.org/alfresco/nf"
targetNamespace="http://www.alfresco.org/alfresco/nf"
elementFormDefault="qualified">
<!– defines the form for creating a navigation hierarchy –>
<xs:element name="Template1">
<xs:complexType>
<xs:sequence>
<xs:element name="Author" type="xs:normalizedString" />
<xs:element name="Description" type="xs:string"/>
<xs:element name="Image" type="xs:anyURI"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
my xsl file is
====================
<?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:nf="http://www.alfresco.org/alfresco/nf"
xmlns:fn="http://www.w3.org/2005/02/xpath-functions" exclude-result-prefixes="xhtml">
<xsl

doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'/>
<xsl

<xsl:template match="/">
<table>
<tr>
<td>
<xsl:value-of select="/nf:Template1/nf:Author"/>
</td>
</tr>
<tr>
<td colspan="2">
<xsl:value-of select="/nf:Template1/nf

</td>
</tr>
<tr>
<td>
<img alt="abc">
<xsl:attribute name="src">
<xsl:value-of select="concat($alf:request_context_path,./container/header_image)"/>
</xsl:attribute>
</img>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
please help me
thanks in advance
amit
Labels:
- Labels:
-
Archive
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 03:49 PM
Hi,
I'm not sure, but my first idea was that
Cheers, Jan
I'm not sure, but my first idea was that
<xsl:value-of select="concat($alf:request_context_path,./container/header_image)"/>
should be <xsl:value-of select="concat($alf:request_context_path,'./container/header_image')"/>
./container/header_image needs some ''.Cheers, Jan

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2008 12:00 AM
hi
thanks for your reply ,
but problem is not solved
thanks for your reply ,

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2008 01:15 AM
Initial thinking… there isn't a reference to the image attribute in your XSLT. I.e. a line that says "/nf:Template1/nf:Image".
Assuming the line should be something along the lines of
Assuming the line should be something along the lines of
<xsl:value-of select="concat($alf:request_context_path,./nf:Template1/nf:Image)"/>

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2008 04:49 AM
thank you all for for your valuable reply , my problem is solved thanks both of u

