473,385 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

is this standard way of including xml into xml?

Hi,
I am trying to style an rss feed. i created a stylesheet, and an xml
file. i include the stylesheet and the rss feed file into my xml file.

when i open my xml file in IE, everything works fine.
when i open it in firefox, it doesn't work.

does anybody know if there is antyhing i can do to make this work in
firefox?

here are my files:

*********************
del.icio.us.xml
*********************
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE root [
<!ENTITY foo1 SYSTEM "http://del.icio.us/rss/">
]>
<?xml-stylesheet type="text/xsl" href="del.icio.us.xslt"?>
<root>
&foo1;
</root>
********************
del.icio.us.xslt
********************
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foo="http://purl.org/rss/1.0/">
<xsl:template match="/">
<html>
<head/>
<body>
<table border="1">
<tr>
<th>Title</th>
<th>Link</th>
</tr>
<xsl:for-each select="//rdf:RDF/foo:item">
<tr>
<td>
<xsl:value-of select="foo:title"/>
</td>
<td>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="foo:link"/>
</xsl:attribute>
<xsl:text> </xsl:text>
<xsl:value-of select="foo:link"/>
</xsl:element>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Oct 28 '05 #1
5 1404


hilz wrote:

when i open it in firefox, it doesn't work.

does anybody know if there is antyhing i can do to make this work in
firefox? <!DOCTYPE root [
<!ENTITY foo1 SYSTEM "http://del.icio.us/rss/">
]>


That is a problem with XML, the mechanism of such external entities is
defined but it is not mandatory to be implemented, non validating
parsers like the one Mozilla uses do not have to load such external
entities and usually don't do that.

Unless you know what kind of parsers processes the above construct
respectively you can configure the parsers used to load such external
entities you can't use it reliably.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Oct 28 '05 #2
hilz wrote:
Hi,
I am trying to style an rss feed. i created a stylesheet, and an xml
file. i include the stylesheet and the rss feed file into my xml file.
To answer the question in your subject line, yes.
See http://xml.silmaril.ie/authors/includes/
when i open my xml file in IE, everything works fine.
when i open it in firefox, it doesn't work.
Martin already answered this. Browser support for XML is still poor.
does anybody know if there is antyhing i can do to make this work in
firefox?


Do it server-side instead. Browser-side XML processing is not reliable
enough yet.

///Peter

Oct 29 '05 #3
Do it server-side instead. Browser-side XML processing is not reliable
enough yet.

///Peter


But i am not the owner of the server, and thus do not have access to the
server to do it server-side. I only have the url of the rss feel.

In this link you provided, it is saying that i can add the <!ENTITY ...>
defnition in the xml file without the <!DOCTYPE ...>
so if i do it this way:

<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="del.icio.us.XSLT"?>
<!ENTITY foo1 SYSTEM "http://del.icio.us/rss">
<root>
&foo1;
</root>

if i do this, it doesn't work in either firefox or IE.
i get the following error in firefox:

XML Parsing Error: syntax error
Location:
file:///c:/...../del.icio.us.xml
Line Number 3, Column 1:<!ENTITY foo1 SYSTEM
"http://del.icio.us/rss/hsalameh">
^

and the following error in IE:

The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the
error and then click the Refresh button, or try again later.
---------------------------------------------------
Cannot have a DTD declaration outside of a DTD. Error processing
resource 'file:///C:/Documents and Settings/halim.salameh/...
<!ENTITY foo1 SYSTEM "http://del.icio.us/rss/hsalameh">
---------^
So how do i define the entity without a doctype ?

thanks
Oct 29 '05 #4
ok never mind...after reading your post and Martin's post again, i
realized that it will not work with mozilla!

thanks for your help
Oct 29 '05 #5
hilz wrote:
Do it server-side instead. Browser-side XML processing is not
reliable enough yet.

///Peter

But i am not the owner of the server, and thus do not have access to
the server to do it server-side. I only have the url of the rss feel.

In this link you provided, it is saying that i can add the <!ENTITY
...> defnition in the xml file without the <!DOCTYPE ...>
so if i do it this way:

<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="del.icio.us.XSLT"?>
<!ENTITY foo1 SYSTEM "http://del.icio.us/rss">


I'm sorry, I can see that my example is misleading. I'll fix it.

No, an ENTITY declaration must go in a DOCTYPE declaration.
So how do i define the entity without a doctype ?


You can't. But you don't have to have a DTD to do this. Just do

<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="del.icio.us.XSLT"?>
<!DOCTYPE root [
<!ENTITY foo1 SYSTEM "http://del.icio.us/rss">
]>
<root>
&foo1;
</root>

But don't expect it to work in browsers. I can only repeat what I and
others said in case you didn't understand it: browser-side XML
processing is not reliable enough yet.

///Peter

Oct 31 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Brian O. Bush | last post by:
A while ago, I recall hearing that Gadfly might be included into the python standard library. What happened? As I recall, the issue was the license. Brian
25
by: Magnus Lie Hetland | last post by:
Is there any interest in a (hypothetical) standard graph API (with 'graph' meaning a network, consisting of nodes and edges)? Yes, we have the standard ways of implementing graphs through (e.g.)...
8
by: Sims | last post by:
Hi, I have some small questions that have never been any problems, (for my compiler?), but always make me curious. So here goes... what does the standard sday about the 'if' statement? for...
76
by: DaKoadMunky | last post by:
After having fancied myself a C++ programmer for the last nine years I figured it was about time that I actually obtain a copy of the standard rather than relying on other sources that claim to...
43
by: Steven T. Hatton | last post by:
Now that I have a better grasp of the scope and capabilities of the C++ Standard Library, I understand that products such as Qt actually provide much of the same functionality through their own...
16
by: Steven T. Hatton | last post by:
I wanted to take a look at the actual C Programming Language specification which provides the libraries used by C++ in the <c*> Headers. A couple days ago, I found it freely available on the...
1
by: Thomas Holmgren | last post by:
Hi all I've tried to get my hands on the End User License Agreement for MS Visual C# .NET 2003 STANDARD edition, sofar without luck. Does anybody know where I can find the license agreement...
52
by: lovecreatesbeauty | last post by:
Why the C standard committee doesn't provide a standard implementation including the C compiler and library when the language standard document is published? C works on the abstract model of low...
22
by: David Mathog | last post by:
One thing that keeps coming up in this forum is that standard C lacks many functions which are required in a workstation or server but not possible in an embedded controller. This results in a...
6
by: Ole Nielsby | last post by:
The standard doesn't define this but what conventions do projects use? As I understand it, #include <somelibrary.h> is used for including system headers and those of frameworks such as...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.