Re: XSL content:encoded troubles

Michael Vincent van Rantwijk <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xml
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
Martin Honnen wrote:
> 
> 
> Michael Vincent van Rantwijk wrote:
> 
> 
>> First of all, there's no XSL newsgroup so I'll have to post my 
>> question in the *mozilla.style and mozilla.xml newsgroup, because I 
>> don't know which one to use (and maybe these are both wrong).
> 
> For Mozilla specific XSLT questions there is the newsgroup 
> netscape.public.mozilla.layout.xslt. But the topic there is not general 
> XSLT questions.

So I noticed, thanks anyway.

>> My question is: should something like this work in Mozilla?
>>
>>       <xsl:attribute name="description">
>>         <xsl:choose>
>>           <xsl:when test="content:encoded">
>>             <xsl:value-of select="content:encoded"/>
>>           </xsl:when>
>>           <xsl:otherwise>
>>             <xsl:value-of select="description"/>
>>           </xsl:otherwise>
>>         </xsl:choose>
>>       </xsl:attribute>
>>
>> To read/assign the data of:
>>
>> <content:encoded>
>> <content:encoded>
> 
> Is that supposed to be a snippet of XML? Then it should probably look
>   <content:encoded>
>   </content:encoded>

Yeah, just a hasty post and a stupid little typo.

> As for the XSLT it looks fine as a snippet but of course to write an 
> XPath expression like e.g. content:encoded you need to make sure that 
> the prefix content is bound to a namespace URI. 

Yikes, I don't have that, that must be it!

> So make sure your 
> stylesheet element for instance has e.g.
>   <xsl:stylesheet
>     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>     version="1.0"
>     xmlns:content="http://example.com/2005/09/01/n1">
> where you replace http://example.com/2005/09/01/n1 with the namespace 
> URI the elements in the source document are in.

Do I need to add the output of
document.documentElement.namespaceURI as URI for xmlns:content="" ?

Please note that I don't know if that works, just a wild guess ;)

Thanks for helping me out,
Michael
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.