You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Justin Fagnani-Bell <ju...@paraliansoftware.com> on 2003/11/05 02:53:57 UTC

problems with identity transformations and namespaces

ugh... more problems since upgrading to 2.1

Some of my source xml uses a namespace (it's mixed). The prefix is 
"idf" and my namespace declaration is like this:

<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:idf="http://paraliansoftware.com/kompas/idf-1.0">

I'm using two stylesheets in a row in my pipeline. If my first style 
sheet has an identity transformation like:

	<xsl:template match="*|@*|comment()|processing-instruction()|text()">
		<xsl:copy>
			<xsl:apply-templates 
select="*|@*|comment()|processing-instruction()|text()"/>
		</xsl:copy>
	</xsl:template>

then I get an error saying:

Namespace for prefix 'http://paraliansoftware.com/kompas/idf-1.0' has 
not been declared.

It looks like it's mistaking the namespace for the prefix. Weird. I 
specified xalan as the transformer type, thinking it was XSLTC or 
something, but it's not. This used to work fine in 2.0.4. If I don't 
use an identity transformer everything is fine.

any ideas?

thanks again,
   Justin


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


Re: problems with identity transformations and namespaces

Posted by Justin Fagnani-Bell <ju...@paraliansoftware.com>.
>> then I get an error saying:
>>
>> Namespace for prefix 'http://paraliansoftware.com/kompas/idf-1.0' has
>> not been declared.
>>
>> It looks like it's mistaking the namespace for the prefix. Weird. I
>> specified xalan as the transformer type, thinking it was XSLTC or
>> something, but it's not. This used to work fine in 2.0.4. If I don't
>> use an identity transformer everything is fine.
>>
>> any ideas?
>
> Hmm. What does your source XML look like? Is it possible that
> the error comes from the prefix declaration there?
>
> If not, I'd try looking at the XML between the two stylesheets
> (i.e. the output of the first stylesheet). You can do this using
> a view (URL?cocoon-view=raw, for example).
>
> HTH,
> Lars

Thanks Lars. You're first thought was correct. It turns out I forgot 
about a hack I did to work around an old xalan bug. my startElement 
calls in my generator were like this:

contentHandler.startElement(IDF_URI, "head", IDF_URI + ":head", 
attributes);

changing the second IDF_URI to IDF_PREFIX solved the problem.

I guess the bug was fixed, but this never caused a problem until 
yesterday when I upgraded.

-Justin


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


RE: problems with identity transformations and namespaces

Posted by Lars Huttar <la...@sil.org>.
> -----Original Message-----
> From: Justin Fagnani-Bell [mailto:justin@paraliansoftware.com]
> Sent: Tuesday, November 04, 2003 7:54 PM
> To: users@cocoon.apache.org
> Subject: problems with identity transformations and namespaces
> 
> 
> ugh... more problems since upgrading to 2.1
> 
> Some of my source xml uses a namespace (it's mixed). The prefix is 
> "idf" and my namespace declaration is like this:
> 
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:idf="http://paraliansoftware.com/kompas/idf-1.0">
> 
> I'm using two stylesheets in a row in my pipeline. If my first style 
> sheet has an identity transformation like:
> 
> 	<xsl:template 
> match="*|@*|comment()|processing-instruction()|text()">
> 		<xsl:copy>
> 			<xsl:apply-templates 
> select="*|@*|comment()|processing-instruction()|text()"/>
> 		</xsl:copy>
> 	</xsl:template>
> 
> then I get an error saying:
> 
> Namespace for prefix 'http://paraliansoftware.com/kompas/idf-1.0' has 
> not been declared.
> 
> It looks like it's mistaking the namespace for the prefix. Weird. I 
> specified xalan as the transformer type, thinking it was XSLTC or 
> something, but it's not. This used to work fine in 2.0.4. If I don't 
> use an identity transformer everything is fine.
> 
> any ideas?

Hmm. What does your source XML look like? Is it possible that
the error comes from the prefix declaration there?

If not, I'd try looking at the XML between the two stylesheets
(i.e. the output of the first stylesheet). You can do this using
a view (URL?cocoon-view=raw, for example).

HTH,
Lars


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