NotSupportedException from XmlDocument

G

Guest

I get a :
System.NotSupportedException was unhandled
Message="NotSupportedException"
StackTrace:
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.LoadNode()
at System.Xml.XmlLoader.LoadDocSequence()
at System.Xml.XmlLoader.Load()
at System.Xml.XmlDocument.Load()
at System.Xml.XmlDocument.LoadXml()
at MP.DBUtils.DBReplication.initFromDefaults()
at MP.DBUtils.DBReplication..ctor()
at MP.DBUtils.DBReplication.getInstance()
at MP.DBUtils.DBReplication.getInstance()
at mpUtilsTest.Form1.initReplicationBTN_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Button.OnClick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at mpUtilsTest.Program.Main()

from the code:
TextReader sr = new StreamReader(filepath);
string t1 = sr.ReadToEnd();
m_XmlDoc = new XmlDocument();
m_XmlDoc.LoadXml(t1);

The XML is:
<!DOCTYPE DBReplication [
<!ELEMENT DBReplication (defaults)*>
<!ELEMENT defaults (url,internetUID,internetPSW
,publisher,publisherUID,publisherPSW,publisherDB
,publication,subscriber,ceConnectString,publisherSecurityMode)>
<!ATTLIST defaults defaultsName CDATA #REQUIRED>
<!ELEMENT url (#PCDATA)>
<!ELEMENT internetUID (#PCDATA)>
<!ELEMENT internetPSW (#PCDATA)>
<!ELEMENT publisher (#PCDATA)>
<!ELEMENT publisherUID (#PCDATA)>
<!ELEMENT publisherPSW (#PCDATA)>
<!ELEMENT publisherDB (#PCDATA)>
<!ELEMENT publication (#PCDATA)>
<!ELEMENT subscriber (#PCDATA)>
<!ELEMENT ceConnectString (#PCDATA)>
<!ELEMENT publisherSecurityMode (#PCDATA)>
]>
<DBReplication>
<defaults defaultsName="fordorie" >
<url>http://dorie.irish.mp:89/DorieStocksMobileRep/sqlcesa30.dll</url>
<internetUID>irish\Sql5</internetUID>
<internetPSW>Moosethe1</internetPSW>
<publisher>DORIE\DOIRE2005</publisher>
<publisherUID>irish\Sql5</publisherUID>
<publisherPSW>Moosethe1</publisherPSW>
<publisherDB>stocks</publisherDB>
<publication>MobileStocks</publication>
<subscriber>MobileStocks</subscriber>
<ceConnectString>Data Source='\Program
Files\ReplicationExample\StocksMobile.sdf';Password='methe1';Max Database
Size='128';Default Lock Escalation='100'</ceConnectString>
<publisherSecurityMode>NTAuthentication</publisherSecurityMode>
</defaults>
</DBReplication>
 
I

Ilya Tumanov [MS]

DTDs are not supported on NETCF, you would need to remove them from XML
before loading.


--
Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).

Moose said:
I get a :
System.NotSupportedException was unhandled
Message="NotSupportedException"
StackTrace:
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.LoadNode()
at System.Xml.XmlLoader.LoadDocSequence()
at System.Xml.XmlLoader.Load()
at System.Xml.XmlDocument.Load()
at System.Xml.XmlDocument.LoadXml()
at MP.DBUtils.DBReplication.initFromDefaults()
at MP.DBUtils.DBReplication..ctor()
at MP.DBUtils.DBReplication.getInstance()
at MP.DBUtils.DBReplication.getInstance()
at mpUtilsTest.Form1.initReplicationBTN_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Button.OnClick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at mpUtilsTest.Program.Main()

from the code:
TextReader sr = new StreamReader(filepath);
string t1 = sr.ReadToEnd();
m_XmlDoc = new XmlDocument();
m_XmlDoc.LoadXml(t1);

The XML is:
<!DOCTYPE DBReplication [
<!ELEMENT DBReplication (defaults)*>
<!ELEMENT defaults (url,internetUID,internetPSW
,publisher,publisherUID,publisherPSW,publisherDB
,publication,subscriber,ceConnectString,publisherSecurityMode)>
<!ATTLIST defaults defaultsName CDATA #REQUIRED>
<!ELEMENT url (#PCDATA)>
<!ELEMENT internetUID (#PCDATA)>
<!ELEMENT internetPSW (#PCDATA)>
<!ELEMENT publisher (#PCDATA)>
<!ELEMENT publisherUID (#PCDATA)>
<!ELEMENT publisherPSW (#PCDATA)>
<!ELEMENT publisherDB (#PCDATA)>
<!ELEMENT publication (#PCDATA)>
<!ELEMENT subscriber (#PCDATA)>
<!ELEMENT ceConnectString (#PCDATA)>
<!ELEMENT publisherSecurityMode (#PCDATA)>
]>
<DBReplication>
<defaults defaultsName="fordorie" >
<url>http://dorie.irish.mp:89/DorieStocksMobileRep/sqlcesa30.dll</url>
<internetUID>irish\Sql5</internetUID>
<internetPSW>Moosethe1</internetPSW>
<publisher>DORIE\DOIRE2005</publisher>
<publisherUID>irish\Sql5</publisherUID>
<publisherPSW>Moosethe1</publisherPSW>
<publisherDB>stocks</publisherDB>
<publication>MobileStocks</publication>
<subscriber>MobileStocks</subscriber>
<ceConnectString>Data Source='\Program
Files\ReplicationExample\StocksMobile.sdf';Password='methe1';Max Database
Size='128';Default Lock Escalation='100'</ceConnectString>
<publisherSecurityMode>NTAuthentication</publisherSecurityMode>
</defaults>
</DBReplication>
 
Top