473,769 Members | 5,570 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.xsl t
*************** *****
<?xml version="1.0" encoding="utf-8"?>
<xsl:styleshe et 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:tit le"/>
</td>
<td>
<xsl:element name="a">
<xsl:attribut e name="href">
<xsl:value-of select="foo:lin k"/>
</xsl:attribute>
<xsl:text> </xsl:text>
<xsl:value-of select="foo:lin k"/>
</xsl:element>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Oct 28 '05 #1
5 1419


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
2072
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
3793
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.) dicts mapping nodes to neighbor-sets, but if one wants a graph that's implemented in some other way, this may not be the most convenient (or abstract) interface to emulate. It might be nice to have the kind of polymorphic freedom that one has with,...
8
2091
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 example if i have,
76
3923
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 accurately represent the standard. Even the best intentioned author or newsgroup poster is capable of inaccurately representing the standard. I followed the FAQ link to http://www.techstreet.com/ and searched for 14882 as suggested. That...
43
5021
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 libraries. I'm not sure if that's a good thing or not. AFAIK, most of Qt is compatable with the Standard Library. That is, QLT can interoperate with STL, and you can convert back and forth between std::string and Qt::QString, etc. Are there any...
16
1545
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 internet. I originally assumed it was an older, or draft version. I'm pretty sure what I have is the same ISO/IEC 9899:1999, Programming languages ? C referenced in the C++ Standard. I'm now discovering that it is available in many places on the...
1
4238
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 for the standard edition? Thank you :)
52
3788
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 level machine. C stands for portability and platform and machine independent. If the C compiler and C standard library are written in C itself, is it possible that one "standard" C compiler plus library is enough? The standard implementation is...
22
2505
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 plethora of "don't ask here, ask in comp.x.y instead", for queries on functions that from the documentation available to the programmer appear to be part of the C language. I think largely because of this "least common denominator" C language...
6
1756
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 wxWidgets - and #include "someheader.h"
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10219
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3967
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3567
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.