XML related question

B

Bruce C. Miller

I'm working on an application that I'd like to add XML support to in
order to communicate with another app on a remote server. The other
side already has the data I need in XML files ready to be recieved by
my end. The problem is that it's in a specific schema-type (cXML).

So far, I have my end recieving the datafeed, decrypting the XML, and
storing it in a string. However, when I load it into an XmlDocument
type (I'm using C#, by the way), I get invalid markup errors. The
problem is that the schema type being used by the other side defines
various tag syntax in the dtd (which is referenced in the DOCTYPE
declaration) that don't parse as generic XML.

Is there an elegant approach to this that is supported in the standard
..Net library? Looking around MSDN so far has proved fruitless.
Basically, I need a way to tell the document object about the specific
schema. I'm not entirely sure this is even possible with the .Net
framework. Perhaps I need to create a custom class for this document
type?
 
M

Martin Honnen

Bruce said:
I'm working on an application that I'd like to add XML support to in
order to communicate with another app on a remote server. The other
side already has the data I need in XML files ready to be recieved by
my end. The problem is that it's in a specific schema-type (cXML).

So far, I have my end recieving the datafeed, decrypting the XML, and
storing it in a string. However, when I load it into an XmlDocument
type (I'm using C#, by the way), I get invalid markup errors. The
problem is that the schema type being used by the other side defines
various tag syntax in the dtd (which is referenced in the DOCTYPE
declaration) that don't parse as generic XML.

Is there an elegant approach to this that is supported in the standard
.Net library?

If you have a DTD referenced by a DOCTYPE declaration then .NET should
be able to use that. With .NET 2.0 however DTDs are by default
prohibited thus if you want to parse an XML document with .NET 2.0 you
need to use XmlReaderSettings with ProhibitDtd set to false:
<http://msdn2.microsoft.com/en-us/library/system.xml.xmlreadersettings.prohibitdtd.aspx>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top