XML related question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bruce C. Miller

    XML related question

    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?

  • Martin Honnen

    #2
    Re: XML related question

    Bruce C. Miller wrote:
    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 XmlReaderSettin gs with ProhibitDtd set to false:
    <http://msdn2.microsoft .com/en-us/library/system.xml.xmlr eadersettings.p rohibitdtd.aspx >



    --

    Martin Honnen --- MVP XML

    Comment

    Working...