Re: Krysalis and Saxon

Jan Kohnert <[email protected]> Thu, 11 Sep 2003 09:57:01 +0200
Newsgroups gmane.comp.krysalis.user
Message-ID <9532CC55519DD11181EE0060B01A4E3C92180F@SWFHAUS>
Hello Jeremias,

Thank you for your help!

I still have some questions about how to build the ner .jar.
In the "documentation" folder of the Krysalis Barcode Side 
http://www.krysalis.org/barcode/building.html
is describet how to set up a new build. Sadly I can not follow the
doscumentation.
Is says something about an "ant" scrip, which I could'nt finde (I checked
the the latest sources on CVS).

I dont know Java that much, so I would be gratefull for some help (or an
link to some help ( I checked the search funktions if this mailing list, but
was beaten by the ammount of hits generatet)).

Thank you, Jan



Date: Wed, 10 Sep 2003 22:34:33 +0200
From: Jeremias Maerki <[email protected]>
To: [email protected]
Subject: Re: Krysalis Barcode and Saxon
Reply-To: [email protected]

Hello Jan

On 10.09.2003 09:58:39 Jan Kohnert wrote:
> I ve tried several things to get the Saxon run with Krysalis Barcode.
> But I alwys got a message saying: "There is no Java method that is a
unique
> best match".
> 
> I also looked into the BarcodeExt.java file but found only one general
> function having two arguments. I m wondering why it is saying thomething
> about a "unique best match" when there is only one general function at all
> (which is called with exactly two arguments in your example file which I
> used).
> 
> I looked into the "XSLT 2nd Edition" book from Michael Kay and on page 776
> (bottom) I found a note saying that Saxon does only look for functions
that
> have the right name and the right number of arguments, but if it finds
more
> than one, it reports an error, rather than trying to finde the one that is
> the best fit to the arguments supplied.

Unfortunately, I don't have Michael Kay's book. All I have on Saxon
extensibility is the link I gave you in the last email. I've also had a
quick look at the sources, especially the sql package which serves as an
example for Saxon extensions. But this didn't help a lot, yet, to
understand what really would be needed to build a barcode extension for
Saxon. I'll have a couple of hours on Friday to look into this. Looks
more complicated than I first thought.

> Are there more general functions elsewehre in the code?

Not really.

> I also wondered why the BarcodeExt.java file is special for Xalan. What
> steps have to be taken to convert it for Saxon?

Well, BarcodeExt is constructed after the instructions from Xalan-J to
build an extension. Saxon obviously requires a few more things (an
ExtensionElementFactory, implementation of the StyleElement interface
etc.). See http://saxon.sourceforge.net/saxon6.5.3/extensibility.html.

In the end it looks like some completely different code is needed. But
ideas can still be taken from BarcodeExt. I'll look into it.

> I also looked into the lates code on CVS, but did'nt realy got the point.
> How do I use the latest extentions for FOP? Since I m generating FO with
FOP
> it does not matter for me in wich step the SVG barcode is generated. So
> having it generated by FOP is fine for me. But how do I get Krysalis
Barcode
> work with FOP?

Too bad, I haven't written the documentation to point you to, yet, so
let's see:

You got the sources, right? Create a text file called
build-local.properties and place it in the same directory as Krysalis
Barcode's build.xml (the root dir). Add a single line to that text file:

fop-0.20.5.home=D:/FOP/releases/fop-0.20.5

Adjust that directory as necessary. Make sure you've got a compiled or
binary FOP 0.20.5 in that directory (build.xml needs build\fop.jar and
lib\batik.jar). Now, run the Barcode build and you should get 
build\krysalis-barcode-fop-ext-0.20.5-complete.jar among others. The jar
contains both the whole Barcode package as well as the FOP extension.

Add that JAR to the classpath under which FOP is run. The JAR will
automatically register itself with FOP (through a file in META-INF). To
create a barcode you can use an fo:instream-foreign-object for the
Barcode XML:

Example:
  <fo:instream-foreign-object>
    <bc:barcode xmlns:bc="http://www.krysalis.org/barcode/ns"
msg="4194586705506+07">
      <bc:ean-13>
        <bc:human-readable>top</bc:human-readable>
      </bc:ean-13>
    </bc:barcode>
  </fo:instream-foreign-object>

An example file can be found in examples/xsl-fo/fop-extension-demo.fo.

I hope that works. I'd be grateful for any feedback as you're probably
my first victim to try the new FOP extension.

Jeremias Maerki




--__--__--

_______________________________________________
krysalis-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/krysalis-users


End of krysalis-users Digest



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf