nginx-0.7.8

Denis F. Latypoff denis at gostats.ru
Tue Aug 5 12:02:14 MSD 2008


Hello Igor,

Tuesday, August 5, 2008, 2:20:04 PM, you wrote:

> On Tue, Aug 05, 2008 at 02:14:23PM +0700, Denis F. Latypoff wrote:

>> <xsl:output media-type="text/html" ... />
>> 
>> атрибут media-type игнорируется и выход получается в text/xml.
>> 
>> патч в аттаче лечит.

вообще в аттаче - хак.

правильней делать так:

char *get_content_type(xsltStylesheetPtr style)
{
     xsltStylesheetPtr walk;
     char *type;

     for (walk = style->imports; walk; walk = walk->next)
     {
         if (walk->mediaType)
            return (char *) walk->mediaType;

         if (walk->imports)
         {
            type = get_content_type (walk);

            if(type)
                 return type;
         }
     }

     return NULL;
}

потому что по спеке можно делать так:

global.xsl:

       <xsl:output media="text/html" encoding="koi8-r" />
       ...

index.xsl:

       <xsl:import href="global.xsl" />
       <xsl:output media="text/plain" encoding="utf-8" />

на выходе должно быть

       Content-Type: text/plain; charset=utf-8


> А xslt сам его не понимает, как в случае с <xsl:output method="html" ... /> ?



-- 
Best regards,
 Denis                            mailto:denis at gostats.ru






More information about the nginx-ru mailing list