Avoid removal of HTML tags from XSD annotations by Xerces

13 Views Asked by At

My schema definitions contain documentation for XML authors:

<xs:element name="Value" type="xs:integer" default="0">
  <xs:annotation>
    <xs:documentation>
      What certain value ranges mean:
      <ul>
        <li>0  - 10...this</li>
        <li>11 - 37...that</li>
        <li>58 - 94...something else</li>
      </ul><br />
      Default: 0
    </xs:documentation>
  </xs:annotation>
</xs:element>

I extract this information using the Xerces type XSAnnotation and its member writeAnnotation, then finding the documentation with DOMDocument::getElementsByTagName.

When doing so, Xerces removes the HTML tags and does some basic formatting. While I am very happy that it does so in a console-based editor written with ncurses, I would like to have the HTML tags - including hyperlinks - preserved when displaying the documentation e.g. in a web view control.

I am currently porting the code from MSXML to Xerces and was surprised by this behaviour, because MSXML does not provide this service.

I know that I could extract the documentation by directly looking for it in the raw content string of xs:annotation, and I most likely will do so. However - out of curiosity - I would like to know, if I can control the formatting behaviour.

0

There are 0 best solutions below