Originally Posted by rab
|
Anyone know if there is a trustee.nlm equivalent in oes linux? I saw a
metamig command in OES linux but it yields trustee file in XML format.
Anyone know of other utility that would yield similar to trustees.txt. I
have a specific need for trustees.txt. I know we should get with the times
but short term, I need something similar to trustees.txt.
TIA
|
I have the same need, but I don't know much about XML.
Here is what I discovered:
1) You can convert/copy an XML file into CSV format, but
2) You need a XSL file to translate.
If you are converting the file on the workstation-side, then you can use this dude's VBSCript
:
CodeProject: Convert XML to CSV, with XSL. Free source code and programming help
(I'm sure there is a similar perl script somewhere, if you need a server-side script)
Here is my first crack at an XSL file that converts the trustee.xml format into something similar to TRUSTEE.TXT.
I still need to figure out how to use "Replace" to put the slashes in the right direction and to take out the tree name and the typefullness in the dn - you will see what I mean when you test it out.
|
Code:
|
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="metadata">
<xsl:apply-templates select="trusteeInfo"/>
</xsl:template>
<xsl:template match="trusteeInfo">
<xsl:apply-templates select="file"/>
</xsl:template>
<xsl:template match="file">
<xsl:for-each select="trustee">
<xsl:text>"TRUSTEE"</xsl:text>
<xsl:text>,</xsl:text>
<xsl:text>"</xsl:text>
<xsl:value-of select="../path"/>
<xsl:text>"</xsl:text>
<xsl:text>,</xsl:text>
<xsl:text>"LONG"</xsl:text>
<xsl:text>,</xsl:text>
<xsl:text>"</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>"</xsl:text>
<xsl:text>,</xsl:text>
<xsl:text>"</xsl:text>
<xsl:for-each select="rights">
<xsl:value-of select="@value"/>
</xsl:for-each>
<xsl:text>"</xsl:text>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:transform> |