Anonymous_User Absent Member.
Absent Member.
168 views

Escape DN using a DN format other than Source or Dest

I've had this problem several times now.

Problem: Calling token-escape-for-dest-dn will use the driver's defined "Supported DN format" in it's escaping rules. There is no way to override this and specify that you want to use another DN format for escaping.

For example: In a null where the Supported DN format (aka Dest-dn-format) is "slash", have tried to tweak this value without success.

What I actually wanted was to within a Null Driver, escape a dn fragment using LDAP DN format instead.


The following code seems to work (but is a bit ugly)

<token-replace-first regex="cn=" replace-with="">
<token-parse-dn dest-dn-format="ldap">
<token-text xml:space="preserve">cn=</token-text>
<token-escape-for-dest-dn>
<token-local-variable name="dnFragment"/>
</token-escape-for-dest-dn>
</token-parse-dn>
</token-replace-first>

I suspect that it could also be done via calling the getName method of the XdsDN class as it allows you to specify the DN format delimiters. Has anyone tried that?
https://www.novell.com/documentation/developer/dirxml/dirxmlbk/api/com/novell/nds/dirxml/util/XdsDN.html

Anyone got other another idea/approach?
Labels (1)
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.