Josh,
Did you try to validate your cXML with a prior DTD version?
I think I got that orderrequest.xml example to work by using the 1.1.010 DTD.
1. I change my local DTD to a prior cXML version. Not sure why a prior version works over the more recent. Maybe the OrderRequest example is for Version 1.1. : http://www.cxml.org/files/downloads.cfm
cXML 1.1 Specification (Version 1.1.010).
and put somewhere locally on the server.
2. In code, when I read in the file, I replaced the DOCTYPE reference of the order cXML's coming in.
Dim localDTD = "http://localhost:2576/WebSite3/cXML1_1.dtd"
Dim otherDTDs_1 = "http://xml.cXML.org/schemas/cXML/1.1.010/cXML.dtd"
Dim otherDTDs_2 = "http://xml.cXML.org/schemas/cXML/1.2.014/cXML.dtd"
Dim ByteFileString As String = Encoding.getString(ByteFile) '<------ByteFile is input from the function the xml in bytes()
ByteFileString = ByteFileString.Replace(otherDTDs_1, localDTD)
ByteFileString = ByteFileString.Replace(otherDTDs_2, localDTD)
'\\Write to a temp file
ByteFile = Encoding.GetBytes(ByteFileString)
Dim lngLen As Long = ByteFile.Length
objFileStream.Write(ByteFile, 0, CInt(lngLen))
objFileStream.Flush()
objFileStream.Close()
3. Then I call my ValidateFile function passing the temp file location
Protected Function ValidateFile(ByVal myFileNameLocation As String) As Boolean
'A file is validated by the DTD
Dim XmlTextReader As XmlTextReader = Nothing
Dim XmlValidatorReader As XmlReader = Nothing
Try
blnValidFile = True
Dim XmlSettings As New XmlReaderSettings()
XmlSettings.ValidationType = ValidationType.DTD
XmlSettings.ProhibitDtd = False
XmlSettings.IgnoreWhitespace = True
XmlSettings.IgnoreComments = True
XmlTextReader = New XmlTextReader(myFileNameLocation)
XmlValidatorReader = XmlReader.Create(XmlTextReader, XmlSettings)
' Read XML data
While XmlValidatorReader.Read
End While
XmlValidatorReader.Close()
XmlValidatorReader = Nothing
XmlTextReader.Close()
XmlTextReader = Nothing
Catch ex as exception
'\\ If throws an error then invalid file
blnValidFile=false
'Error handler stuff, here
End Try
Return blnValidFile
End Function
===============end===============
Seemed to work for me now.
HTH
SW