You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using jcabi-xml to perform XML -> HTML conversion using XSLT files. The issue, that we have noticed is that -
The original formatting of the XML is altered (whitespaces included in between each tag) and therefore the resultant HTML conversion using XSLT files results in unnecessary whitespaces in the documentation.
Questions -
Is that the expected behavior?
If yes, is there a configuration to preserve the original whitespace/formatting such that the resultant HTML Conversion does not differ from the XML document?
Following are some code snippets being used -
General flow of XML to HTML Conversion -
public String convertToHtml(String xsltString, String xmlString) {
XSLDocument xsltDocument = new XSLDocument(xsltString);
XMLDocument xmlDocument = new XMLDocument(xmlString);
return xsltDocument.applyTo(xmlDocument);
}
Sample XML in string format -
<p>Copy the value: XYZ_<ph id="id1"><varname id="id2">dynamicText</varname></ph>_SUFFIX123 in the System tab</p>
The XML document when deserialized into XMLDocument object -
<p> Copy the value: XYZ_ <ph id="id1"><varname id="id2"> dynamicText </varname></ph> _SUFFIX123 in the System tab </p>
As you can see, there are extra spaces added in the XMLDocument object's content.
The XSLDocument (XSLT) object's cotnent also has the same issues i.e. extra whitespaces and line breaks added.
A section in XSLT that performs the transformation of the varname section -
Hi,
We are using
jcabi-xml
to perform XML -> HTML conversion using XSLT files. The issue, that we have noticed is that -The original formatting of the XML is altered (whitespaces included in between each tag) and therefore the resultant HTML conversion using XSLT files results in unnecessary whitespaces in the documentation.
Questions -
Following are some code snippets being used -
XMLDocument
object -As you can see, there are extra spaces added in the
XMLDocument
object's content.XSLDocument
(XSLT) object's cotnent also has the same issues i.e. extra whitespaces and line breaks added.A section in XSLT that performs the transformation of the
varname
section -appliedTo()
, the resultant HTML also has extra spaces.This affects our use cases which end up having unncessary spaces.
Example -
Copy the value: XYZ_ dynamicText _SUFFIX123 in the System tab
instead of
Copy the value: XYZ_dynamicText_SUFFIX123 in the System tab
If you can provide insights on how to deal with the content changes, it'll be really helpful.
Thanks in advance.
The text was updated successfully, but these errors were encountered: