Re: [xslt] Getting the media type



On Sat, Jun 09, 2001 at 11:27:29PM +0100, Matt Sergeant wrote:
> On Sat, 9 Jun 2001, Daniel Veillard wrote:
> 
> > On Thu, May 31, 2001 at 09:15:44PM +0100, Matt Sergeant wrote:
> > > The mediaType entry in the xsltStylesheetPtr struct doesn't seem to get
> > > filled in when doing xsltParseStylesheetDoc() (Not that it does with other
> > > methods, I'm just not sure if it does or not). Is there some other special
> > > way I'm supposed to get the media type from the stylesheet, other than
> > > traversing the DOM or using the XPath API on the doc?
> >
> >   Hum, right I didn't implement it, though I allocated some space in the
> > structure for it ... sorry one more thing TODO.
> 
> For now I solved it by setting the stylesheet's method to HTML when the
> resultset's DOM->type == XML_HTML_DOCUMENT_NODE in the call to
> $stylesheet->transform().

  Oh, of you are looking for the "method" then use the macro
    const xmlChar *method;

    XSLT_GET_IMPORT_PTR(method, style, method)

it will look for the method value accodingly to the stylesheet cascading order.
If I had implemented "media-type" lookup (I should it would be faster than
typing this mail probably ...) then XSLT_GET_IMPORT_PTR() could be used 
similary to grab the mediaType in effect.

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]