This commit is contained in:
ninja
2025-12-15 23:22:33 +08:00
parent 019570564b
commit 8782765fbc
809 changed files with 118753 additions and 18289 deletions

View File

@@ -1,193 +1,235 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
As loading a local file with included local ressources now result in CORS errors,
one has to set up a local server to perform local testing.
To set up this local server (one of many ways), one has to be placed in the directory including all ressources,
i.e., all XML files and this associated XSL, then, run "python -m http.server", open Firefox or Chrome, and finally access
the files from http://localhost:8000.
For more information, see https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSRequestNotHttp.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" indent="yes" version="4.0"/>
<xsl:template match="Root">
<xsl:template match="ModelFile">
<html>
<head>
<script type="text/javascript">
<xsl:text>
function showHide(obj){
<xsl:text>
function showHide(obj)
{
var tbody = obj.parentNode.parentNode.parentNode.getElementsByTagName("tbody")[0];
var old = tbody.style.display;
tbody.style.display = (old == "none"?"":"none");
}
</xsl:text>
tbody.style.display = (old == "none" ? "" : "none");
}
</xsl:text>
</script>
<style type="text/css">
th{
th
{
text-align: left;
cursor: pointer;
}
table tbody tr td{
table tbody tr td
{
padding-left: 5px;
padding-right: 5px;
border-collapse: collapse;
}
table {
table
{
border-top: 3px solid grey;
border-collapse: collapse;
}
</style>
</head>
<body>
<xsl:apply-templates select="CONTAINER"/>
<xsl:apply-templates select="Container"/>
</body>
</html>
</xsl:template>
<xsl:template match="CONTAINER|CONTAINER_INTERNAL">
<xsl:apply-templates select="NODE"/>
<xsl:template match="Container|ContainerInternal">
<xsl:apply-templates select="Node"/>
</xsl:template>
<xsl:template match="TYPE">
<tr>
<th><xsl:value-of select="FEATURE/@Type_type" /></th>
<td colspan = "3">
<xsl:value-of select="FEATURE/@Value" />
</td>
</tr>
<xsl:template match="Type">
<tr>
<th>
<xsl:value-of select="Feature/@type_type"/>
</th>
<td colspan="3">
<xsl:value-of select="Feature/@Value"/>
</td>
</tr>
</xsl:template>
<xsl:template match="NODE">
<xsl:template match="Node">
<p>
<table BORDER = "2">
<xsl:for-each select="RootBaseData">
<table BORDER="2">
<xsl:for-each select="RootBase">
<thead>
<tr bgcolor="#93B6CD" style="color: white;">
<th colspan = "4" onclick="showHide(this)" ><xsl:value-of select="@m_pcName" /></th>
</tr>
<tr bgcolor="#93B6CD" style="color: white;">
<th colspan="4" onclick="showHide(this)">
<xsl:value-of select="@name"/>
</th>
</tr>
</thead>
</xsl:for-each>
<tbody style="display:none">
<xsl:apply-templates select="TYPE"/>
<xsl:apply-templates select="DATA"/>
<xsl:for-each select="SPECIFICATION/FeatureMode">
<tr>
<th>Feature mode</th>
<td>
<xsl:value-of select="@Value" />
</td>
</tr>
</xsl:for-each>
<xsl:apply-templates select="Connection"/>
<xsl:apply-templates select="FEATURE_DEFINITION"/>
<xsl:if test = "CONTAINER">
<tr>
<th>CONTAINER</th>
<td style="padding: 0px 0px 0px 0px;margin: 0px 0 0 0;">
<table BORDER = "1" width="100%">
<xsl:apply-templates select="CONTAINER"/>
</table>
</td>
</tr>
</xsl:if>
<xsl:if test = "CONTAINER_INTERNAL">
<p style="padding: 0px 0px 0px 0px;margin: 0px 0 0 0;">
<tr>
<th>CONTAINER_INTERNAL</th>
<td >
<table BORDER = "1" width="100%">
<xsl:apply-templates select="CONTAINER_INTERNAL"/>
</table>
</td>
</tr>
</p>
</xsl:if>
<tbody style="display: none">
<xsl:apply-templates select="Type"/>
<xsl:apply-templates select="Data"/>
<xsl:apply-templates select="Connection"/>
<xsl:apply-templates select="FeatureDefinition"/>
<xsl:if test="Container">
<tr>
<th>CONTAINER</th>
<td style="padding: 0px 0px 0px 0px;margin: 0px 0 0 0;">
<table BORDER="1" width="100%">
<xsl:apply-templates select="Container"/>
</table>
</td>
</tr>
</xsl:if>
<xsl:if test="ContainerInternal">
<p style="padding: 0px 0px 0px 0px;margin: 0px 0 0 0;">
<tr>
<th>CONTAINER_INTERNAL</th>
<td>
<table BORDER="1" width="100%">
<xsl:apply-templates select="ContainerInternal"/>
</table>
</td>
</tr>
</p>
</xsl:if>
</tbody>
</table>
</p>
</xsl:template>
<xsl:template match="FEATURE_DEFINITION">
<xsl:for-each select="FEATURE">
<xsl:template match="FeatureDefinition">
<xsl:for-each select="Feature">
<tr bgcolor="#CEE3F6">
<th colspan = "4" ><xsl:value-of select="@feature_definition_type" /></th>
<th colspan="4">
<xsl:value-of select="@feature_definition_type"/>
</th>
</tr>
<xsl:apply-templates select="TYPE"/>
<xsl:apply-templates select="DEFINITION"/>
<xsl:apply-templates select="DATA"/>
<xsl:apply-templates select="Type"/>
<xsl:apply-templates select="Definition"/>
<xsl:apply-templates select="Data"/>
</xsl:for-each>
</xsl:template>
<xsl:template name="data_text">
<xsl:param name="text" />
<xsl:template name="attribute_text">
<xsl:param name="text"/>
<xsl:choose>
<xsl:when test="contains($text,',,')">
<xsl:value-of select= "substring-before($text,',,')"/>
<BR/>
<xsl:call-template name="data_text"><xsl:with-param name="text" select="substring-after($text,',,')" /></xsl:call-template>
<xsl:when test="contains($text, 'xts3dx')">
<td>
<xsl:value-of select="substring-before($text, 'xts3dx')"/>
</td>
<xsl:call-template name="attribute_text">
<xsl:with-param name="text" select="substring-after($text, 'xts3dx')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of disable-output-escaping="yes" select="$text" />
<td>
<xsl:value-of select="$text"/>
</td>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="DATA">
<xsl:for-each select="FEATURE">
<xsl:template match="Data">
<xsl:for-each select="Feature">
<xsl:choose>
<xsl:when test="@data_type='value'">
<tr>
<th><xsl:value-of select = "@value_type"/></th>
<!--xsl:apply-templates select="DATA"/-->
<xsl:choose>
<xsl:when test="DATA/FEATURE/@data_type='double'">
<td colspan = "3"> <xsl:call-template name="data_text"><xsl:with-param name="text" select="DATA/FEATURE/@data" /></xsl:call-template></td>
</xsl:when>
<xsl:otherwise>
<td colspan = "3"><xsl:value-of select = "DATA/FEATURE/@data"/></td>
</xsl:otherwise>
</xsl:choose>
</tr>
<th>
<xsl:value-of select="@value_type"/>
</th>
<xsl:choose>
<xsl:when test="Data/Feature/@data_type='double'">
<td colspan="3">
<xsl:value-of select="Data/Feature/@data"/>
</td>
</xsl:when>
<xsl:otherwise>
<td colspan="3">
<xsl:value-of select="Data/Feature/@data"/>
</td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:when>
<xsl:when test="@data_type='double'">
<tr>
<xsl:if test = "@double_type != 'unknown'">
<th><xsl:value-of select = "@double_type"/></th>
<xsl:if test="@double_type != 'None'">
<th>
<xsl:value-of select="@double_type"/>
</th>
</xsl:if>
<td colspan = "3"> <xsl:call-template name="data_text"><xsl:with-param name="text" select="@data" /></xsl:call-template></td>
<td colspan="3">
<xsl:value-of select="@data"/>
</td>
</tr>
</xsl:when>
<xsl:when test="@data_type='integer'">
<tr>
<xsl:if test = "@integer_type != 'unknown'">
<th><xsl:value-of select = "@integer_type"/></th>
<xsl:if test="@integer_type != 'None'">
<th>
<xsl:value-of select = "@integer_type"/>
</th>
</xsl:if>
<xsl:if test = "@integer_type != 'boolean'">
<td colspan = "3"> <xsl:call-template name="data_text"><xsl:with-param name="text" select="@data" /></xsl:call-template></td>
</xsl:if>
<xsl:if test = "@integer_type = 'boolean'">
<xsl:if test = "@data = '0'">
<td colspan = "3"> FALSE</td>
</xsl:if>
<xsl:if test = "@data = '1'">
<td colspan = "3"> TRUE</td>
<xsl:if test="@integer_type != 'Boolean'">
<td colspan="3">
<xsl:value-of select="@data"/>
</td>
</xsl:if>
<xsl:if test="@integer_type = 'Boolean'">
<xsl:if test="@data = '0'">
<td colspan="3">FALSE</td>
</xsl:if>
<xsl:if test="@data = '1'">
<td colspan="3">TRUE</td>
</xsl:if>
</xsl:if>
</tr>
</xsl:when>
<xsl:when test="@data_type='string'">
<xsl:choose>
<xsl:when test="@string_type='unknown'">
<tr><td colspan = "3"><xsl:value-of select = "@data"/></td></tr>
</xsl:when>
<xsl:when test="@string_type='attribute'">
<xsl:when test="@string_type='None'">
<tr>
<td><xsl:value-of select= "substring-before(@data,' xts3dx ')"/></td>
<td colspan = "2"><xsl:value-of select= "substring-after(@data,' xts3dx ')"/></td>
<td colspan="3">
<xsl:value-of select="@data"/>
</td>
</tr>
</xsl:when>
<xsl:when test="@string_type='Attribute'">
<tr>
<xsl:call-template name="attribute_text">
<xsl:with-param name="text" select="@data"/>
</xsl:call-template>
</tr>
</xsl:when>
<xsl:otherwise>
<tr><th><xsl:value-of select = "@string_type"/></th></tr>
<tr><td colspan = "3"><xsl:value-of select = "@data"/></td></tr>
<tr>
<th>
<xsl:value-of select="@string_type"/>
</th>
</tr>
<tr>
<td colspan="3">
<xsl:value-of select="@data"/>
</td>
</tr>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
@@ -196,41 +238,47 @@
</xsl:template>
<xsl:template match="DEFINITION">
<xsl:for-each select="FEATURE">
<xsl:template match="Definition">
<xsl:for-each select="Feature">
<xsl:choose>
<xsl:when test="@data_type='definition'">
<tr>
<th colspan = "4" bgcolor="#E6E6E6" ><xsl:value-of select = "@definition_type"/></th>
<!-- <xsl:apply-templates select="Connection/DrawingBlock"/> -->
</tr>
<xsl:apply-templates select="TYPE"/>
<th colspan="4" bgcolor="#E6E6E6" >
<xsl:value-of select="@definition_type"/>
</th>
</tr>
<xsl:apply-templates select="Type"/>
<xsl:apply-templates select="Connection"/>
<xsl:apply-templates select="DATA"/>
<xsl:apply-templates select="DEFINITION"/>
<xsl:apply-templates select="Data"/>
<xsl:apply-templates select="Definition"/>
</xsl:when>
<xsl:when test="@data_type='definition_pattern'">
<xsl:choose>
<xsl:when test="@definition_pattern_type='InstanceStatus'">
<tr >
<th>instance status</th><td colspan="3"><xsl:value-of select = ".//@data"/></td>
<tr>
<th>Instance status</th>
<td colspan="3">
<xsl:value-of select=".//@data"/>
</td>
</tr>
</xsl:when>
<xsl:otherwise>
<tr style="padding: 0px 0px 0px 0px; border-collapse: collapse; border-spacing: 0px 0px 0px 0px;">
<td colspan = "4" style="padding: 0px 0px 0px 0px; border-collapse: collapse; ">
<table BORDER = "1" width="100%" >
<thead>
<tr >
<th colspan = "4" onclick="showHide(this)" bgcolor="#EFF5FB" ><xsl:value-of select = "@definition_pattern_type"/></th>
</tr>
</thead>
<tbody style="display:none">
<xsl:apply-templates select="TYPE"/>
<xsl:apply-templates select="Connection"/>
<xsl:apply-templates select="DATA"/>
<xsl:apply-templates select="DEFINITION"/>
</tbody>
<td colspan="4" style="padding: 0px 0px 0px 0px; border-collapse: collapse;">
<table BORDER="1" width="100%" >
<thead>
<tr>
<th colspan="4" onclick="showHide(this)" bgcolor="#EFF5FB">
<xsl:value-of select="@definition_pattern_type"/>
</th>
</tr>
</thead>
<tbody style="display:none">
<xsl:apply-templates select="Type"/>
<xsl:apply-templates select="Connection"/>
<xsl:apply-templates select="Data"/>
<xsl:apply-templates select="Definition"/>
</tbody>
</table>
</td>
</tr>
@@ -239,15 +287,17 @@
</xsl:when>
<xsl:when test="@data_type='definition_hole'">
<tr >
<td style="padding: 0px 0px 0px 0px;border-spacing: 0px;" colspan = "4">
<table BORDER = "1" width="100%">
<th colspan = "4" onclick="showHide(this)" bgcolor="#EFF5FB" ><xsl:value-of select = "@definition_hole_type"/></th>
<tr>
<td style="padding: 0px 0px 0px 0px;border-spacing: 0px;" colspan="4">
<table BORDER="1" width="100%">
<th colspan="4" onclick="showHide(this)" bgcolor="#EFF5FB">
<xsl:value-of select="@definition_hole_type"/>
</th>
<tbody style="display:none">
<xsl:apply-templates select="TYPE"/>
<xsl:apply-templates select="Type"/>
<xsl:apply-templates select="Connection"/>
<xsl:apply-templates select="DATA"/>
<xsl:apply-templates select="DEFINITION"/>
<xsl:apply-templates select="Data"/>
<xsl:apply-templates select="Definition"/>
</tbody>
</table>
</td>
@@ -255,15 +305,17 @@
</xsl:when>
<xsl:when test="@data_type='definition_thread'">
<tr >
<td style="padding: 0px 0px 0px 0px;border-spacing: 0px;" colspan = "4">
<table BORDER = "1" width="100%">
<th colspan = "4" onclick="showHide(this)" bgcolor="#EFF5FB" ><xsl:value-of select = "@definition_thread_type"/></th>
<tr>
<td style="padding: 0px 0px 0px 0px;border-spacing: 0px;" colspan="4">
<table BORDER="1" width="100%">
<th colspan="4" onclick="showHide(this)" bgcolor="#EFF5FB">
<xsl:value-of select="@definition_thread_type"/>
</th>
<tbody style="display:none">
<xsl:apply-templates select="TYPE"/>
<xsl:apply-templates select="Type"/>
<xsl:apply-templates select="Connection"/>
<xsl:apply-templates select="DATA"/>
<xsl:apply-templates select="DEFINITION"/>
<xsl:apply-templates select="Data"/>
<xsl:apply-templates select="Definition"/>
</tbody>
</table>
</td>
@@ -273,81 +325,135 @@
</xsl:for-each>
</xsl:template>
<!-- connection -->
<xsl:template match="Connection">
<tr bgcolor="#F5F6CE">
<th >Link</th>
<td> <xsl:value-of select= "@Type"/></td>
<xsl:apply-templates select="RootBaseData"/>
<xsl:apply-templates select="DrawingBlock/RootBaseData"/>
<xsl:apply-templates select="ReferenceOnTopology"/>
<xsl:apply-templates select="A3DFRMFeatureLinkedItemConnector"/>
<th>Link</th>
<td colspan="2">
<xsl:value-of select="@Type"/>
</td>
</tr>
<xsl:apply-templates select="RootBase"/>
<tr style="padding: 0px 0px 0px 0px; border-collapse: collapse; border-spacing: 0px 0px 0px 0px;">
<td colspan="2" style="padding: 0px 0px 0px 0px; border-collapse: collapse;">
<xsl:apply-templates select="DrawingBlock"/>
</td>
</tr>
<tr style="padding: 0px 0px 0px 0px; border-collapse: collapse; border-spacing: 0px 0px 0px 0px;">
<td colspan="2" style="padding: 0px 0px 0px 0px; border-collapse: collapse;">
<xsl:apply-templates select="ReferenceOnTopology|ReferenceOnTessellation"/>
</td>
</tr>
</xsl:template>
<xsl:template match="A3DFRMFeatureLinkedItemConnector">
<td>
error
</td>
<td>
<xsl:value-of select= "@error"/>
</td>
</xsl:template>
<xsl:template match="DrawingBlock">
<td colspan = "2">DrawingBlock</td>
<!--tr >
<th colspan = "2">Entities</th>
</tr>
<tr>
<td>count</td>
<td>
<xsl:value-of select= "@Entity_count"/>
</td>
</tr>
<tr>
<td>markup_count</td>
<td>
<xsl:value-of select= "@Markup_count"/>
</td>
</tr>
<tr>
<td>subblock_count</td>
<td>
<xsl:value-of select= "@SubBlock_count"/>
</td-->
<table BORDER="1" width="100%">
<thead>
<tr>
<th colspan="2" onclick="showHide(this)" bgcolor="#EFF5FB" >DrawingBlock</th>
</tr>
</thead>
<tbody style="display:none">
<tr>
<xsl:apply-templates select="RootBase"/>
</tr>
<tr>
<td>Entities</td>
<td>
<xsl:value-of select="@nb_entities"/>
</td>
</tr>
<tr>
<td>Markups</td>
<td>
<xsl:value-of select="@nb_markups"/>
</td>
</tr>
<tr>
<td>Drawing blocks</td>
<td>
<xsl:value-of select="@nb_drawing_blocks"/>
</td>
</tr>
<xsl:if test="@nb_drawing_blocks != 0">
<tr style="padding: 0px 0px 0px 0px; border-collapse: collapse; border-spacing: 0px 0px 0px 0px;">
<td>Children</td>
<td colspan="2" style="padding: 0px 0px 0px 0px; border-collapse: collapse;">
<xsl:apply-templates select="DrawingBlock"/>
</td>
</tr>
</xsl:if>
</tbody>
</table>
</xsl:template>
<xsl:template match="ReferenceOnTopology">
<td>
<xsl:value-of select= "@topotype"/>
</td>
<td>
<xsl:value-of select= "face_indexes/@indexes"/>
</td>
<xsl:template match="ReferenceOnTopology|ReferenceOnTessellation">
<table BORDER="1" width="100%">
<thead>
<tr>
<th colspan="2" onclick="showHide(this)" bgcolor="#EFF5FB" >
<xsl:value-of select="@topo_type"/>
</th>
</tr>
</thead>
<tbody style="display:none">
<xsl:if test="@topo_type = 'Face'">
<td>Indexes</td>
<td>
<xsl:value-of select="@indexes"/>
</td>
</xsl:if>
<xsl:if test="@topo_type = 'Edge' or @topo_type = 'CoEdge'">
<xsl:for-each select="Edge">
<tr>
<td>Indexes</td>
<td>
<xsl:value-of select="@indexes"/>
</td>
</tr>
</xsl:for-each>
</xsl:if>
<xsl:if test="@topo_type = 'UniqueVertex' or @topo_type = 'MultipleVertex'">
<xsl:for-each select="Vertex">
<tr>
<td>Indexes</td>
<td>
<xsl:value-of select="@indexes"/>
</td>
</tr>
</xsl:for-each>
</xsl:if>
</tbody>
</table>
</xsl:template>
<xsl:template match="RootBaseData">
<xsl:if test = "@m_pcName">
<td>
<xsl:value-of select= "@m_pcName"/>
</td>
<td>
<xsl:value-of select= "@m_uiPersistentId"/>
</td>
</xsl:if>
<xsl:if test = "Connection/DrawingBlock">
<td>
<xsl:value-of select= "Connection/DrawingBlock/RootBaseData/@m_pcName"/>
</td>
<xsl:template match="RootBase">
<xsl:choose>
<xsl:when test="not(@name) and @persistent_id = 0">
<!-- Do nothing -->
</xsl:when>
<xsl:when test="@name">
<td>
<xsl:value-of select= "Connection/DrawingBlock/RootBaseData/@m_uiPersistentId"/>
<xsl:value-of select="@name"/>
</td>
</xsl:if>
<td>
Persistent id:
<xsl:value-of select="@persistent_id"/>
</td>
</xsl:when>
<xsl:otherwise>
<td>
Empty name
</td>
<td>
Persistent id:
<xsl:value-of select="@persistent_id"/>
</td>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>