Display of XMLPI and XMLNS

Having trouble installing Oxygen? Got a bug to report? Post it all here.
juliovaz
Posts: 14
Joined: Mon Feb 03, 2014 4:45 pm

Display of XMLPI and XMLNS

Post by juliovaz »

Hi,

Using oXygen 18.0 with the bundled OT and processing through either HTML and PDF, these format as differently from standard text but there's no identifying marks. For example, I would expect XMLPI to display with <? ?> around the text and XMLNS with xmlns: before the text. Is this an OT bug or something missing from the oXygen implementation?

Thanks.
Radu
Posts: 9449
Joined: Fri Jul 09, 2004 5:18 pm

Re: Display of XMLPI and XMLNS

Post by Radu »

Hi Julio,

Are you using custom processing instructions or are you referring to the ones added by Oxygen when change tracking is enabled or when you add comments to the topics?
Usually the XSLT stylesheets which output the HTML and PDF do nothing special with processing instructions and they are not displayed in the output content.
Recently (in Oxygen 18.0) for our WebHelp-based outputs we added a special parameter called webhelp.show.changes.and.comments which can be used to show Oxygen comments and changes (saved as processing instructions in the XML) in the HTML output.
If you want to take a peek at how we do this, the XSLT stylesheets are here:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT2.x\plugins\com.oxygenxml.webhelp\xsl\review

Basically the stylesheets first match the processing instructions and generate custom elements for them. Then we have other templates which generate corresponding HTML elements for each PI.

About the XMLNS question I'm not sure what you mean. How does it look like in the DITA content? Is it a namespace declaration?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
juliovaz
Posts: 14
Joined: Mon Feb 03, 2014 4:45 pm

Re: Display of XMLPI and XMLNS

Post by juliovaz »

Hi Radu,

I think you misunderstand what I'm talking about. If in your DITA source you have <xmlpi>some_pi</xmlns>, the spec states that the content should be surrounded by <? ?> so the result should be <? some_pi ?>. This is not happening and I'm wondering if it's an OT bug or something in an oXygen override. As for <xmlns>, the spec isn't as concise on how that should display but I would expect <xmlns>some_namespace</xmlns> to display as something like xmlns:some_namespace.

Thanks.
juliovaz
Posts: 14
Joined: Mon Feb 03, 2014 4:45 pm

Re: Display of XMLPI and XMLNS

Post by juliovaz »

juliovaz wrote:Hi Radu,

I think you misunderstand what I'm talking about. If in your DITA source you have <xmlpi>some_pi</xmlns>, the spec states that the content should be surrounded by <? ?> so the result should be <? some_pi ?>. This is not happening and I'm wondering if it's an OT bug or something in an oXygen override. As for <xmlns>, the spec isn't as concise on how that should display but I would expect <xmlns>some_namespace</xmlns> to display as something like xmlns:some_namespace.

Thanks.
BTW, I meant the xmlnsname element. Sorry about that. It looks like the xmlpi display problem may be an OT bug.
Radu
Posts: 9449
Joined: Fri Jul 09, 2004 5:18 pm

Re: Display of XMLPI and XMLNS

Post by Radu »

Hi Julio,

Right, I originally though you meant plain XML processing-instructions when you actually meant the new elements from the XML markup domain.
This is the DITA Open Toolkit issue when some support was added for the new XML domain:

https://github.com/dita-ot/dita-ot/issues/1652

The XSLT template which does that for the HTML-based outputs is located in:

DITA-OT2.x/plugins/org.dita.xhtml/xsl/xslhtml/xml-d.xsl

and does something like:

Code: Select all

  <xsl:template match="*[contains(@class, ' xml-d/xmlpi ')]">
<code>
<xsl:call-template name="commonattributes"/>
<xsl:apply-templates/>
</code>
</xsl:template>
The similar XSLT template which produces the XSL-FO does something like:

Code: Select all

  <xsl:template match="*[contains(@class, ' xml-d/xmlpi ')]" priority="10">
<fo:inline font-size="90%" font-family="Monospaced">
<xsl:apply-templates/>
</fo:inline>
</xsl:template>
It's a pity the specs states nothing about how the element should looked like when published but as long as the "xmlelement" was surrounded with angled brackets when publishing, in my opinion the xmlpi should also get rendered surrounded by <? and ?>.
So maybe you could add an issue on the DITA OT issues list about this.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply