Re: [xml] xsltproc: HTTP requests from an HTML parsing context



On Sun, Apr 23, 2006 at 04:51:32AM +0100, Nic wrote:
I remember doing this before and it worked so maybe something has
changed.

I've got an XSLT that is being run over an HTML page:

   xsltproc --html my.xslt some.html

part of the script is to load documents specified in the some.html;
eg:

  <xsl:copy-of select="document(concat('http://host/list/', somenode/@id))"/>

Trouble is, the document loads are failing because of HTML parsing
errors.

However, I think it's because the in-script loader (the one called by
the 'document' function) is not in HTML parsing mode because if I load
the same document on the command line, eg:

   xsltproc --html other.xslt http://host/list/1663262

then it works ok.


So: is it possible to put the internal document loader into HTML mode.

  Hum, I'm not sure this ever worked, xsltDocumentFunction() calls
xsltDocumentFunctionLoadDocument() which calls xsltLoadDocument()
which calls xsltDocDefaultLoaderFunc() which goes straight to 
xmlParseDocument() without the possibility of calling the HTML
parser. However the xsltDocDefaultLoaderFunc() can be overrided
by client code (that was done for the Safari team).

Didn't it used to work? I'm sure I tried this before...

  That would have required a global parsing flag passed down from
xsltproc to libxslt, I have some doubts about this but maybe we broke
it when allowing client overload of loading functions... maybe this
used to be passed though ctxt->parserOptions and the new code drop that.
Maybe worth a bugzilla entry.

Daniel

-- 
Daniel Veillard      | Red Hat http://redhat.com/
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]