collation problem

View: New views
14 Messages — Rating Filter:   Alert me  

collation problem

by Mark Wilson-10 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 
I have read in the archive that to add my own collator to Oxygen, I must drop the jar file in the oxygen lib folder. I have done this, and still get the same error message:
 
F [Saxon-B 9.0.0.6] Collation http://saxon.sf.net/collation?class=CzechCollation has not been defined.
 
The line from my XSLT file is:  <xsl:sort select="Author" collation="http://saxon.sf.net/collation?class=CzechCollation"/>
 
The jar tf command tell me the jar file contains the following manifest (I know very little about java):
META-INF
META-INF/MANIFEST.MF
CzechCollation.class
 
However, when I click on the jar , I get the error message: "failed to load Main-Class manifest attribute from ..." I assume this happens because the jar does not contain an application. Anyway, The CzechCollation.java file follows (Substantially shortened).
Thanks,
Mark

import java.text.ParseException;

import java.text.RuleBasedCollator;

public class CzechCollation extends RuleBasedCollator

{

public CzechCollation() throws ParseException

{

super(traditionalCzechRules);

}

private static String upperAcuteA = new String("\u00c1");

private static String lowerAcuteA = new String("\u00e1");

private static String upperUmlatA = new String("\u00c4");

Many letter definations removed to keep email short

private static String upperHacekZ = new String("\u017d");

private static String lowerHacekZ = new String("\u017e");

private static String traditionalCzechRules =

("< A,a," + upperAcuteA + "," + lowerAcuteA + "," + upperUmlatA + "," + lowerUmlatA +

Many parts of the string removed to keep email short

"< Z,z <" + upperHacekZ + "," + lowerHacekZ);


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help 

Re: collation problem

by Michael Kay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm afraid I don't know the oXygen environment particularly well. The most likely explanation for this error is that the class could not be loaded, and the most likely reason for that is that the JAR isn't on the classpath.
 
The Saxon command line option -t gives better diagnostics when user-supplied classes can't be loaded. There should be some way of switching that on within oXygen, if not, please try running it from the command line.
 
The "failure to load Main-Class" is not a problem
 
Michael Kay


From: saxon-help-bounces@... [mailto:saxon-help-bounces@...] On Behalf Of Mark Wilson
Sent: 15 July 2008 22:07
To: saxon-help@...
Subject: [saxon] collation problem

 
I have read in the archive that to add my own collator to Oxygen, I must drop the jar file in the oxygen lib folder. I have done this, and still get the same error message:
 
F [Saxon-B 9.0.0.6] Collation http://saxon.sf.net/collation?class=CzechCollation has not been defined.
 
The line from my XSLT file is:  <xsl:sort select="Author" collation="http://saxon.sf.net/collation?class=CzechCollation"/>
 
The jar tf command tell me the jar file contains the following manifest (I know very little about java):
META-INF
META-INF/MANIFEST.MF
CzechCollation.class
 
However, when I click on the jar , I get the error message: "failed to load Main-Class manifest attribute from ..." I assume this happens because the jar does not contain an application. Anyway, The CzechCollation.java file follows (Substantially shortened).
Thanks,
Mark

import java.text.ParseException;

import java.text.RuleBasedCollator;

public class CzechCollation extends RuleBasedCollator

{

public CzechCollation() throws ParseException

{

super(traditionalCzechRules);

}

private static String upperAcuteA = new String("\u00c1");

private static String lowerAcuteA = new String("\u00e1");

private static String upperUmlatA = new String("\u00c4");

Many letter definations removed to keep email short

private static String upperHacekZ = new String("\u017d");

private static String lowerHacekZ = new String("\u017e");

private static String traditionalCzechRules =

("< A,a," + upperAcuteA + "," + lowerAcuteA + "," + upperUmlatA + "," + lowerUmlatA +

Many parts of the string removed to keep email short

"< Z,z <" + upperHacekZ + "," + lowerHacekZ);


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help 

Re: collation problem

by Mark Wilson-10 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Michael,
Thanks for your answer. I did the following:
I changed the stylesheet to reflect some suggestions you made elsewhere:

<xsl:param name=" sorting-collation" select="'http://saxon.sf.net/collation?class=CzechCollation'" />

<xsl:sort select="Author" collation="{$sorting-collation}"/>

I moved the CzechCollation.jar, the xml input file and the xsl stylesheet all to my saxon directory and ran on the command line

java -jar saxon9.jar -t SelectedAuthors.xml Authors2.xsl > SortedAuthors.xml
 
The Errors simply said:
Loading net.sf.saxon.even.MessageEmmitter
Loading CzechCollation
No Java class CzechCollation could be loaded
Warning: failed to load CzechCollation
 
I tried three changes in the XSL stylesheet: CzechCollation, CzechCollarion.class and CzechColation.jar, but none helped.
 
I have been at this for two solid days and have learned a great deal but have not solved my problem.
I am not sure what a classpath is (my java is very weak). Could that be my problem? Did moving everything to the saxon directory help?
 
Thank,
Mark

From: mike@...
Sent: Tuesday, July 15, 2008 3:36 PM
Subject: Re: [saxon] collation problem

I'm afraid I don't know the oXygen environment particularly well. The most likely explanation for this error is that the class could not be loaded, and the most likely reason for that is that the JAR isn't on the classpath.
 
The Saxon command line option -t gives better diagnostics when user-supplied classes can't be loaded. There should be some way of switching that on within oXygen, if not, please try running it from the command line.
 
The "failure to load Main-Class" is not a problem
 
Michael Kay


From: saxon-help-bounces@... [mailto:saxon-help-bounces@...] On Behalf Of Mark Wilson
Sent: 15 July 2008 22:07
To: saxon-help@...
Subject: [saxon] collation problem

 
I have read in the archive that to add my own collator to Oxygen, I must drop the jar file in the oxygen lib folder. I have done this, and still get the same error message:
 
F [Saxon-B 9.0.0.6] Collation http://saxon.sf.net/collation?class=CzechCollation has not been defined.
 
The line from my XSLT file is:  <xsl:sort select="Author" collation="http://saxon.sf.net/collation?class=CzechCollation"/>
 
The jar tf command tell me the jar file contains the following manifest (I know very little about java):
META-INF
META-INF/MANIFEST.MF
CzechCollation.class
 
However, when I click on the jar , I get the error message: "failed to load Main-Class manifest attribute from ..." I assume this happens because the jar does not contain an application. Anyway, The CzechCollation.java file follows (Substantially shortened).
Thanks,
Mark

import java.text.ParseException;

import java.text.RuleBasedCollator;

public class CzechCollation extends RuleBasedCollator

{

public CzechCollation() throws ParseException

{

super(traditionalCzechRules);

}

private static String upperAcuteA = new String("\u00c1");

private static String lowerAcuteA = new String("\u00e1");

private static String upperUmlatA = new String("\u00c4");

Many letter definations removed to keep email short

private static String upperHacekZ = new String("\u017d");

private static String lowerHacekZ = new String("\u017e");

private static String traditionalCzechRules =

("< A,a," + upperAcuteA + "," + lowerAcuteA + "," + upperUmlatA + "," + lowerUmlatA +

Many parts of the string removed to keep email short

"< Z,z <" + upperHacekZ + "," + lowerHacekZ);


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help 

Re: collation problem

by Tony Nassar-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

None of that will have any effect on the classpath. Don’t use the –jar option with Saxon; it’s Java, not Saxon, that will not bother to load any of your additional JARs. Saxon doesn’t load your JARs in any case, so putting them in the Saxon directory accomplishes nothing.

 

What you want is something like (let’s assume you’re writing a DOS batch file):

set SAXON_HOME=C:\Documents and Settings\tnassar\Desktop\saxonb9-1-0-1j

set SAXON_JAR=%SAXON_HOME%\saxon9.jar

 

REM I assume your collation JAR is in the current directory.

 

java -cp "%SAXON_JAR%;CzechCollation.jar" net.sf.saxon.Transform –xsl:myXslt.xslt -s:input.xml

 

From: saxon-help-bounces@... [mailto:saxon-help-bounces@...] On Behalf Of Mark Wilson
Sent: Tuesday, July 15, 2008 4:26 PM
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] collation problem

 

Hello Michael,

Thanks for your answer. I did the following:

I changed the stylesheet to reflect some suggestions you made elsewhere:

<xsl:param name=" sorting-collation" select="'http://saxon.sf.net/collation?class=CzechCollation'" />

<xsl:sort select="Author" collation="{$sorting-collation}"/>

I moved the CzechCollation.jar, the xml input file and the xsl stylesheet all to my saxon directory and ran on the command line

.sourceforge.net/lists/listinfo/saxon-help


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help 

Re: collation problem

by Mark Wilson-10 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hello, Tony.
That got me squared away. The collation class -- after some fiddling because of the error reported below -- now appears to work. However (and this is the wrong list to ask but I do not know where to go, can someone answer or point me there?), my fiddling made the error go away, but it seems somehow a very wrong fix.
-----------------------------
The Error:
C:\Users\HP\saxon>java -cp "C:\Users\HP\saxon\saxon9.jar;CzechCollation.jar" net
.sf.saxon.Transform -xsl:Authors2.xsl -s:SelectedAuthors.xml  1>Sorted.xml
Warning: Failed to instantiate class CzechCollation: missing chars (=,;<&): < P,
p < Q,
Warning: Failed to instantiate class CzechCollation: missing chars (=,;<&): < P,
p < Q,
Error at xsl:copy on line 17 of Authors2.xsl:
  XTDE1035: Unknown collation http://saxon.sf.net/collation?class=CzechCollation
 
  in built-in template rule
Transformation failed: Run-time errors were reported
---------------------------------------------------
 I tried to put the missing chars below A,a, but it still failed. Then I put them below P,P [as the error message seemed to indicate and it failed UNLESS I put them on the same level as O,o
Worked: "<O,o, '(','=',',',';','&',')' < P,p."
Failed: "<O,o, < '(','=',',',';','&',')' < P,p."
 
Mark

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help 

Re: collation problem

by Michael Kay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

When you run from the command line using the -jar option, no classes other than those in saxon9.jar will be loaded. The classpath is ignored.
 
With this configuration, use
 
java -cp saxon9.jar;CzechCollation.jar net.sf.saxon.Transform -t SelectedAuthors.xml Authors2.xsl > SortedAuthors.xml
 
Michael Kay
http://www.saxonica.com/


From: saxon-help-bounces@... [mailto:saxon-help-bounces@...] On Behalf Of Mark Wilson
Sent: 16 July 2008 00:26
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] collation problem

Hello Michael,
Thanks for your answer. I did the following:
I changed the stylesheet to reflect some suggestions you made elsewhere:

<xsl:param name=" sorting-collation" select="'http://saxon.sf.net/collation?class=CzechCollation'" />

<xsl:sort select="Author" collation="{$sorting-collation}"/>

I moved the CzechCollation.jar, the xml input file and the xsl stylesheet all to my saxon directory and ran on the command line

java -jar saxon9.jar -t SelectedAuthors.xml Authors2.xsl > SortedAuthors.xml
 
The Errors simply said:
Loading net.sf.saxon.even.MessageEmmitter
Loading CzechCollation
No Java class CzechCollation could be loaded
Warning: failed to load CzechCollation
 
I tried three changes in the XSL stylesheet: CzechCollation, CzechCollarion.class and CzechColation.jar, but none helped.
 
I have been at this for two solid days and have learned a great deal but have not solved my problem.
I am not sure what a classpath is (my java is very weak). Could that be my problem? Did moving everything to the saxon directory help?
 
Thank,
Mark

From: mike@...
Sent: Tuesday, July 15, 2008 3:36 PM
Subject: Re: [saxon] collation problem

I'm afraid I don't know the oXygen environment particularly well. The most likely explanation for this error is that the class could not be loaded, and the most likely reason for that is that the JAR isn't on the classpath.
 
The Saxon command line option -t gives better diagnostics when user-supplied classes can't be loaded. There should be some way of switching that on within oXygen, if not, please try running it from the command line.
 
The "failure to load Main-Class" is not a problem
 
Michael Kay


From: saxon-help-bounces@... [mailto:saxon-help-bounces@...] On Behalf Of Mark Wilson
Sent: 15 July 2008 22:07
To: saxon-help@...
Subject: [saxon] collation problem

 
I have read in the archive that to add my own collator to Oxygen, I must drop the jar file in the oxygen lib folder. I have done this, and still get the same error message:
 
F [Saxon-B 9.0.0.6] Collation http://saxon.sf.net/collation?class=CzechCollation has not been defined.
 
The line from my XSLT file is:  <xsl:sort select="Author" collation="http://saxon.sf.net/collation?class=CzechCollation"/>
 
The jar tf command tell me the jar file contains the following manifest (I know very little about java):
META-INF
META-INF/MANIFEST.MF
CzechCollation.class
 
However, when I click on the jar , I get the error message: "failed to load Main-Class manifest attribute from ..." I assume this happens because the jar does not contain an application. Anyway, The CzechCollation.java file follows (Substantially shortened).
Thanks,
Mark

import java.text.ParseException;

import java.text.RuleBasedCollator;

public class CzechCollation extends RuleBasedCollator

{

public CzechCollation() throws ParseException

{

super(traditionalCzechRules);

}

private static String upperAcuteA = new String("\u00c1");

private static String lowerAcuteA = new String("\u00e1");

private static String upperUmlatA = new String("\u00c4");

Many letter definations removed to keep email short

private static String upperHacekZ = new String("\u017d");

private static String lowerHacekZ = new String("\u017e");

private static String traditionalCzechRules =

("< A,a," + upperAcuteA + "," + lowerAcuteA + "," + upperUmlatA + "," + lowerUmlatA +

Many parts of the string removed to keep email short

"< Z,z <" + upperHacekZ + "," + lowerHacekZ);


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help 

Re: collation problem

by Michael Kay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
I don't immediately know the answer and I've got limited internet access today to research it for you.
 
I would strongly suggest testing your collation class before trying to invoke it from Saxon. To do this add a method
 
public static void main(String[] args) throws Exception {
    System.err.println(new CzechCollation().compare(args[0], arg[1]));
}
 
and you will then be able to invoke your class directly from the command line, with two strings to be compared as arguments.
 
Michael Kay
http://www.saxonica.com/


From: saxon-help-bounces@... [mailto:saxon-help-bounces@...] On Behalf Of Mark Wilson
Sent: 16 July 2008 04:45
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] collation problem

Hello, Tony.
That got me squared away. The collation class -- after some fiddling because of the error reported below -- now appears to work. However (and this is the wrong list to ask but I do not know where to go, can someone answer or point me there?), my fiddling made the error go away, but it seems somehow a very wrong fix.
-----------------------------
The Error:
C:\Users\HP\saxon>java -cp "C:\Users\HP\saxon\saxon9.jar;CzechCollation.jar" net
.sf.saxon.Transform -xsl:Authors2.xsl -s:SelectedAuthors.xml  1>Sorted.xml
Warning: Failed to instantiate class CzechCollation: missing chars (=,;<&): < P,
p < Q,
Warning: Failed to instantiate class CzechCollation: missing chars (=,;<&): < P,
p < Q,
Error at xsl:copy on line 17 of Authors2.xsl:
  XTDE1035: Unknown collation http://saxon.sf.net/collation?class=CzechCollation
 
  in built-in template rule
Transformation failed: Run-time errors were reported
---------------------------------------------------
 I tried to put the missing chars below A,a, but it still failed. Then I put them below P,P [as the error message seemed to indicate and it failed UNLESS I put them on the same level as O,o
Worked: "<O,o, '(','=',',',';','&',')' < P,p."
Failed: "<O,o, < '(','=',',',';','&',')' < P,p."
 
Mark

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help 

Re: collation problem

by Abel Braaksma (online) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Michael Kay wrote:
>  
> and you will then be able to invoke your class directly from the
> command line, with two strings to be compared as arguments.
>  

If you use Windows, make sure you set the commandline to use UTF-8,
otherwise this will be little use for non us-ascii / windows-1252
characters. See the saxon wiki, which has a copy of a post of mine about
this.

Cheers,
-- Abel

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help 

Re: collation problem

by Mark Wilson-10 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Thank Michael,
I am going to try some java programmers today since I can load the class now and it does work (except for the silliness with having to put the punctuation on the same level as the letter O). If you are interested in the resolution (if I get one), let me know and I will pass it on to you.
Thanks so much for your help,
Mark

From: mike@...
Sent: Wednesday, July 16, 2008 1:12 AM
Subject: Re: [saxon] collation problem

I don't immediately know the answer and I've got limited internet access today to research it for you.
 
I would strongly suggest testing your collation class before trying to invoke it from Saxon. To do this add a method
 
public static void main(String[] args) throws Exception {
    System.err.println(new CzechCollation().compare(args[0], arg[1]));
}
 
and you will then be able to invoke your class directly from the command line, with two strings to be compared as arguments.
 
Michael Kay
http://www.saxonica.com/


From: saxon-help-bounces@... [mailto:saxon-help-bounces@...] On Behalf Of Mark Wilson
Sent: 16 July 2008 04:45
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] collation problem

Hello, Tony.
That got me squared away. The collation class -- after some fiddling because o