## Re: More problems and questions

 Subject: Re: More problems and questions From: "Christopher R. Maden" Date: Sat, 09 Sep 2000 01:23:48 -0700
At 06:05 9-09-2000 +0000, Anilia Bruho wrote:
1. Given that there exist FO renderer(s) written in Java, such as
FOP, and given that some XSLT processors, such as Saxon, allow
calling extension functions written in Java, is it possible to
access FO renderer from within XSLT through this mechanism, with the
goal of being able to ask the renderer some questions and give it
some tests and then modify the transformation algorithm based on the
results returned? An important point here is that the renderer being
accessed from within XSLT is the same as the one that will produce
the final output, therefore the results of calling the FO renderer
functions are guaranteed to be true to the final result. More
specifically,

- is this method workable in principle?

Yes.

- if yes, is it possible to implement it right now, with current
versions of specs and software?


Probably (though IANA Real Programmer), but I suspect it would be a *major* PITA.

3. In my custom TeX macro packages (they're intended for typesetting
mostly text with little code or math), I use \catcodes to enable
"smart" character macros. For instance, a hyphen in the input
expands into ~---, simple " quotes expand into alternating open and
closing typographic quotes, _something_ expands into {\it
something}. This saves a lot of typing, makes source text more
readable and editable, and moves the presentation aspect where it
belongs, i.e. in the stylesheet. Naturally, I would like to keep
using these simple abbreviations in XML/XSL too. As there are no
"character macros" in XSL, obviously what I need is some kind of an
input filter that will replace all hyphens in the text (not element
names or attributes) by &nbsp;&emdash;, _something_ by
<em>something</em> etc. Indeed, Saxon documentation says I can write
such a filter in Java. The problem, as with the previous question,
is that I'm not a Java programmer. What I probably would be able to
do is to take someone else's example of a simple search-and-replace
filter and adopt it to my needs. Therefore the question: Where can I
find such a working example, for Saxon or any other processor? Is
there perhaps an easier method to achieve this than coding in Java?


Maybe you want to use SGML instead of XML. SGML includes a large number of optional features, many of which exist explicitly to make keyboard entry easier. You can do what you talk about here with SHORTREFs, though they're not a whole lot of fun or widely supported. XML explicitly leaves these features out for a good reason.

-Chris
--
Christopher R. Maden, Senior XML Analyst, Lexica LLC
222 Kearny St., Ste. 202, San Francisco, CA 94108-4510
+1.415.901.3631 tel./+1.415.477.3619 fax
<URL:http://www.lexica.net/> <URL:http://www.oreilly.com/%7Ecrism/>

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

Current Thread