foxreplace icon indicating copy to clipboard operation
foxreplace copied to clipboard

XSL Support?

Open sqgl2 opened this issue 8 years ago • 7 comments

I know FR does not support XML but what about XSL? FWIW Here is the header of the page I am trying (unsuccesfully) to process with FR:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Icecast Streaming Media Server</title>
    <link rel="stylesheet" type="text/css" href="/style.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
  </head>

sqgl2 avatar Jan 27 '18 13:01 sqgl2

You're asking about XSL but the code you have cited is XHTML, so I guess you meant XHTML. In the case of XHTML, also affecting #84, I think the problem is the same as explained in https://stackoverflow.com/questions/297239/why-doesnt-xpath-work-when-processing-an-xhtml-document-with-lxml-in-python#297243: XHTML elements are in a namespace and thus are not found with the currently used XPath expressions.

I your example, if completed with a body, it fails if served as application/xhtml+xml or a local file with .xhtml extension, but it works if served as text/html or a local file with .html extension.

Woundorf avatar Jan 29 '18 09:01 Woundorf

You're asking about XSL but the code you have cited is XHTML

The URL has XSL an extention but when I hit Control-U in FireFox to view the source I get the above XHTML code. I would give you the URL but it is password protected.

sqgl2 avatar Jan 30 '18 07:01 sqgl2

It doesn't matter the extension, the browser sees XHTML (probably originating from some XML transformed by an XSLT). Is that page similar to this?

Woundorf avatar Jan 31 '18 09:01 Woundorf

Indeed it is an icecast stream and similar to that page, except that one would click on "admin" and then "listclients" to get something like the following URL http://radio.replayscape.com:8010/admin/listclients.xsl?mount=/128k.mp3

Am thinking of migrating from the bug ridden shoutcast to icecast but it would mean forgoing the many hours I have spent compiling foxreplaces over six years to convert IP's to country, flag, city and ISP's and agents and even listener names if I know them. My efforts of running the station are hardly worth it for the small number of listeners but your software has helped me notice that half of them are regulars (for years) and that is what keeps me going. If it was just random new people I would have given up by now.

sqgl2 avatar Jan 31 '18 12:01 sqgl2

In your example, if completed with a body, it fails if served as application/xhtml+xml or a local file with .xhtml extension, but it works if served as text/html or a local file with .html extension.

Now that you know what the full web page looks like does the above workaround still make sense? (I am not even sure what it means but would figure it out if it was indeed a workaround).

sqgl2 avatar Feb 05 '18 16:02 sqgl2

I'm pretty confident that if you can manage to get the server to serve that page as text/html then it will work.

Woundorf avatar Feb 05 '18 21:02 Woundorf

That page is generated by the radio broadcasting/streaming software unfortunately. I will ask in their forums anyhow since it is open source. Thanks.

sqgl2 avatar Feb 07 '18 13:02 sqgl2