You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by asif_zzz <as...@meteximtechnologies.com> on 2008/12/31 13:01:50 UTC

How to remove the namespace declaration in HTML output in CForms

Hi,
Im using Cocoon 2.1.10 CFORMS

My namespace declartion will look like this.

<page
	xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
	xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
	xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"
	xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
	xmlns:xi="http://www.w3.org/2001/XInclude">

I tried by adding a template(template name is = page) in XSL file to remove
the namespace information.
When i run the application it get removed from the html tag but i found that
the problem persists in sub tag.

<link xmlns:ft="http://apache.org/cocoon/forms/1.0#template" 
xmlns:fi="http://apache.org/cocoon/forms/1.0#instance" 
xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" 
xmlns:xi="http://www.w3.org/2001/XInclude" type="text/css" rel="stylesheet"
href="../style1.css">

Anyone please tell me ,how to solve this issue??

Thanks in Advance,
Aashik.

-- 
View this message in context: http://www.nabble.com/How-to-remove-the-namespace-declaration-in-HTML-output-in-CForms-tp21230492p21230492.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How to remove the namespace declaration in HTML output in CForms

Posted by Luca Morandini <lm...@ieee.org>.
asif_zzz wrote:
> 
> Anyone please tell me ,how to solve this issue??

A known issus, some explanations and solutions listed on:
http://wiki.apache.org/cocoon/RemoveNamespaces

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How to remove the namespace declaration in HTML output in CForms

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jan 1, 2009, at 10:20 PM, asif_zzz wrote:

>
> Hi ,
>
> Thanks for the replies,
> I already tried using this template given by Francesco. When i apply  
> the
> template my HTML output got collapsed,and showing all page contents  
> in a
> normal text(ie like label's in HTML output).
>
> Then i tried some other ways specified by Luca Morandini,i tried 4th
> solution NamespaceStripperTransformer in my sitemap.
> It works but still it showing below namespace in my code
>
> <fi:items xmlns:fi="http://apache.org/cocoon/forms/1.0#instance">
>
> Im using Cocoon 2.1.10.
> It dont no ,why the fi:items tag is in HTML output,rest of the HTML  
> output
> is good,except this.
> I've tabs in my page,so i used like this format
>
> <fi:group id="Section1">
> <fi:label><i18n:text>page_Section1</i18n:text></fi:label>
> <fi:styling layout="columns"/>
> <fi:items>
>
> Any suggestions,

It looks like your XML is not getting run through the CForms XSLT  
stylesheets to render the CForms widgets into HTML controls.  The  
presence of a namespace attribute is the least of your worries here,  
because <fi:items> does not belong in the HTML at all! :-).  Also, it  
looks like you are missing the I18NTransformer in your pipeline.

cheers,
—ml—


Re: How to remove the namespace declaration in HTML output in CForms

Posted by asif_zzz <as...@meteximtechnologies.com>.
Hi ,

Thanks for the replies,
I already tried using this template given by Francesco. When i apply the
template my HTML output got collapsed,and showing all page contents in a
normal text(ie like label's in HTML output).

Then i tried some other ways specified by Luca Morandini,i tried 4th
solution NamespaceStripperTransformer in my sitemap.
It works but still it showing below namespace in my code

<fi:items xmlns:fi="http://apache.org/cocoon/forms/1.0#instance">

Im using Cocoon 2.1.10.
It dont no ,why the fi:items tag is in HTML output,rest of the HTML output
is good,except this.
I've tabs in my page,so i used like this format

<fi:group id="Section1">
<fi:label><i18n:text>page_Section1</i18n:text></fi:label>
<fi:styling layout="columns"/>
<fi:items>

Any suggestions,

Thanks and regards,
Aashik



-- 
View this message in context: http://www.nabble.com/How-to-remove-the-namespace-declaration-in-HTML-output-in-CForms-tp21230492p21248445.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How to remove the namespace declaration in HTML output in CForms

Posted by Francesco Chicchiriccò <fr...@everett.it>.
asif_zzz ha scritto:
> Hi,
> Im using Cocoon 2.1.10 CFORMS
>
> My namespace declartion will look like this.
>
> <page
> 	xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
> 	xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
> 	xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"
> 	xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
> 	xmlns:xi="http://www.w3.org/2001/XInclude">
>
> I tried by adding a template(template name is = page) in XSL file to remove
> the namespace information.
> When i run the application it get removed from the html tag but i found that
> the problem persists in sub tag.
>
> <link xmlns:ft="http://apache.org/cocoon/forms/1.0#template" 
> xmlns:fi="http://apache.org/cocoon/forms/1.0#instance" 
> xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" 
> xmlns:xi="http://www.w3.org/2001/XInclude" type="text/css" rel="stylesheet"
> href="../style1.css">
>
> Anyone please tell me ,how to solve this issue??
Hi,
in these cases, I usually add an XSL transformation with a stylesheet 
like the following (found sometime ago somewhere in Internet); as you 
can see, it is quite a hack, but it does the job ;-)


<?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" encoding="UTF-8" />

  <xsl:template match="*">
    <xsl:choose>
      <!-- <div> + CSS bug's workaround for MSIE and Mozilla -->
      <xsl:when
        test="local-name()='div' and @id='forms_calendarDiv'">
        <xsl:element name="div">
          <xsl:attribute name="id">
            forms_calendarDiv
          </xsl:attribute>
          &#160;
        </xsl:element>
      </xsl:when>

      <!-- default behavior: remove all namespaces -->
      <xsl:otherwise>
        <!-- remove element prefix (if any) -->
        <xsl:element name="{local-name()}">
          <!-- process attributes -->
          <xsl:for-each select="@*">
            <!-- remove attribute prefix (if any) -->
            <xsl:attribute name="{local-name()}">
              <xsl:value-of select="." />
            </xsl:attribute>
          </xsl:for-each>
          <xsl:apply-templates />
        </xsl:element>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

</xsl:stylesheet>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org