all groups > dotnet xml > march 2005 >
You're in the

dotnet xml

group:

Xml Document Loads in IE but not .NET


Xml Document Loads in IE but not .NET Kevin
3/18/2005 9:56:39 AM
dotnet xml: 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/microsoft.public.dotnet.xml/search?group=microsoft.public.dotnet.xml&q=%22Using+entities+for+namespace+names%22&qt_g=1&searchnow=Search+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_ReservationAgent"/>
<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>
Re: Xml Document Loads in IE but not .NET Martin Honnen
3/19/2005 1:44:45 PM


[quoted text, click to view]

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
AddThis Social Bookmark Button