Home > OS >  Output is not displaying in HTML format after transforming the xml result using xslt when the attrib
Output is not displaying in HTML format after transforming the xml result using xslt when the attrib

Time:11-24

My xml has just 1 value as name =RDXXX-LOWER_DECK, value=10 mm. When this is transformed using xslt I get output correctly as below:

 <table>
 <tr valign="top">
 <td width="200">RDXXX-LOWER_DECK</td>
 <td width="200">10.000000000000 mm</td>
 </tr>
 </table>

But when I replace RDXXX-LOWER_DECK as RDXXX||LOWER_DECK (hyphen is replaced with double pipe) I don't get the output. Empty value is printed and name is printed as "Attribute" .

 <table>
 <tr valign="top">
 <td width="200">Attribute</td>
 <td width="200"></td>
 </tr>
 </table>

KIndly let me know how to retain || in the output.

CodePudding user response:

My xml has just 1 value as name =RDXXX-LOWER_DECK, value=10 mm.
But when I replace RDXXX-LOWER_DECK as RDXXX||LOWER_DECK (hyphen is replaced with double pipe)...

If by that you mean that you have an XML like this:

<RDXXX-LOWER_DECK>10mm</RDXXX-LOWER_DECK>

and you changed it to look like this:

<RDXXX||LOWER_DECK>10mm</RDXXX||LOWER_DECK>

then you no longer have a well-formed XML document. The | character is not allowed in an element name.

... I don't get the output. Empty value is printed and name is printed as "Attribute" .

That is strange, because you should have been getting an error.

  • Related