I have a complex stylesheet which is doing quite a bit. And I am
looking to decode a Base64 encoded attribute which comes back as part of
a query and then substring it.

I get the PWM Response back as:

<attr attr-name="pwmResponseSet">
<value timestamp="1346201802#2"
type="octet">MDAwMiMuIy4jPD94bWwgdmVyc2lvbj0iMS4wI iBlbmNvZGluZz0iVVRGLTgiPz48UmVzcG9uc2VTZXQgY2FzZUl uc2Vuc2l0aXZlPSJ0cnVlIiBjaGFpVmVyc2lvbj0iMC42LjMiI GNoYWxsZW5nZVNldElEPSJwd20tZGVmaW5lZCB2MS42LjMgYjE xODEgKHJlbGVhc2UpIiBsb2NhbGU9ImVuIiBtaW5SYW5kb21SZ XF1aXJlZD0iMiIgdGltZT0iMjAxMi0wOC0xNSAwMjowOTo1NyA rMDAwMCIgdmVyc2lvbj0iMiI+PHJlc3BvbnNlIGFkbWluRGVma W5lZD0iZmFsc2UiIG1heExlbmd0aD0iMjAwIiBtaW5MZW5ndGg 9IjQiIHJlcXVpcmVkPSJmYWxzZSI+PGNoYWxsZW5nZT5XaGF0I GlzIHlvdXIgbmFtZT88L2NoYWxsZW5nZT48YW5zd2VyIGZvcm1 hdD0iVEVYVCI+PCFbQ0RBVEFbQXJ0aHVyXV0+PC9hbnN3ZXI+P C9yZXNwb25zZT48cmVzcG9uc2UgYWRtaW5EZWZpbmVkPSJmYWx zZSIgbWF4TGVuZ3RoPSIyMDAiIG1pbkxlbmd0aD0iNCIgcmVxd WlyZWQ9ImZhbHNlIj48Y2hhbGxlbmdlPldoYXQgaXMgeW91ciB xdWVzdD88L2NoYWxsZW5nZT48YW5zd2VyIGZvcm1hdD0iVEVYV CI+PCFbQ0RBVEFbSG9seUdyYWlsXV0+PC9hbnN3ZXI+PC9yZXN wb25zZT48cmVzcG9uc2UgYWRtaW5EZWZpbmVkPSJmYWxzZSIgb WF4TGVuZ3RoPSIyMDAiIG1pbkxlbmd0aD0iNCIgcmVxdWlyZWQ 9ImZhbHNlIj48Y2hhbGxlbmdlPldoYXQgaXMgdGhlIGFpcnNwZ WVkIHZlbG9jaXR5IG9mIGFuIHVubGFkZW4gc3BhcnJvdz88L2N oYWxsZW5nZT48YW5zd2VyIGZvcm1hdD0iVEVYVCI+PCFbQ0RBV EFbRW5nbGlzaG9yQW1lcmljYW5dXT48L2Fuc3dlcj48L3Jlc3B vbnNlPjwvUmVzcG9uc2VTZXQ+</value>
</attr>


And would like to decode it from:

and then substring after character 47 so I would take the decoded
document from:

0002#.#.#<?xml version="1.0" encoding="UTF-8"?><ResponseSet
caseInsensitive="true" chaiVersion="0.6.3" challengeSetID="pwm-defined
v1.6.3 b1181 (release)" locale="en" minRandomRequired="2"
time="2012-08-15 02:09:57 +0000" version="2"><response
adminDefined="false" maxLength="200" minLength="4"
required="false"><challenge>What is your name?</challenge><answer
format="TEXT"><![CDATA[Arthur]]></answer></response><response
adminDefined="false" maxLength="200" minLength="4"
required="false"><challenge>What is your quest?</challenge><answer
format="TEXT"><![CDATA[HolyGrail]]></answer></response><response
adminDefined="false" maxLength="200" minLength="4"
required="false"><challenge>What is the airspeed velocity of an unladen
sparrow?</challenge><answer
format="TEXT"><![CDATA[EnglishorAmerican]]></answer></response></ResponseSet>

to

<ResponseSet caseInsensitive="true" chaiVersion="0.6.3"
challengeSetID="pwm-defined v1.6.3 b1181 (release)" locale="en"
minRandomRequired="2" time="2012-08-15 02:09:57 +0000"
version="2"><response adminDefined="false" maxLength="200" minLength="4"
required="false"><challenge>What is your name?</challenge><answer
format="TEXT"><![CDATA[Arthur]]></answer></response><response
adminDefined="false" maxLength="200" minLength="4"
required="false"><challenge>What is your quest?</challenge><answer
format="TEXT"><![CDATA[HolyGrail]]></answer></response><response
adminDefined="false" maxLength="200" minLength="4"
required="false"><challenge>What is the airspeed velocity of an unladen
sparrow?</challenge><answer
format="TEXT"><![CDATA[EnglishorAmerican]]></answer></response></ResponseSet>

Any ideas??

As I can get the object out base64 decoded using the ldap util:

xmlns:base64="http://www.novell.com/nxsl/java/com.novell.ldap.util.Base64"

<xsl:variable name="QA64"
select="base64:decode($getIDResult//attr[@attr-name='pwmResponseSet']/value)"/>
<xsl:message>QA64 <xsl:value-of select="$QA64"/>
</xsl:message>

But I was hoping to do a toString() without needing to build my own
java call.


--
peter_lambrechtsen
------------------------------------------------------------------------
peter_lambrechtsen's Profile: https://forums.netiq.com/member.php?userid=495
View this thread: https://forums.netiq.com/showthread.php?t=2898