html String from Xml in Xlst

W

WStoreyII

Hello,

I have a cgi program made in c which will output xml that I have
obtained from a mysql database. I have the xml output setup to be
transformed by blog.xsl in the header of the xml output.

My problem is that one of the element of the xml will be a element
called article
which will contain a text string that has html tags from the msyql
database. what i want is that in the xsl it slaps the article element
in to a div then the formating should be done by the tags in the
string.

for some reason though this does not work.

if you need to see the file let me know.

Thanks for the help.

WStoreyII
 
W

WStoreyII

i forgot to mention that in the output it reads the tags becuase it
does not print them but it does not render the data according to the
tag.

so maybe it is a browser setting.
i am using firefox if that helps.
 
M

Malte

WStoreyII said:
Hello,

I have a cgi program made in c which will output xml that I have
obtained from a mysql database. I have the xml output setup to be
transformed by blog.xsl in the header of the xml output.

My problem is that one of the element of the xml will be a element
called article
which will contain a text string that has html tags from the msyql
database. what i want is that in the xsl it slaps the article element
in to a div then the formating should be done by the tags in the
string.

for some reason though this does not work.

if you need to see the file let me know.

Thanks for the help.

WStoreyII
CDATA?
 
W

WStoreyII

could you maybe explain more about cdata and how that would help or how
i need
to implement it to get what i want.
 
M

Malte

WStoreyII said:
could you maybe explain more about cdata and how that would help or how
i need
to implement it to get what i want.

Well, you did not say, exactly what or why it did not work. I assumed
that the XSL processor complained about (possibly) not welformed tags in
the xml. In a similar application we had the xsl template for the tag,
the article tag in your case, wrap a <![CDATA[ ]]> around the offending
text. This is how we were able to take all sorts of javascript and pass
through to the browser.
 
W

WStoreyII

thank you for the help,

i tried that and now it just shows the tags and text as a string.
before it was not showing the tags just the text but it was not parsing
the tags.
i hope that makes sense.
 
P

Peter Flynn

WStoreyII said:
Hello,

I have a cgi program made in c which will output xml that I have
obtained from a mysql database. I have the xml output setup to be
transformed by blog.xsl in the header of the xml output.

My problem is that one of the element of the xml will be a element
called article
which will contain a text string that has html tags from the msyql
database. what i want is that in the xsl it slaps the article element
in to a div then the formating should be done by the tags in the
string.

for some reason though this does not work.

At a guess because the embedded markup is not well-formed (eg corrupt,
non-HTML, or just uses mismatched case, or missing end-tags). If the
data owner wants XML output, then the input must be clean to start with.

///Peter
 
P

Peter Flynn

WStoreyII said:
thank you for the help,

i tried that and now it just shows the tags and text as a string.
before it was not showing the tags just the text but it was not parsing
the tags.
i hope that makes sense.

Using CDATA is usually wrong in these circumstances.
Fixing the data so that it is correct is usually a better approach.

///Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top