Formatted XSD Annotation Documentation

This should cover W3C XML Schema, Relax NG and DTD related problems.
cahlander
Posts: 1
Joined: Tue Jun 25, 2024 5:10 pm

Formatted XSD Annotation Documentation

Post by cahlander »

I am using the documentation tag within my XSDs to document the structure of my information. I would like for my documentation to have formatted output in order for me being able to put more detail within the documentation. I found the ability to generate formatted output in generating HTML, but if I switch it to generating PDF, then the documentation shows the tags. Is there a universal way of being able to generate formatted output on the documentation?

Here is my sample of what works for HTML output, but not PDF. It kind of works for DocBook output.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    targetNamespace="http://www.w3.org/XML/1998/namespace">
    <xs:attribute
        name="id"
        type="xs:NCName">
        <xs:annotation>
            <xs:documentation>
                <token>
                    <div>
                        <div>
                            <span>The unique identifiers within Magelllan (with the exception of line-of-business are generated using the ULID creator at:</span>
                            <a href="https://github.com/f4b6a3/ulid-creator">https://github.com/f4b6a3/ulid-creator</a>
                            <br/>
                            <span>In java, then ULID is generated be calling</span>
                            <br/>
                            <pre style="background-color:LightGray;">UlidCreator.getUlid().toString()</pre>
                            <br/>
                        </div>
                        <div>
                            <div>In XQuery, the ULID is generated by calling</div>
                            <br/>
                            <pre style="background-color:LightGray;">xquery version "3.1";

import module namespace altid = "https://exist-db.org/xquery/altid" at "java:org.exist.altid.AltIDModule";

altid:ulid()
</pre>
                        </div>
                        <br/>
                        <table style="width:200px;" class="rt">
                            <tr>
                                <th>Prefix</th>
                                <th>Description</th>
                            </tr>
                            <tr>
                                <td>G</td>
                                <td>Access Group</td>
                            </tr>
                            <tr>
                                <td>S</td>
                                <td>Schema</td>
                            </tr>
                            <tr>
                                <td>E</td>
                                <td>Entity</td>
                            </tr>
                            <tr>
                                <td>A</td>
                                <td>Attribute</td>
                            </tr>
                            <tr>
                                <td>M</td>
                                <td>Mapping</td>
                            </tr>
                        </table>
                    </div>
                </token>
            </xs:documentation>
        </xs:annotation>
        
    </xs:attribute>
</xs:schema>
alex_jitianu
Posts: 1011
Joined: Wed Nov 16, 2005 11:11 am

Re: Formatted XSD Annotation Documentation

Post by alex_jitianu »

Hello,
Unfortunately, we don't have a solution for rendering HTML annotations into the PDF output. If you are generating the documentation into Docbook format, the annotations are still kept in HTML format but the Author mode knows how to render them. When we generate PDF we are actually passing through Docbook as an intermediate format. A possible workaround would be to:
- generate the documentation into Dockbook
- create an XSLT file to convert the HTML subset you are using to Docbook and apply it on the previously generated file
- open the Docbook in Oxygen and transform it to PDF.

Best regards,
Alex
Post Reply