Is there a way to get an XML Report or List of Rules for Rule Sets from Import Surface Advanced? I am using InRoads version 08.11.07.428
There are sample XML reports that act on XIN files. With effort, it should be possible to create a report on the settings within a rule set.
Charles (Chuck) Rheault CADD Manager
MDOT State Highway Administration
I only want to extract one item, the 'name' of each rule.
I've searched for help on Style Sheet editing but have not had much luck. I saw a link to videos but we are blocked from watching youtube videos.
Do you think I would get better luck if I place this thread in another forum?
Well, XML reports are based upon XSLT transformations, so looking on XML and XMLT forums might help, but the people who know InRoads and its XIN files are here, so...
Pasted below is a report I created that lists all commands and their preferences in the XIN file. It reads the names as stored - all commands are in the format of "someCommandNameCollection" and then "someCommandName" and under that will be one or more ItemName that is equal to the Preference name. I do not know if I have any XIN files with rules for advanced surface import so I cannot tell you what this report will produce with one that does have them. I purposely forced this report to skip over the named symboloy and two feature style collections. To report on only one command, it should be possible to modify my code to only return the ImportRuleSetCollection. Change my line:
<xsl:if test="(name() != 'NamedSymbologyCollection') and (name() !='FeatureStyleCollection') and (name() !='FeatureCategoryCollection')">to
<xsl:if test="(name() = 'ImportRuleSetCollection')">However, to get each rule you will need to bore down one level deeper to read each "Rule" and its Name attribute. HTH
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:inr="http://mycompany.com/mynamespace"> <xsl:include href="../format.xsl"/> <xsl:param name="xslRootDirectory" select="inr:xslRootDirectory"/> <!-- Named Symbologies Use Report --> <xsl:template match="/"> <xsl:variable name="gridOut" select="inr:SetGridOut(number(InRoads/@outputGridScaleFactor))"/> <html> <head> <link rel="stylesheet" type="text/css" href="{$xslRootDirectory}/_Themes/engineer/theme.css"/> <!-- Title displayed in browser Title Bar --> <title lang="en">Command Preference Listing Report</title> </head> <body> <xsl:choose> <xsl:when test="$xslShowHelp = 'true'"> <xsl:call-template name="StyleSheetHelp"/> </xsl:when> <xsl:otherwise> <xsl:for-each select="CivilIni"> <center> <!-- Report Title --> <h2 lang="en">Command Preference Listing Report</h2> <p lang="en"> <xsl:if test="./@Filename"> <xsl:value-of select="./@Filename"/><br/> </xsl:if> Report Created:  <xsl:value-of select="inr:date()"/> <br/> Time:  <xsl:value-of select="inr:time()"/> </p> </center> <hr/> <table class="margin" cellpadding="1" cellspacing="2" width="90%"> <thead style="display:table-header-group"> <tr> <th class="underline" lang="en">Command Name (within XIN )</th> <th class="underline" lang="en">InRoads Command Name</th> <th class="underline" lang="en">Preference Name</th> </tr> </thead> <tbody> <xsl:for-each select = "*" > <xsl:call-template name='Commands' /> </xsl:for-each> </tbody> </table> </xsl:for-each> </xsl:otherwise> </xsl:choose> </body> </html> </xsl:template> <xsl:template name="Commands"> <xsl:for-each select="."> <xsl:sort select="name()"/> <xsl:if test="(name() != 'NamedSymbologyCollection') and (name() !='FeatureStyleCollection') and (name() !='FeatureCategoryCollection')"> <tr> <td valign="top" align="left"> <xsl:value-of select="name()"/> </td> <td valign="top" align="left"> <xsl:value-of select="substring(name(), 1, string-length(name())-10)"/> </td> <td align="left"> <xsl:call-template name='Preferences' /> </td> </tr> </xsl:if> </xsl:for-each> </xsl:template> <xsl:template name="Preferences"> <xsl:for-each select="*[@ItemName]"> <xsl:sort select="@ItemName"/> <xsl:value-of select="@ItemName"/> <xsl:if test="position() != last()"> <br/> </xsl:if> </xsl:for-each> </xsl:template> <xsl:template name="StyleSheetHelp"> <div class="section1"> <h4 lang="en">Notes</h4> <p class="normal1" lang="en"> You must open a Preferences file by selecting <em>File > Open</em> on the <em>Report Browser</em> menu and setting the <em>Files of type</em> field to <em>Preferences (*.xin)</em>. </p> <p class="normal1" lang="en"> This report lists all Named Preferences saved for a particular command. The Command names listed are as they are defined internally to InRoads and its XIN file, not as they may be listed in the program's interface, menus and dialog boxes. </p> <p class="small" lang="en"> <em>© 2006 Bentley Systems, Inc.<br/> © 2010 AB Consultants, Inc.</em> </p> </div> </xsl:template></xsl:stylesheet>
Thanks, this is greatly appreciated but I must be doing something wrong.
First, I ran this script, without any editing, on the Bentley provided civil.xin file and I got an error message saying 'The system cannot locate the object specified'.
So then I made the edits that you suggested then ran it on our .xin file and I got the same error message.
I apologize for my inexperience but it seems I am missing something simple. Any suggestions?
Where did you place the file? It need to go in one of the subfolders of the XIN reports. There is an XIN folder, if you place it there it should work. The report is looking for a file called format.xsl that it expects to be in the parent folder of the file. The standard root/parent folder for reports is "XML Data"