I am very new to using XSLT. I've been tasked with getting our C-Cure 9000 system to accept clearances from active directory security groups. I've gotten as far as listing the groups of the user, but have not been able to figure out how to strip the unnecessary text.
This is what I'm trying to work with:
<GroupsAll>CN=Doors - Test,OU=C-Cure Test,OU=Security Groups,DC=test,DC=local|CN=Doors - Test2,OU=C-Cure Test,OU=Security Groups,DC=test,DC=local|CN=VPN Admins2,OU=VPN,OU=Security Groups,DC=test,DC=local|CN=VPN Admins,OU=VPN,OU=Security Groups,DC=test,DC=local|CN=GPO Cert Testing,OU=Information Technology,OU=Security Groups,DC=test,DC=local|CN=Muni Bldg 8th,OU=Municipal Building,OU=Milestone Camera Access,OU=Security Groups,DC=test,DC=local</GroupsAll>
I need to strip out any group that does not contain "Doors" and then remove the "CN=" and ",OU=C-Cure Test,OU=Security Groups,DC=test,DC=local".
I need to get it to look like:
<ClearancesAll>Doors - Test,Doors - Test2</ClearancesAll>
Ive tried a ton of different code, but don't know enough to make it work.
Any help or suggestions on how to get this to work would be greatly appreciated!
Thanks!
Edit:
This is the code i see:
<CrossFire culture-info=" en-US">
<SoftwareHouse.NextGen.Common.SecurityObjects.Personnel ImportMode=" Default">
<Text1>*****</Text1>
<FirstName>******</FirstName>
<GroupsAll>CN=Doors - Test,OU=C-Cure Test,OU=Security Groups,DC=test,DC=local|CN=Doors - Test2,OU=C-Cure Test,OU=Security Groups,DC=test,DC=local|CN=VPN Admins2,OU=VPN,OU=Security Groups,DC=test,DC=local|CN=VPN Admins,OU=VPN,OU=Security Groups,DC=test,DC=local|CN=GPO Cert Testing,OU=Information Technology,OU=Security Groups,DC=test,DC=local|CN=Muni Bldg 8th,OU=Municipal Building,OU=Milestone Camera Access,OU=Security Groups,DC=test,DC=local</GroupsAll>
<GUID>0xADD5234ACA37CE*********</GUID>
<LastName>*****</LastName>
</SoftwareHouse.NextGen.Common.SecurityObjects.Personnel>
</CrossFire>
and this is the "stylesheet template" the software gives me to work with:
<?xml version ="1.0" encoding="utf8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<!-- Parameters assigned at runtime. -->
<xsl:param name="paramCurrentTimestamp">20001231173010</xsl:param>
<xsl:param name="paramCurrentDT" >12/31/2000 5:30:10 PM</xsl:param>
<xsl:param name="paramCurrentCulture">en-US</xsl:param>
<!-- The transformation below provides trivial default copy of everything. -->
<xsl:template match="*|@*">
<xsl:copy>
<xsl:apply-templates select="*|@*|text()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@*">
<xsl:copy />
</xsl:template>
<!-- End of customizable area. -->
</xsl:stylesheet>