RE: [xsl] xslt 2.0 castable as

Subject: RE: [xsl] xslt 2.0 castable as
From: David.Pawson@xxxxxxxxxxx
Date: Tue, 3 Feb 2004 10:37:02 -0000
    I was going to comment in my first reply that I was 
    surprised to see you (well known for being pleased about 
    all the schema stuff added to
    XSLT) using casting to XSD types rather than using regexp handling.
    Mike just said regexp are likely to be more efficient as well...

I had little choice, other than escaping to java.

<ientry3><contract>enough</contract>, <contract>en</contract>,
<contract>in</contract>, 8.4.22-24</ientry3>

So I was down to template matching on text()[last()]
then regexing, which still leaves me the comma's interspersed.

 <xsl:template match="text()[last()]" mode="idx">
   <xsl:analyze-string select="." regex="[0-9.\-]+"  flags="m">
     <xsl:matching-substring>
       <xsl:if test="not(normalize-space(.) = ',')">
         <t><xsl:value-of
select="normalize-space(.)"/></t></xsl:if></xsl:matching-substring>
<xsl:non-matching-substring><xsl:value-of
select="."/></xsl:non-matching-substring> </xsl:analyze-string>
</xsl:template>



V. messy. And I've still to turn these into idrefs :-)

And what's worse, its wordperfect 9 to blame.
 Unfortunately, its a wp which has good font support and hacks xml.

regards DaveP


- 
DISCLAIMER: 

NOTICE: The information contained in this email and any attachments is 
confidential and may be privileged. If you are not the intended 
recipient you should not use, disclose, distribute or copy any of the 
content of it or of any attachment; you are requested to notify the 
sender immediately of your receipt of the email and then to delete it 
and any attachments from your system. 

RNIB endeavours to ensure that emails and any attachments generated by 
its staff are free from viruses or other contaminants. However, it 
cannot accept any responsibility for any  such which are transmitted.
We therefore recommend you scan all attachments. 

Please note that the statements and views expressed in this email and 
any attachments are those of the author and do not necessarily represent 
those of RNIB. 

RNIB Registered Charity Number: 226227 

Website: http://www.rnib.org.uk 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread