You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mark H <ma...@markhorgan.com> on 2003/03/01 17:52:02 UTC

SourceWritingTransformer, namespaces problem with Cocoon 2.1

I'm trying to write an XSP to a file using SourceWritingTransformer but the
latest DOMStreamer (v2.1) with setNormalizeNamespacesOn to true adds a
namespace to every element rather than to the xsp:page element (so that the
logicsheets don't work), when I setNormalizeNamespacesOn to false it outputs
no namespaces and my hack of adding namespaces in an xsl stylesheet doesn't
work:

<xsl:attribute name="esql:esqlDummyAttr"
namespace="http://apache.org/cocoon/SQL/v2"/>

I've also tried adding the namespaces in the xsp:page in the xsl stylesheet
but I'm not sure if SourceWritingTransformer is stripping them out or DOM
serializer is ignoring them:

<xsl:template match="page">
	<xsp:page xmlns:xsp="http://apache.org/xsp"
xmlns:esql="http://apache.org/cocoon/SQL/v2"...

Any ideas, namespaces in general seem to cause me a lot of headaches.


output:

<xsp:page xmlns:xsp="http://apache.org/xsp">
	<content title="Students Home">
		<esql:connection xmlns:esql="http://apache.org/cocoon/SQL/v2">
			<esql:pool
xmlns:esql="http://apache.org/cocoon/SQL/v2">dkitCareers</esql:pool>
...

sitemap:

<map:match pattern="createTemplate">
	<map:act type="request">
		<map:parameter name="parameters" value="true"/>
		<!--gets the semi pseudo code from the db-->
		<map:generate type="serverpages" src="util/executeQuery.xsp">
			<map:parameter name="datasourceName" value="{global:datasourceName}"/>
			<map:parameter name="xpath" value="/structure{path}"/>
		</map:generate>
		<!--converts semi pseudo code into XSP-->
		<map:transform src="util/createTemplate.xsl">
			<map:parameter name="datasourceName" value="{global:datasourceName}"/>
			<map:parameter name="path" value="{path}"/>
		</map:transform>
		<!--wraps the proper tags around the XSP for the write-source
transformer-->
		<map:transform src="util/createFile.xsl">
			<map:parameter name="filename" value="views{path}.xsp"/>
		</map:transform>
		<!--writes it to a file-->
		<map:transform type="write-source"/>
		<map:serialize type="xml"/>
	</map:act>
</map:match>



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


Re: SourceWritingTransformer, namespaces problem with Cocoon 2.1

Posted by Murad Jura <mu...@asbt.uz>.
Bruno Dumon wrote:
> On Sat, 2003-03-01 at 17:52, Mark H wrote:
> 
>>I'm trying to write an XSP to a file using SourceWritingTransformer but the
>>latest DOMStreamer (v2.1) with setNormalizeNamespacesOn to true adds a
>>namespace to every element rather than to the xsp:page element (so that the
>>logicsheets don't work),
> 
> 
> This problem should be fixed now in cocoon-2.1
> 

This is a test.


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


Re: SourceWritingTransformer, namespaces problem with Cocoon 2.1

Posted by Bruno Dumon <br...@outerthought.org>.
On Sat, 2003-03-01 at 17:52, Mark H wrote:
> I'm trying to write an XSP to a file using SourceWritingTransformer but the
> latest DOMStreamer (v2.1) with setNormalizeNamespacesOn to true adds a
> namespace to every element rather than to the xsp:page element (so that the
> logicsheets don't work),

This problem should be fixed now in cocoon-2.1

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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