Skip to Content
0

diplaying data xml in webi cells

Oct 24, 2016 at 01:34 PM

142

avatar image
Former Member

Hi everybody,

On webi 4.1, I have "xml data" on a cell (table or cell).

And I want to format there data...

There data are on declared with

<?xml version="1.0" encoding="UTF-8"?><article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:html="http://www.w3.org/1999/xhtml" version="5.0">

I'm thinking to use the html mode of the cell to show the data but I need to use a parser I think... or perhaps concat data with a "CSS" string Any ideas on the best way to do it ?

Here a data sample :

<?xml version="1.0" encoding="UTF-8"?><article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:html="http://www.w3.org/1999/xhtml" version="5.0"><para>First sentence</para><para>Second sentence</para></article>

(hope my tags are ok)

I'm waiting for your experience on that thing...

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

AMIT KUMAR
Oct 25, 2016 at 12:14 PM
0

are you looking what i have mentioned in screenshot?

If yes then copy the code in blank cell and right click on the cell-> read content as "HTML".

untitled.png


untitled.png (11.1 kB)
Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Nov 15, 2016 at 08:53 AM
0

Hi Amit thx for your answer,

I played with the HTML flag a long time before :) and when I use it, no style is applied on my data since is xml and not a html (no breakline,no bold...). What I was searched it was how format this data with a CSS or xml sheet... hard to find one online.

I tried many ways to do that thing :

First try (used the replace function):

 =Replace(
  Replace(
  Replace(
  Replace(
        [My_xmlbook_string];
        "<para>";"<div style='width:95%;height:auto;border:1px solid #ff0000;padding:1px;white-space: normal;text-align:justify'>");
        "</para>";"</div>");
        "<?xml version=\"1.0\" encoding=\"UTF-8\"?><article xmlns=\"http://docbook.org/ns/docbook\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:html=\"http://www.w3.org/1999/xhtml\" version=\"5.0\">";"");
        "</article>";"")

Work like a parser but no easy to maintain.

Second try (encapsuled idea):

="<style> para{ display: block }
     emphasis { display: inline; font-style: italic; }
     emphasis emphasis { display: inline; font-style: upright; }
  </style><div style='width:99%;height:auto;border:1px solid #ff0000;padding:1px;white-space: normal;text-align:justify'>"
 + [My_xmlbook_string]
+"</div>"

Work in a way but didn't satisfy me.

Seems to be difficult to BO cell with html flag to understand what I want ...

Since the lenght in the content is very variable, the cell auto-size doesn't work well.

More..., when you use this html flag, the content didn't show in generated pdf and in the data are in xml in a generated spreadsheet...

Looks like I'm at the limit ... probably the best way is to parse the content directly on the database (in a way or an another)

Best regards

Gerald.

Share
10 |10000 characters needed characters left characters exceeded