Hi, Corneil
With your stylesheet only, there is not enough information for me to tell
whether it is a problem of your stylesheet or it is a bug in
substring-after function. Would you please provide your xml file as well?
Christine Li
XSLT Development
IBM Toronto Lab
Tel: (905)413-2601
Email: [EMAIL PROTECTED]
"du Plessis,
Corneil C" To: [EMAIL PROTECTED]
<[EMAIL PROTECTED] cc:
c.co.za> Subject: substring-after and
substring-before
05/21/2003 04:49
AM
I have a problem with substring-before and substring-after.
A transformation that worked with Xalan 1.x stopped working when I moved up
to 2.x I have tried 2.5.0 and 2.4.1 with no success.
Has anyone experienced a similar problem?
Am I doing someting wrong?
This XSL converts DSML to LDIF and will optionaly replace a portion of a DN
with a new value.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dsml="http://www.dsml.org/DSML" version="1.0">
<xsl:output method="text" encoding="UTF-8" media-type="text/txt"
omit-xml-declaration="yes" />
<xsl:param name="searchdn" select="string('')"/>
<xsl:param name="replacedn" select="string('')"/>
<xsl:template match="/">
<xsl:if test="string-length($searchdn) != 0">
<xsl:message>Replacing <xsl:value-of select="$searchdn"/>
with <xsl:value-of select="$replacedn"/></xsl:message>
</xsl:if>
<xsl:apply-templates
select="dsml:dsml/dsml:directory-entries/dsml:entry"/>
<xsl:text disable-output-escaping="yes">
</xsl:text>
</xsl:template>
<xsl:template match="dsml:entry" name="entry">
<xsl:if test="string-length($searchdn) != 0">
<xsl:text disable-output-escaping="yes">
dn:
</xsl:text><xsl:value-of
select="concat(substring-before(@dn,$searchdn),$replacedn,substring-after(@dn,$searchdn))"/>
</xsl:if>
<xsl:if test="string-length($searchdn) = 0">
<xsl:text disable-output-escaping="yes">
dn:
</xsl:text><xsl:value-of select="@dn"/>
</xsl:if>
<xsl:for-each select="dsml:objectclass/dsml:oc-value">
<xsl:text disable-output-escaping="yes">
objectclass:
</xsl:text><xsl:value-of select="text()"/>
</xsl:for-each>
<xsl:for-each select="dsml:attr/dsml:value">
<xsl:if test="boolean(string-length(text()) > 0) or
boolean(normalize-space(text()) != ' ')">
<xsl:text
disable-output-escaping="yes">
</xsl:text><xsl:value-of
select="../@name"/>: <xsl:value-of select="text()"/>
</xsl:if>
</xsl:for-each>
<xsl:text disable-output-escaping="yes">
</xsl:text>
</xsl:template>
</xsl:stylesheet>
Corneil du Plessis
Technical Specialist
Internet Development
Retail Channels
Standard Bank
Direct +27 (11) 636-2210
Mobile +27 (83) 442-9221
ICQ# 66747137
__________________________________________________________________________________________________________________________________
For information about the Standard Bank group visit our web site <
www.standardbank.co.za>
__________________________________________________________________________________________________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relating to the official
business of Standard Bank Group Limited is proprietary to the group.
It is confidential, legally privileged and protected by law.
Standard Bank does not own and endorse any other content. Views and
opinions are those of the sender unless clearly stated as being that of the
group.
The person addressed in the e-mail is the sole authorised recipient. Please
notify the sender immediately if it has unintentionally reached you and do
not read,
disclose or use the content in any way.
Standard Bank can not assure that the integrity of this communication has
been maintained nor that it is free of errors, virus, interception or
interference.
___________________________________________________________________________________________________________________________________