Forum Discussion

irach15's avatar
irach15
Maven
9 years ago

XML file as post or Article

Is it any way to post XML file as Article or any way around?

For example,

I need to convert XML file to table and post it as Article

 

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="test_xml.xsl"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies,
an evil sorceress, and her own childhood to become queen
of the world.</description>
</book>
<book id="bk103">
<author>Corets, Eva</author>
<title>Maeve Ascendant</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-11-17</publish_date>
<description>After the collapse of a nanotechnology
society in England, the young survivors lay the
foundation for a new society.</description>
</book>
<book id="bk104">
<author>Corets, Eva</author>
<title>Oberon's Legacy</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2001-03-10</publish_date>
<description>In post-apocalypse England, the mysterious
agent known only as Oberon helps to create a new life
for the inhabitants of London. Sequel to Maeve
Ascendant.</description>
</book>

</catalog>

 

I uploaded a conversion file test_xml.xsl to Studio.

However, when I try to post XML file directly to Article body, it goes as plain content and all top code is commented out.

<!--- <?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="test_xml.xsl"?>---->

 

Is it any way around it to have a table as XML converted file?

Help appreciated.

  • irach15- Did you mean to post the XML on the article? If yes, why are you uploading it in studio?

     

    On the rich text editor, you can use the code block as below.

     

    Code goes here

     

     

    I hope this helps.

    • irach15's avatar
      irach15
      Maven

      VarunGrazitti,

      what did you mean by saying 'code goes here', where?

      ...................................

      xsl file needs to be uploaded to Studio as a template to format xml file to look as html table.

      And yes, when you post xml file directly as Article, the formatting code is stripped out.

      Try it.

      The question is How to prevent the code to look exactly as formatted or any way around to post XML file as a html table to post or Article.

      Thank you.