RE: isolated high surrogate

2016-07-14 Thread Marc Kaufman
I didn’t find the source to javax.xml.transform online, but I guess I shouldn’t 
expect that a 10 year old code base gets it right… The code I’m working on was 
written in 2006, but no one tried surrogate characters until recently.

From: Glenn Adams [mailto:gl...@skynav.com]
Sent: Thursday, July 14, 2016 2:15 PM
To: FOP Users 
Subject: Re: isolated high surrogate

nothing to do with being an FOP developer; keep in mind that the actual input 
to FOP is XSL-FO, and not XNL + stylesheet; this latter functionality is a 
convenience layer that IMO should never have been added to FOP, for the simple 
reason that we keep fielding problem reports related to template processing 
that are outside the scope of FOP; best to discuss template problems with XSLT 
related MLs

On Thu, Jul 14, 2016 at 3:09 PM, Marc Kaufman 
> wrote:
Worthwhile for someone to do, probably. Outside of my current needs. I’m not 
interested in being a FOP developer.

From: Glenn Adams [mailto:gl...@skynav.com]
Sent: Thursday, July 14, 2016 1:48 PM

To: FOP Users 
>
Subject: Re: isolated high surrogate

I'd suggest you test FOP by using an XSL-FO input file directly rather than an 
XSL template. Template processing is not part of FOP functionality in the first 
place.

On Thu, Jul 14, 2016 at 2:37 PM, Marc Kaufman 
> wrote:
More specifically, if I replace “ “ with u/200B (zero width space) in the 
string that contains surrogate characters, FOP parsing fails even if I just use 
xsl:value-of. I’m not going to pursue that at this time. Maybe when FOP handles 
non-BMP characters it should be revisited.

Marc

From: Marc Kaufman [mailto:marck...@adobe.com]
Sent: Thursday, July 14, 2016 12:34 PM

To: fop-users@xmlgraphics.apache.org
Subject: RE: isolated high surrogate

I’ve isolated the problem to a template definition that is trying to replace 
apace characters with non-breaking spaces. Evidently it clobbers some surrogate 
pairs. FWIW: here’s the offending line(s):

  



  


  
  

  
  
  

  

  




  
  

  

So, not an FOP problem.

Marc

From: Marc Kaufman [mailto:marck...@adobe.com]
Sent: Thursday, July 14, 2016 12:22 PM
To: fop-users@xmlgraphics.apache.org
Subject: RE: isolated high surrogate

I tried that. Doesn’t work. I understand that non-BMP is not supported, and I’m 
prepared to live with two .notdef characters in the result, but I’m not sure 
why I’m getting the fatal error from the parser.

From: Glenn Adams [mailto:gl...@skynav.com]
Sent: Thursday, July 14, 2016 12:01 PM
To: FOP Users 
>
Subject: Re: isolated high surrogate

Non-BMP characters are not presently supported by FOP, see [1]. When they are 
supported, you would best encode them in a file using a single (not two) 
numeric character entities, e.g., , etc.

[1] https://issues.apache.org/jira/browse/FOP-1969

On Thu, Jul 14, 2016 at 12:51 PM, Marc Kaufman 
> wrote:
I’m stumped by this error:
org.xml.sax.SAXParseException; lineNumber: 92; columnNumber: 51; 
java.lang.IllegalArgumentException: isolated high surrogate

I have text with surrogate pairs throughout the file, but this only occurs in 
this context:

  

  


I’ve checked the input stream, and all the surrogates are correctly paired. 
I’ve tried escaping the surrogate pairs (e.g. “

Re: isolated high surrogate

2016-07-14 Thread Glenn Adams
nothing to do with being an FOP developer; keep in mind that the actual
input to FOP is XSL-FO, and not XNL + stylesheet; this latter functionality
is a convenience layer that IMO should never have been added to FOP, for
the simple reason that we keep fielding problem reports related to template
processing that are outside the scope of FOP; best to discuss template
problems with XSLT related MLs

On Thu, Jul 14, 2016 at 3:09 PM, Marc Kaufman  wrote:

> Worthwhile for someone to do, probably. Outside of my current needs. I’m
> not interested in being a FOP developer.
>
>
>
> *From:* Glenn Adams [mailto:gl...@skynav.com]
> *Sent:* Thursday, July 14, 2016 1:48 PM
>
> *To:* FOP Users 
> *Subject:* Re: isolated high surrogate
>
>
>
> I'd suggest you test FOP by using an XSL-FO input file directly rather
> than an XSL template. Template processing is not part of FOP functionality
> in the first place.
>
>
>
> On Thu, Jul 14, 2016 at 2:37 PM, Marc Kaufman  wrote:
>
> More specifically, if I replace “ “ with u/200B (zero width space) in the
> string that contains surrogate characters, FOP parsing fails even if I just
> use xsl:value-of. I’m not going to pursue that at this time. Maybe when FOP
> handles non-BMP characters it should be revisited.
>
>
>
> Marc
>
>
>
> *From:* Marc Kaufman [mailto:marck...@adobe.com]
> *Sent:* Thursday, July 14, 2016 12:34 PM
>
>
> *To:* fop-users@xmlgraphics.apache.org
> *Subject:* RE: isolated high surrogate
>
>
>
> I’ve isolated the problem to a template definition that is trying to
> replace apace characters with non-breaking spaces. Evidently it clobbers
> some surrogate pairs. FWIW: here’s the offending line(s):
>
>
>
>   *<**xsl:template **name*=*"zero_width_space_1"**>*
>
> *<**xsl:param **name*=*"data"**/>*
>
> *<**xsl:param **name*=*"counter" **select*=*"0"**/>*
>
> *<**xsl:choose**>*
>
>   *<**xsl:when **test*=*"$counter  string-length($data)+1"**>*
>
> *<**xsl:value-of **select*=
> *'concat(substring($data,$counter,1),"")'**/>*
>
> *<**xsl:call-template **name*=*"zero_width_space_2"**>*
>
>   *<**xsl:with-param **name*=*"data" **select*=*"$data"**/>*
>
>   *<**xsl:with-param **name*=*"counter" **select*=*"$counter+1"*
> */>*
>
> **
>
>   **
>
>   *<**xsl:otherwise**>*
>
>   **
>
> **
>
>   **
>
>
>
>   *<**xsl:template **name*=*"zero_width_space_2"**>*
>
> *<**xsl:param **name*=*"data"**/>*
>
> *<**xsl:param **name*=*"counter"**/>*
>
> *<**xsl:value-of **select*=
> *'concat(substring($data,$counter,1),"")'**/>*
>
> *<**xsl:call-template **name*=*"zero_width_space_1"**>*
>
>   *<**xsl:with-param **name*=*"data" **select*=*"$data"**/>*
>
>   *<**xsl:with-param **name*=*"counter" **select*=*"$counter+1"**/>*
>
> **
>
>   **
>
>
>
> So, not an FOP problem.
>
>
>
> Marc
>
>
>
> *From:* Marc Kaufman [mailto:marck...@adobe.com ]
> *Sent:* Thursday, July 14, 2016 12:22 PM
> *To:* fop-users@xmlgraphics.apache.org
> *Subject:* RE: isolated high surrogate
>
>
>
> I tried that. Doesn’t work. I understand that non-BMP is not supported,
> and I’m prepared to live with two .notdef characters in the result, but I’m
> not sure why I’m getting the fatal error from the parser.
>
>
>
> *From:* Glenn Adams [mailto:gl...@skynav.com ]
> *Sent:* Thursday, July 14, 2016 12:01 PM
> *To:* FOP Users 
> *Subject:* Re: isolated high surrogate
>
>
>
> Non-BMP characters are not presently supported by FOP, see [1]. When they
> are supported, you would best encode them in a file using a single (not
> two) numeric character entities, e.g., , etc.
>
>
>
> [1] https://issues.apache.org/jira/browse/FOP-1969
>
>
>
> On Thu, Jul 14, 2016 at 12:51 PM, Marc Kaufman  wrote:
>
> I’m stumped by this error:
>
> org.xml.sax.SAXParseException; lineNumber: 92; columnNumber: 51;
> java.lang.IllegalArgumentException: isolated high surrogate
>
>
>
> I have text with surrogate pairs throughout the file, but this only occurs
> in this context:
>
>  font-family="Kozuka Gothic PR6N" font-size="18pt" color="black">
>
>   *<**xsl:call-template **name*=*"zero_width_space_1"**>*
>
> *<**xsl:with-param **name*=*"data" **select*=*"@documentName"**/>*
>
>   **
>
> 
>
>
>
> I’ve checked the input stream, and all the surrogates are correctly
> paired. I’ve tried escaping the surrogate pairs (e.g. “

RE: isolated high surrogate

2016-07-14 Thread Marc Kaufman
Worthwhile for someone to do, probably. Outside of my current needs. I’m not 
interested in being a FOP developer.

From: Glenn Adams [mailto:gl...@skynav.com]
Sent: Thursday, July 14, 2016 1:48 PM
To: FOP Users 
Subject: Re: isolated high surrogate

I'd suggest you test FOP by using an XSL-FO input file directly rather than an 
XSL template. Template processing is not part of FOP functionality in the first 
place.

On Thu, Jul 14, 2016 at 2:37 PM, Marc Kaufman 
> wrote:
More specifically, if I replace “ “ with u/200B (zero width space) in the 
string that contains surrogate characters, FOP parsing fails even if I just use 
xsl:value-of. I’m not going to pursue that at this time. Maybe when FOP handles 
non-BMP characters it should be revisited.

Marc

From: Marc Kaufman [mailto:marck...@adobe.com]
Sent: Thursday, July 14, 2016 12:34 PM

To: fop-users@xmlgraphics.apache.org
Subject: RE: isolated high surrogate

I’ve isolated the problem to a template definition that is trying to replace 
apace characters with non-breaking spaces. Evidently it clobbers some surrogate 
pairs. FWIW: here’s the offending line(s):

  



  


  
  

  
  
  

  

  




  
  

  

So, not an FOP problem.

Marc

From: Marc Kaufman [mailto:marck...@adobe.com]
Sent: Thursday, July 14, 2016 12:22 PM
To: fop-users@xmlgraphics.apache.org
Subject: RE: isolated high surrogate

I tried that. Doesn’t work. I understand that non-BMP is not supported, and I’m 
prepared to live with two .notdef characters in the result, but I’m not sure 
why I’m getting the fatal error from the parser.

From: Glenn Adams [mailto:gl...@skynav.com]
Sent: Thursday, July 14, 2016 12:01 PM
To: FOP Users 
>
Subject: Re: isolated high surrogate

Non-BMP characters are not presently supported by FOP, see [1]. When they are 
supported, you would best encode them in a file using a single (not two) 
numeric character entities, e.g., , etc.

[1] https://issues.apache.org/jira/browse/FOP-1969

On Thu, Jul 14, 2016 at 12:51 PM, Marc Kaufman 
> wrote:
I’m stumped by this error:
org.xml.sax.SAXParseException; lineNumber: 92; columnNumber: 51; 
java.lang.IllegalArgumentException: isolated high surrogate

I have text with surrogate pairs throughout the file, but this only occurs in 
this context:

  

  


I’ve checked the input stream, and all the surrogates are correctly paired. 
I’ve tried escaping the surrogate pairs (e.g. “

Re: isolated high surrogate

2016-07-14 Thread Glenn Adams
I'd suggest you test FOP by using an XSL-FO input file directly rather than
an XSL template. Template processing is not part of FOP functionality in
the first place.

On Thu, Jul 14, 2016 at 2:37 PM, Marc Kaufman  wrote:

> More specifically, if I replace “ “ with u/200B (zero width space) in the
> string that contains surrogate characters, FOP parsing fails even if I just
> use xsl:value-of. I’m not going to pursue that at this time. Maybe when FOP
> handles non-BMP characters it should be revisited.
>
>
>
> Marc
>
>
>
> *From:* Marc Kaufman [mailto:marck...@adobe.com]
> *Sent:* Thursday, July 14, 2016 12:34 PM
>
> *To:* fop-users@xmlgraphics.apache.org
> *Subject:* RE: isolated high surrogate
>
>
>
> I’ve isolated the problem to a template definition that is trying to
> replace apace characters with non-breaking spaces. Evidently it clobbers
> some surrogate pairs. FWIW: here’s the offending line(s):
>
>
>
>   *<**xsl:template **name*=*"zero_width_space_1"**>*
>
> *<**xsl:param **name*=*"data"**/>*
>
> *<**xsl:param **name*=*"counter" **select*=*"0"**/>*
>
> *<**xsl:choose**>*
>
>   *<**xsl:when **test*=*"$counter  string-length($data)+1"**>*
>
> *<**xsl:value-of **select*=
> *'concat(substring($data,$counter,1),"")'**/>*
>
> *<**xsl:call-template **name*=*"zero_width_space_2"**>*
>
>   *<**xsl:with-param **name*=*"data" **select*=*"$data"**/>*
>
>   *<**xsl:with-param **name*=*"counter" **select*=*"$counter+1"*
> */>*
>
> **
>
>   **
>
>   *<**xsl:otherwise**>*
>
>   **
>
> **
>
>   **
>
>
>
>   *<**xsl:template **name*=*"zero_width_space_2"**>*
>
> *<**xsl:param **name*=*"data"**/>*
>
> *<**xsl:param **name*=*"counter"**/>*
>
> *<**xsl:value-of **select*=
> *'concat(substring($data,$counter,1),"")'**/>*
>
> *<**xsl:call-template **name*=*"zero_width_space_1"**>*
>
>   *<**xsl:with-param **name*=*"data" **select*=*"$data"**/>*
>
>   *<**xsl:with-param **name*=*"counter" **select*=*"$counter+1"**/>*
>
> **
>
>   **
>
>
>
> So, not an FOP problem.
>
>
>
> Marc
>
>
>
> *From:* Marc Kaufman [mailto:marck...@adobe.com ]
> *Sent:* Thursday, July 14, 2016 12:22 PM
> *To:* fop-users@xmlgraphics.apache.org
> *Subject:* RE: isolated high surrogate
>
>
>
> I tried that. Doesn’t work. I understand that non-BMP is not supported,
> and I’m prepared to live with two .notdef characters in the result, but I’m
> not sure why I’m getting the fatal error from the parser.
>
>
>
> *From:* Glenn Adams [mailto:gl...@skynav.com ]
> *Sent:* Thursday, July 14, 2016 12:01 PM
> *To:* FOP Users 
> *Subject:* Re: isolated high surrogate
>
>
>
> Non-BMP characters are not presently supported by FOP, see [1]. When they
> are supported, you would best encode them in a file using a single (not
> two) numeric character entities, e.g., , etc.
>
>
>
> [1] https://issues.apache.org/jira/browse/FOP-1969
>
>
>
> On Thu, Jul 14, 2016 at 12:51 PM, Marc Kaufman  wrote:
>
> I’m stumped by this error:
>
> org.xml.sax.SAXParseException; lineNumber: 92; columnNumber: 51;
> java.lang.IllegalArgumentException: isolated high surrogate
>
>
>
> I have text with surrogate pairs throughout the file, but this only occurs
> in this context:
>
>  font-family="Kozuka Gothic PR6N" font-size="18pt" color="black">
>
>   *<**xsl:call-template **name*=*"zero_width_space_1"**>*
>
> *<**xsl:with-param **name*=*"data" **select*=*"@documentName"**/>*
>
>   **
>
> 
>
>
>
> I’ve checked the input stream, and all the surrogates are correctly
> paired. I’ve tried escaping the surrogate pairs (e.g. “

RE: isolated high surrogate

2016-07-14 Thread Marc Kaufman
More specifically, if I replace “ “ with u/200B (zero width space) in the 
string that contains surrogate characters, FOP parsing fails even if I just use 
xsl:value-of. I’m not going to pursue that at this time. Maybe when FOP handles 
non-BMP characters it should be revisited.

Marc

From: Marc Kaufman [mailto:marck...@adobe.com]
Sent: Thursday, July 14, 2016 12:34 PM
To: fop-users@xmlgraphics.apache.org
Subject: RE: isolated high surrogate

I’ve isolated the problem to a template definition that is trying to replace 
apace characters with non-breaking spaces. Evidently it clobbers some surrogate 
pairs. FWIW: here’s the offending line(s):

  



  


  
  

  
  
  

  

  




  
  

  

So, not an FOP problem.

Marc

From: Marc Kaufman [mailto:marck...@adobe.com]
Sent: Thursday, July 14, 2016 12:22 PM
To: fop-users@xmlgraphics.apache.org
Subject: RE: isolated high surrogate

I tried that. Doesn’t work. I understand that non-BMP is not supported, and I’m 
prepared to live with two .notdef characters in the result, but I’m not sure 
why I’m getting the fatal error from the parser.

From: Glenn Adams [mailto:gl...@skynav.com]
Sent: Thursday, July 14, 2016 12:01 PM
To: FOP Users 
>
Subject: Re: isolated high surrogate

Non-BMP characters are not presently supported by FOP, see [1]. When they are 
supported, you would best encode them in a file using a single (not two) 
numeric character entities, e.g., , etc.

[1] https://issues.apache.org/jira/browse/FOP-1969

On Thu, Jul 14, 2016 at 12:51 PM, Marc Kaufman 
> wrote:
I’m stumped by this error:
org.xml.sax.SAXParseException; lineNumber: 92; columnNumber: 51; 
java.lang.IllegalArgumentException: isolated high surrogate

I have text with surrogate pairs throughout the file, but this only occurs in 
this context:

  

  


I’ve checked the input stream, and all the surrogates are correctly paired. 
I’ve tried escaping the surrogate pairs (e.g. “

RE: isolated high surrogate

2016-07-14 Thread Marc Kaufman
I’ve isolated the problem to a template definition that is trying to replace 
apace characters with non-breaking spaces. Evidently it clobbers some surrogate 
pairs. FWIW: here’s the offending line(s):

  



  


  
  

  
  
  

  

  




  
  

  

So, not an FOP problem.

Marc

From: Marc Kaufman [mailto:marck...@adobe.com]
Sent: Thursday, July 14, 2016 12:22 PM
To: fop-users@xmlgraphics.apache.org
Subject: RE: isolated high surrogate

I tried that. Doesn’t work. I understand that non-BMP is not supported, and I’m 
prepared to live with two .notdef characters in the result, but I’m not sure 
why I’m getting the fatal error from the parser.

From: Glenn Adams [mailto:gl...@skynav.com]
Sent: Thursday, July 14, 2016 12:01 PM
To: FOP Users 
>
Subject: Re: isolated high surrogate

Non-BMP characters are not presently supported by FOP, see [1]. When they are 
supported, you would best encode them in a file using a single (not two) 
numeric character entities, e.g., , etc.

[1] https://issues.apache.org/jira/browse/FOP-1969

On Thu, Jul 14, 2016 at 12:51 PM, Marc Kaufman 
> wrote:
I’m stumped by this error:
org.xml.sax.SAXParseException; lineNumber: 92; columnNumber: 51; 
java.lang.IllegalArgumentException: isolated high surrogate

I have text with surrogate pairs throughout the file, but this only occurs in 
this context:

  

  


I’ve checked the input stream, and all the surrogates are correctly paired. 
I’ve tried escaping the surrogate pairs (e.g. “

RE: isolated high surrogate

2016-07-14 Thread Marc Kaufman
I tried that. Doesn’t work. I understand that non-BMP is not supported, and I’m 
prepared to live with two .notdef characters in the result, but I’m not sure 
why I’m getting the fatal error from the parser.

From: Glenn Adams [mailto:gl...@skynav.com]
Sent: Thursday, July 14, 2016 12:01 PM
To: FOP Users 
Subject: Re: isolated high surrogate

Non-BMP characters are not presently supported by FOP, see [1]. When they are 
supported, you would best encode them in a file using a single (not two) 
numeric character entities, e.g., , etc.

[1] https://issues.apache.org/jira/browse/FOP-1969

On Thu, Jul 14, 2016 at 12:51 PM, Marc Kaufman 
> wrote:
I’m stumped by this error:
org.xml.sax.SAXParseException; lineNumber: 92; columnNumber: 51; 
java.lang.IllegalArgumentException: isolated high surrogate

I have text with surrogate pairs throughout the file, but this only occurs in 
this context:

  

  


I’ve checked the input stream, and all the surrogates are correctly paired. 
I’ve tried escaping the surrogate pairs (e.g. “

Re: isolated high surrogate

2016-07-14 Thread Glenn Adams
Non-BMP characters are not presently supported by FOP, see [1]. When they
are supported, you would best encode them in a file using a single (not
two) numeric character entities, e.g., , etc.

[1] https://issues.apache.org/jira/browse/FOP-1969

On Thu, Jul 14, 2016 at 12:51 PM, Marc Kaufman  wrote:

> I’m stumped by this error:
>
> org.xml.sax.SAXParseException; lineNumber: 92; columnNumber: 51;
> java.lang.IllegalArgumentException: isolated high surrogate
>
>
>
> I have text with surrogate pairs throughout the file, but this only occurs
> in this context:
>
>  font-family="Kozuka Gothic PR6N" font-size="18pt" color="black">
>
>   *<**xsl:call-template **name*=*"zero_width_space_1"**>*
>
> *<**xsl:with-param **name*=*"data" **select*=*"@documentName"**/>*
>
>   **
>
> 
>
>
>
> I’ve checked the input stream, and all the surrogates are correctly
> paired. I’ve tried escaping the surrogate pairs (e.g. “

isolated high surrogate

2016-07-14 Thread Marc Kaufman
I'm stumped by this error:
org.xml.sax.SAXParseException; lineNumber: 92; columnNumber: 51; 
java.lang.IllegalArgumentException: isolated high surrogate

I have text with surrogate pairs throughout the file, but this only occurs in 
this context:

  

  


I've checked the input stream, and all the surrogates are correctly paired. 
I've tried escaping the surrogate pairs (e.g. "

FOP rendering for SWT

2016-07-14 Thread Philippe Detournay
Hi everyone,

I hope this is the right place for posting this kind of information.

In the scope of a much larger project I had to implement an SWT renderer for 
FOP and decided to publish it back to the community in the hope it might be 
useful to others.

The code is mostly based on the existing AWTRenderer class and its utilities. I 
published it on GitHub at https://github.com/ThePlouf/fop-swtrenderer

It requires SWT 4.5 or later, and FOP 2.0 or later. The code is using Java-8 
idioms but should be trivially modifiable to accommodate earlier versions if 
needed.

Best regards to all,
Philippe