0

I have a question about the CDATA format.

Is it possible to switch with standard XSLT 1.0 functionality a special CDATA format an identity to a XML Element with Attribute format? Or is there may be a standard XSLT-file for this case?

<TABLE Type="XY_PAIR">
  <![CDATA[
   |  XI    YI  |
      0.0   0.0
      10.0  1.0
  ]]>
</TABLE>

Transform with XSLT 1.0 standard functionality to

<XY_PAIR XI="0.0" YI="0.0"/>
<XY_PAIR XI="10.0" YI="1.0"/>

Thanks for your help!

Tomalak
  • 322,446
  • 66
  • 504
  • 612
Görgen
  • 55
  • 4
  • Possible duplicate of [How to convert .csv file to xml using XSLT 1.0?](https://stackoverflow.com/questions/26965790/how-to-convert-csv-file-to-xml-using-xslt-1-0) (basically the answer is no) or, if XSLT 2 is an option, https://stackoverflow.com/questions/29295377/xslt-2-0-to-convert-csv-to-xml-format (you can convert column data to XML in XSLT 2) – Pete Kirkham Oct 22 '19 at 14:57
  • First of all, the answer is yes, it is possible. However, it will take some work. And it's not clear from your question how flexible this needs to be. If you don't know in advance the format of the table, it will take even more work. Which XSLT 1.0 processor will you be using? Things will be easier if it supports some extension functions, e.g. `tokenize()`. – michael.hor257k Oct 22 '19 at 15:07

0 Answers0