Notices


 
 
LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 20-Oct-2009, 09:50 PM
superjoe's Avatar
Junior Member
 
Join Date: May 2008
Location: Dallas / Fort Worth, Texas
Posts: 23
superjoe 0 reputation points
Default Re: trustee.nlm on oes linux

Originally Posted by rab View Post
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>
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -6. The time now is 11:44 AM.


© 2007 Novell, Inc. All Rights Reserved.

Search Engine Friendly URLs by vBSEO 3.3.0 RC2