By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,638 Members | 1,983 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,638 IT Pros & Developers. It's quick & easy.

Xml Document Loads in IE but not .NET

P: n/a
I have the following Xml document (see end of post) with many external
resources that need to get resolved. When I "view" the Xml document in
Internet Explorer (Windows XP SP2, IE 6.0.2900) all of the external
resources and namespaces are resolved properly. However, when trying
to load the document in an XmlDocument object in .NET 1.1.4322, I
receive the following error:

Prefixes beginning with "xml" (regardless of whether the characters are
uppercase, lowercase, or some combination thereof) are reserved for use
by XML.

Searching the news groups for this error lead me to the following:

Topic in microsoft.public.dotnet.xml
Using entities for namespace names

http://groups-beta.google.com/group/...rch+this+group

That person had a similar problem and someone from MS said it would be
fixed in the next .NET Framework release (that post was from way back
in Sept 2003) which it does appear to be fixed now.

However, with my document, it appears that the Framework is complaining
about the following lines:

xmlns:rdf="&rdf;#"
.....
xml:base="&DEFAULT;">

The simple C# code I am using to try to load the document is:

System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(@"c:\temp\bravoairprocess.xml");

Why does the document load up just fine in IE but not .NET? I have
tried a bunch of things with the XmlResolver class as well, but that
didn't help. Any ideas would be appreciated.

Here is the Xml document:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE uridef [
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns">
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema">
<!ENTITY owl "http://www.w3.org/2002/07/owl">
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema">
<!ENTITY service
"http://www.daml.org/services/owl-s/1.1/Service.owl">
<!ENTITY process
"http://www.daml.org/services/owl-s/1.1/Process.owl">
<!ENTITY ba_service
"http://www.daml.org/services/owl-s/1.1/BravoAirService.owl">
<!ENTITY concepts
"http://www.daml.org/services/owl-s/1.1/Concepts.owl">
<!ENTITY DEFAULT
"http://www.daml.org/services/owl-s/1.1/BravoAirProcess.owl">
]>

<rdf:RDF
xmlns:rdf="&rdf;#"
xmlns:rdfs="&rdfs;#"
xmlns:owl="&owl;#"
xmlns:xsd="&xsd;#"
xmlns:concepts="&concepts;#"
xmlns:service="&service;#"
xmlns:process="&process;#"
xmlns:ba_service="&ba_service;#"
xmlns="&DEFAULT;#"
xml:base="&DEFAULT;">

<owl:Ontology rdf:about="">
<owl:versionInfo>$Id: BravoAirProcess.owl,v 1.48 2005/02/03
22:43:43 martin Exp $</owl:versionInfo>
<rdfs:comment>OWL-S Coalition: BravoAir Example for OWL-S Process
Model</rdfs:comment>
<owl:imports rdf:resource="&service;"/>
<owl:imports rdf:resource="&process;"/>
<owl:imports rdf:resource="&concepts;"/>
<owl:imports rdf:resource="&ba_service;"/>
</owl:Ontology>

<process:CompositeProcess rdf:ID="BravoAir_Process">
<rdfs:label>This is the top level process for BravoAir</rdfs:label>
<rdfs:comment>
BravoAir_Process is a composite process.

It is composed of a sequence whose components are 2 atomic
processes, GetDesiredFlightDetails and SelectAvailableFlight,
and a composite process, BookFlight.
</rdfs:comment>
<process:invocable
rdf:datatype="&xsd;#boolean">true</process:invocable>
<service:describes
rdf:resource="&ba_service;#BravoAir_ReservationAge nt"/>
<process:hasInput>
<process:Input rdf:ID="DepartureAirport">
<process:parameterType
rdf:datatype="&xsd;#anyURI">&concepts;#Airport</process:parameterType>
</process:Input>
</process:hasInput>
</process:CompositeProcess>
</rdf:RDF>

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a


Kevin wrote:
I have the following Xml document (see end of post) with many external
resources that need to get resolved. When I "view" the Xml document in
Internet Explorer (Windows XP SP2, IE 6.0.2900) all of the external
resources and namespaces are resolved properly. However, when trying
to load the document in an XmlDocument object in .NET 1.1.4322, I
receive the following error:

Prefixes beginning with "xml" (regardless of whether the characters are
uppercase, lowercase, or some combination thereof) are reserved for use
by XML.

Searching the news groups for this error lead me to the following:

Topic in microsoft.public.dotnet.xml
Using entities for namespace names

http://groups-beta.google.com/group/...rch+this+group

That person had a similar problem and someone from MS said it would be
fixed in the next .NET Framework release (that post was from way back
in Sept 2003) which it does appear to be fixed now.


I have tried that example in the post referenced above with the public
beta 1 of .NET 2.0 and there the XML is parsed fine.
Your XML also parses fine with the .NET 2.0 beta.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.