You have presumably defined the entity nbsp as a reference to the
character xA0. The XML parser expands the entity reference,a nd all that
Saxon gets to see is the character A0 (or 160 in decimal). This is the
character that will be passed to your Java extension.
"a acute" is what the Unicode character xA0 looks like when it is
encoded in UTF-8, and the UTF-8 is displayed using software that thinks
it is handling iso-8859-1.
Michael Kay
> -----Original Message-----
> From: saxon-help-admin@...
> [mailto:saxon-help-admin@...] On Behalf Of=20
> Frances.Danilewicz@...
> Sent: 11 July 2003 12:23
> To: saxon-help@...
> Subject: [saxon] Saxon 7 / java extension /
>=20
>=20
> I have written a java extension to identify 'whitespace'
>=20
> but when a string containing is passed to java it is=20
> converted to a single character =E1
>=20
> How can I pass the string to java and preserve it's original content ?
>=20
> this is the xsl:
>=20
> <xsl:variable name=3D"current_item">
> <xsl:value-of select=3D"node()"/>
> </xsl:variable>
>=20
> <xsl:value-of select=3D"$current_item"/> <!-- this=20
> appears as -->
>=20
> <xsl:choose>
> <xsl:when test=3D"NarrowLayout:NotWhitespace($current_item)">
> <xsl:comment>
> Not whitespace
> </xsl:comment>
> </xsl:when>
>=20
> <xsl:otherwise>
> <xsl:comment>
> Whitespace
> </xsl:comment>
> </xsl:otherwise>
> </xsl:choose>
>=20
> this is the java:
>=20
>=20
> public static boolean NotWhitespace(String Contents)
> {
> System.out.println(Contents.length()+" :=20
> "+Contents); // this appears as 1 : =E1=20
> return true;
>=20
> }
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.Net email sponsored by: Parasoft
> Error proof Web apps, automate testing & more.
> Download & eval WebKing and get a free book.=20
> http://www.parasoft.com/bulletproofapps1=20
> _______________________________________________
> saxon-help mailing list
> saxon-help@...
> https://lists.sourceforge.net/lists/listinfo/s> axon-help
>=20
|