Patch to xml2html.xsl to change end-of-sentence matching

DJ Gregor <[email protected]> Tue, 28 Jun 2005 00:25:34 -0400
Newsgroups gmane.text.xml.xframe.xsddoc
Message-ID <[email protected]>
--Apple-Mail-2--108386380
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed

I have attached a patch to xml2html.xsl to change end-of-sentence 
matching.  Instead of matching on a single period ('.') and chopping 
off everything after when making pages like the overview page, it 
matches on a period followed by a space ('. ') after the text has been 
normalized.  I wanted this because I have text like "XML Schema for the 
actiond-configuration.xml configuration file.", and I wanted all of 
this to be included in the overview page, not just "XML Schema for the 
actiond-configuration.".

Does this seem like a sane thing to do?


	- djg


--Apple-Mail-2--108386380
Content-Transfer-Encoding: quoted-printable
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="xml2html.xsl.patch"
Content-Disposition: attachment;
	filename=xml2html.xsl.patch

---=20orig/xsddoc-0.8-beta/src/net/sf/xframe/xsddoc/xslt/xml2html.xsl=09=
Fri=20Apr=2022=2010:20:54=202005=0A+++=20=
xsddoc-0.8-beta/src/net/sf/xframe/xsddoc/xslt/xml2html.xsl=09Tue=20Jun=20=
28=2000:20:16=202005=0A@@=20-410,8=20+410,8=20@@=0A=20=20=20=
<xsl:template=20match=3D"doc:component"=20mode=3D"index-all">
=20=20=20=20=20<xsl:variable=20name=3D"base">
=20=20=20=20=20=20=20<xsl:choose>
-=20=20=20=20=20=20=20=20<xsl:when=20test=3D"contains(@name,=20'.')">
-=20=20=20=20=20=20=20=20=20=20<xsl:value-of=20=
select=3D"substring-before(@name,=20concat('.',=20@tag))"/>
+=20=20=20=20=20=20=20=20<xsl:when=20=
test=3D"contains(normalize-space(@name),=20'.=20')">
+=09=20=20<xsl:value-of=20=
select=3D"substring-before(normalize-space(@name),=20concat('.=20',=20=
@tag))"/>
=20=20=20=20=20=20=20=20=20</xsl:when>
=20=20=20=20=20=20=20=20=20<xsl:otherwise>
=20=20=20=20=20=20=20=20=20=20=20<xsl:value-of=20select=3D"string('')"/>
@@=20-1723,8=20+1723,8=20@@=0A=20=20=20<xsl:template=20match=3D"text()"=20=
mode=3D"abstract">
=20=20=20=20=20<xsl:param=20name=3D"rest"/>
=20=20=20=20=20<xsl:choose>
-=20=20=20=20=20=20<xsl:when=20test=3D"contains(.,=20'.')">
-=20=20=20=20=20=20=20=20<xsl:value-of=20=
select=3D"concat(substring-before(.,=20'.'),=20'.')"/>
+=20=20=20=20=20=20<xsl:when=20test=3D"contains(normalize-space(),=20'.=20=
')">
+=20=20=20=20=20=20=20=20<xsl:value-of=20=
select=3D"concat(substring-before(normalize-space(),=20'.=20'),=20=
'.')"/>
=20=20=20=20=20=20=20</xsl:when>
=20=20=20=20=20=20=20<xsl:otherwise>
=20=20=20=20=20=20=20=20=20<xsl:value-of=20select=3D"."/>

--Apple-Mail-2--108386380--



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click