A
awilliam
I'm using the BIE workflow engine and after querying an LDAP DSA I need
to transform the XML response, which looks like -
<?xml version="1.0" encoding="UTF-8" ?>
<batchResponse xmlns="urn
asis:names:tc
SML:2:0:core"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<searchResponse requestID="9">
<searchResultEntry dn="cn=Larry Simmons,ou=People,o=Morrison
Industries,c=US" requestID="9">
attr name="morrisonserialid">
<value>1015</value>
</attr>
<attr name="birthDate">
<value>02/17/1948</value>
</attr>
<attr name="cn">
<value>Larry Simmons</value>
</attr>
<attr name="employeeNumber">
<value>KZO004</value>
</attr>
</searchResultEntry>
.....
<searchResultDone requestID="9">
<resultCode code="0" descr="Success" />
</searchResultDone>
</searchResponse>
</batchResponse>
Into something like -
<result>
<row>
<cn>...</cn>
<birthdate>...</birthdate>
....
</row>
....
</result>
So I have an xslt like
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<result>
<xsl:for-each
select="batchResponse/searchResponse/searchResultEntry">
<xsl:sort select="morrisonserialid"/>
<row>
<cn><xsl:value-of select="attr[@name='cn']/value"/></cn>
<birthdate><xsl:value-of
select="attr[@name='birthday']/value"/></birthdate>
<morrisonserialid><xsl:value-of
select="attr[@name='morrisonserialid']/value"/></morrisonserialid>
<fileAs><xsl:value-of
select="attr[@name='fileAs']/value"/></fileAs>
<startDate><xsl:value-of
select="attr[@name='morrisonpositionstartdate']/value"/></startDate>
</row>
</xsl:for-each>
</result>
</xsl:template>
</xsl:stylesheet>
Only when I -
xsltproc /var/spool/bie/xslt/dsaEmployeeExport.2.xslt /tmp/ldapData.xml
- all I get is -
<?xml version="1.0"?>
<result/>
Huh?
to transform the XML response, which looks like -
<?xml version="1.0" encoding="UTF-8" ?>
<batchResponse xmlns="urn
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<searchResponse requestID="9">
<searchResultEntry dn="cn=Larry Simmons,ou=People,o=Morrison
Industries,c=US" requestID="9">
attr name="morrisonserialid">
<value>1015</value>
</attr>
<attr name="birthDate">
<value>02/17/1948</value>
</attr>
<attr name="cn">
<value>Larry Simmons</value>
</attr>
<attr name="employeeNumber">
<value>KZO004</value>
</attr>
</searchResultEntry>
.....
<searchResultDone requestID="9">
<resultCode code="0" descr="Success" />
</searchResultDone>
</searchResponse>
</batchResponse>
Into something like -
<result>
<row>
<cn>...</cn>
<birthdate>...</birthdate>
....
</row>
....
</result>
So I have an xslt like
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<result>
<xsl:for-each
select="batchResponse/searchResponse/searchResultEntry">
<xsl:sort select="morrisonserialid"/>
<row>
<cn><xsl:value-of select="attr[@name='cn']/value"/></cn>
<birthdate><xsl:value-of
select="attr[@name='birthday']/value"/></birthdate>
<morrisonserialid><xsl:value-of
select="attr[@name='morrisonserialid']/value"/></morrisonserialid>
<fileAs><xsl:value-of
select="attr[@name='fileAs']/value"/></fileAs>
<startDate><xsl:value-of
select="attr[@name='morrisonpositionstartdate']/value"/></startDate>
</row>
</xsl:for-each>
</result>
</xsl:template>
</xsl:stylesheet>
Only when I -
xsltproc /var/spool/bie/xslt/dsaEmployeeExport.2.xslt /tmp/ldapData.xml
- all I get is -
<?xml version="1.0"?>
<result/>
Huh?