Skip to content
Permalink
Browse files

Doc / Build standards doc based on schema plugins. (#4221)

  • Loading branch information
fxprunayre committed Nov 28, 2019
1 parent b17439a commit e23568882ccb212ef1afe28d8e12de61d521b801
@@ -43,6 +43,52 @@
</licenses>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<version>1.0.1</version>
<dependencies>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>saxon</artifactId>
<version>8.7</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.8</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>transform</goal>
</goals>
<configuration>
<forceCreation>true</forceCreation>
<transformationSets>
<transformationSet>
<dir>../../schemas/</dir>
<stylesheet>src/main/resources/config-editor-doc.xsl</stylesheet>
<outputDir>../manuals/source/customizing-application/editor-ui</outputDir>
<includes>
<include>config-editor.xsd</include>
</includes>
<fileMappers>
<fileMapper
implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper">
<pattern>config-editor\.xsd$</pattern>
<replacement>creating-custom-editor.rst</replacement>
</fileMapper>
</fileMappers>
</transformationSet>
</transformationSets>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>com.soebes.maven.plugins</groupId>
<artifactId>iterator-maven-plugin</artifactId>
@@ -56,6 +102,7 @@
<configuration>
<items>
<!-- Define the schema to generate the documentation for. -->
<item>iso19115-3.2018</item>
<item>iso19139</item>
<item>iso19110</item>
<item>dublin-core</item>
@@ -175,13 +222,13 @@
<resource>
<directory>../../schemas/@item@/doc/en</directory>
<filtering>false</filtering>
<targetPath>en/standards</targetPath>
<targetPath>source/annexes/standards</targetPath>
</resource>
</resources>
<overwrite>true</overwrite>
</configuration>
</pluginExecutor>
<pluginExecutor>
<!--<pluginExecutor>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
@@ -199,7 +246,7 @@
</resources>
<overwrite>true</overwrite>
</configuration>
</pluginExecutor>
</pluginExecutor>-->
</pluginExecutors>
</configuration>
</execution>
File renamed without changes.
@@ -70,8 +70,8 @@
<hiddenInEditMode>Those values are defined in the standard but hidden when editing.
</hiddenInEditMode>
<instruction>Instruction</instruction>
<nbOfViews>This standard can be encoded using</nbOfViews>
<views>view(s).</views>
<nbOfViews>This standard can be encoded using </nbOfViews>
<views> view(s).</views>
<context>Context</context>
</eng>
<fre>
@@ -92,7 +92,8 @@
<xsl:value-of select="gndoc:writeln(concat($schemaTitle, ' (', $schema, ')'), '#')"/>

<xsl:value-of select="gndoc:nl(2)"/>
<xsl:value-of select="gndoc:writeln($schemaDesc)"/>
<xsl:copy-of select="$schemaDesc"/>
<!-- <xsl:value-of select="gndoc:writeln($schemaDesc)"/>-->
<xsl:value-of select="gndoc:nl(2)"/>
<xsl:value-of select="gndoc:writeln(concat($t/schema-url, $schemaUrl))"/>
<xsl:value-of select="gndoc:nl(2)"/>
@@ -295,21 +295,23 @@

<xsl:text>&#xA;</xsl:text>.. code-block:: xml
<xsl:value-of select="gndoc:nl(2)"/>
<xsl:variable name="text"
select="saxon:serialize($code, 'default-serialize-mode')"/>
<xsl:for-each select="tokenize($text, '\n')">
<xsl:choose>
<!-- Strip namespaces -->
<xsl:when test="matches(normalize-space(.), '^xmlns:.*&quot;$')">
<!--<xsl:if test="position() = 2"><xsl:text> </xsl:text>...<xsl:text>&#xA;</xsl:text></xsl:if>-->
</xsl:when>
<xsl:otherwise>
<xsl:text> </xsl:text><xsl:value-of select="."/><xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:for-each select="$code">
<xsl:variable name="text"
select="saxon:serialize(., 'default-serialize-mode')"/>
<xsl:for-each select="tokenize($text, '\n')">
<xsl:choose>
<!-- Strip namespaces -->
<xsl:when test="matches(normalize-space(.), '^xmlns:.*&quot;$')">
<!--<xsl:if test="position() = 2"><xsl:text> </xsl:text>...<xsl:text>&#xA;</xsl:text></xsl:if>-->
</xsl:when>
<xsl:otherwise>
<xsl:text> </xsl:text><xsl:value-of select="."/><xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>

</xsl:for-each>
<xsl:value-of select="gndoc:nl(2)"/>
</xsl:for-each>
<xsl:value-of select="gndoc:nl(2)"/>
</xsl:function>


0 comments on commit e235688

Please sign in to comment.
You can’t perform that action at this time.