This is my first attempt at calling an external Java method to do work on
a stylesheet. I'm not a Java developer so I think I need a fairly complete
description of how to do this. My objective is to determine the exact length,
of a given string based on the font and font size in play.
I'm sure I have two problems here. (1) to properly bind my stylesheet to a
space and (2) proper use of the Java methods that parse my font and return the
metrics I'm looking for.
Following is my failed stylesheet, annotated with comments explaining what I am
"trying" to do at each step. I am very certain that I am not properly telling
which font I am using.
I am working within the <oXygen/> IDE (Saxon8) and have successfully gotten
the example on
page 134 of Michael's XSLT 2.0 3rd Edition to work. This tells me that I am
successful in using Java extensions.
When I process this stylesheet I get the following error:
Cannot find a matching 0-argument function named
Unfortunately this error message doesn't tell me if the problem is that I'm
the Java method or if I'm finding it but not using it properly.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
<xsl:variable name="tstString" select="'Hello World'"/>
<!-- declair a font and fontsize - not shure who is listening to this -->
FontMetrics:Font("helveticaWorld", Font.PLAIN, 10)
<!-- obtain the metrics for the specified font -->
<!-- obtain the length in pixels of the test string -->
<!-- display the result -->
Thanks in advance for you help. Please keep in mind that I am not a Java
developer at all
so nothing is obvious to me.
[CONFIDENTIALITY AND PRIVACY NOTICE]
Information transmitted by this email is proprietary to Medtronic and is
intended for use only by the individual or entity to which it is addressed, and
may contain information that is private, privileged, confidential or exempt
from disclosure under applicable law. If you are not the intended recipient or
it appears that this mail has been forwarded to you without proper authority,
you are notified that any use or dissemination of this information in any
manner is strictly prohibited. In such cases, please delete this mail from your
To view this notice in other languages you can either select the following link
or manually copy and paste the link into the address bar of a web browser:
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>