Hi all!

I'm developing a new Delimited Text driver at a project. I need to
control add and mydify events. Because of this I deleted the default
XSLT script in Subscriber Event Transformation to allow events to pass
in add or modify tag and not be changed to instance tag.

My big problem is the Output Stylesheet in Output of Subscriber
channel. This XSLT only works with add and instance XML tags. When I
create a new object, in this case new group, the text file is generated
without any problem, but when I perform a modify in any filtered
attribute the text file is generated only with coma ( , ) character. I
need to change the default Output stylesheet to performe the same
actions to modify tag or I need to create another XSLT to perform this
modify operations.

This is my XSLT (default):

<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0"
xmlns:cmd="http://www.novell.com/nxsl/java/com.novell.nds.dirxml.driver.XdsCommandProcessor"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslaram name="srcCommandProcessor"/>
<!-- each application must fill in the name of the field that provides
the association key -->
<xsl:variable name="association-field-name" select="'folderName'"/>
<!-- change the following line to change the delimiter from a comma to
any other desired delimiter -->
<xsl:variable name="delimiter" select="','"/>

<xsl:template match="nds[input]">
<!-- only look at <add> events and <instances> apply a template for
each add transaction-->
<xsl:apply-templates select="//add|//instance"/>
</xsl:template>
<xsl:template match="nds[output]">
<xsl:copy-of select="."/>
</xsl:template>
<!-- now here's the template -->
<xsl:template match="input/add|input/instance">
<!-- create association if needed and we have enough info -->
<xsl:variable name="hasAssociation" select="string(association) !=
''"/>
<xsl:variable name="associationValue" select="*[(@attr-name =
$association-field-name)][1]/value[1]/text()"/>
<xsl:if test="not($hasAssociation) and $associationValue">
<xsl:variable name="dummy">
<add-association dest-dn="{@src-dn}"
dest-entry-id="{@src-entry-id}">
<xsl:value-of select="$associationValue"/>
</add-association>
</xsl:variable>
<xsl:variable name="dummy2"
select="cmd:execute($srcCommandProcessor, $dummy)"/>
</xsl:if>
<!-- output the fields in order -->
<xsl:call-template name="output-field">
<xsl:with-param name="field-value" select="*[(@attr-name =
'comando')][1]/value[1]"/>
</xsl:call-template>
<xsl:value-of select="$delimiter"/>
<xsl:call-template name="output-field">
<xsl:with-param name="field-value" select="*[(@attr-name =
'folderName')][1]/value[1]"/>
</xsl:call-template>
<xsl:value-of select="$delimiter"/>
<xsl:call-template name="output-field">
<xsl:with-param name="field-value" select="*[(@attr-name =
'folderPath')][1]/value[1]"/>
</xsl:call-template>
<xsl:value-of select="$delimiter"/>
<xsl:call-template name="output-field">
<xsl:with-param name="field-value" select="*[(@attr-name =
'folderSize')][1]/value[1]"/>
</xsl:call-template>
<xsl:value-of select="$delimiter"/>
<xsl:call-template name="output-field">
<xsl:with-param name="field-value" select="*[(@attr-name =
'folderType')][1]/value[1]"/>
</xsl:call-template>

<!-- finish the record with a newline -->
<!-- uncomment next line to have DOS style end of line (0D0A),
otherwise just 0A -->
<!-- <xsl:value-of select="'&#x0D;'"/> -->
<xsl:value-of select="&apos;&#xa;&apos;"/>
</xsl:template>
<xsl:template name="output-field">
<xslaram name="field-value"/>
<xsl:choose>
<xsl:when test="contains($field-value, $delimiter)">
<!-- if the field value contains a delimiter, then enclose in
quotes -->
<xsl:text>"</xsl:text>
<xsl:value-of select="$field-value"/>
<xsl:text>"</xsl:text>
</xsl:when>
<xsltherwise>
<!-- otherwise output it raw -->
<xsl:value-of select="$field-value"/>
</xsltherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

Thank you!

Att,
Alan Cota.


--
* Alan Cota | Open Consult | Brazil, Novell Platinum Partner.
CNE | ISM & Security Specialist.
http://www.alancota.net*
------------------------------------------------------------------------
AlanCota's Profile: http://forums.novell.com/member.php?userid=1961
View this thread: http://forums.novell.com/showthread.php?t=377147