Re: [xslt] Re: Transforming RSS (")
- From: Andrew Shafer <shafer realmsys com>
- To: The Gnome XSLT library mailing-list <xslt gnome org>
- Subject: Re: [xslt] Re: Transforming RSS (&quot;)
- Date: Tue, 13 Dec 2005 10:06:00 -0700
> >
> > I am playing around with building an RSS reader.
> >
> > I get the xml
>
> from where?
>From anywhere, but I first noticed the issue coming from
http://www.nba.com/rss/nba_rss.xml
> >and use xsl templates to create html.
> >
> > A problem is people often put " into the <description> tag, so at
> > the end of the day the result is &quot;.
> >
> > Is there a common/best way to fix this?
> Yes, your xml parser needs to deal with that :-)
> Can you provide us with a _real_ sample?
I'm using libsoup, libxml2 and libxslt.
Libsoup grabs the file and I do:
xsltStylesheetPtr cur = NULL;
xmlDocPtr res, rss;
rss = xmlParseMemory(msg->response.body, msg->response.length);
>From there,
params[nbparams] = NULL;
xmlSubstituteEntitiesDefault(1);
xmlLoadExtDtdDefaultValue = 1;
cur = xsltParseStylesheetFile((const xmlChar *)"rss2html.xml");
res = xsltApplyStylesheet(cur, rss, params);
After the
rss = xmlParseMemory(msg->response.body, msg->response.length);
The xml tree appears the same as the source file. The problem occurs in
the following situation:
<description><![CDATA["One says definitely, the other says maybe.
At this point, the Nets will take whatever they can
get. . ." ]]></description>
After a the stylesheet is applied, the " are turned into
&quot;. Some of the CDATA has " which come out ok in the eventual
html.
All the template do is grab the <title>,<link> and <description> then
throw the values into an html <table>.
> So, where's the problem?
Does that make it more clear?
Cheers,
Andrew
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]