[Home] [By Thread] [By Date] [Recent Entries]
Gait, I'm in my code (ASP server side) attempting to serialize the requested XML document, however I have another problem: I'm not able to load the XML document because the XML thinks it is bad (missing DTD resource). Therefore, I have no way to get at the XML source and have nothing to save. Uggg, I'm really in a pickle here. I'm considering attaching the DTD to the data, or setting up a publicly accessible site for my DTD's. I didn't want to set up the publicly accessible site (page) 1) because the server that processes the order entries is private and I do not want to expose the IP, and 2) because I did not want to incur the overhead of another web site / page to maintain. SCHEMAS: should I be using a schema (not versed at all with schemas)? Karl -----Original Message----- From: Gait Boxman [mailto:gait.boxman@t...] Sent: Tuesday, July 23, 2002 11:38 PM To: Karl Stubsjoen Subject: Re: SYSTEM DTD's Hi Karl, when specifying a system DTD without a path, the parser will look for it in the same location as the XML, i.e. the posted Request. Of course it cannot be found there (if only because Request is not a file system). There are two ways around this, apart from having the DTD internally: 1. explicitly state a (server) path to the DTD in the XML that is valid for your ASP page. This works fine until you move the DTD or the ASP page, and also exposes some of your implementation to the user. 2. Serialize the posted file to disk, and open that file. You'll need a unique file name for that to avoid concurrent users overwriting each others data. I think this is the way to go as it's stable and doesn't impact the data you send between client and server. Gait Boxman, TIE, The Netherlands. ----- Original Message ----- From: "Karl Stubsjoen" <karl@e...> To: "Xml-Dev" <xml-dev@l...> Sent: Wednesday, July 24, 2002 1:23 AM Subject: SYSTEM DTD's > Hello, > > I am using a SYSTEM DTD which should be found locally to the XML document. > In otherwords, if the xml document is in c:\myxmldoc then the DTD should > also be found there. > I have a copy of the DTD on the server where order entry will be processed. > My VB Application will POST a new order entry XML doc to the server via the > XMLHTTP object of MSXML2. On the server, and local to the ASP page handling > the request, is the DTD used to validate the XML document. I am getting the > error: > > Problem loading xml - -2146697210 -- The system cannot locate the object > specified. > Error processing resource 'order_entry.dtd' > > My DTD tag in the XML document reads: > > <!DOCTYPE ORDER SYSTEM "order_entry.dtd"> > > Apparently, the XML document when POSTed to the ASP page from VB loses > reference (doesn't understand) where the DTD should be found. I'd like it > to be found local to the ASP script. Am I making sense? The URL I am > posting to requires NT Authentication, so I wasn't sure if specifying a > PUBLIC DTD would work here. > > How can I rewrite my external DTD decleration? > > Here is the ASP code which loads the XML document: > > set xml = createobject("MSXML2.DomDocument") > > with xml > .validateonparse = true > .async = false > '.load Server.MapPath("firsttry.xml") 'load sample - local copy > .load(Request) > end with > > > Notice the commented out line that opens the XML document "firsttry.xml"? > Well, this works great when testing the ASP page - Vs. the true test of > excepting a POSTed XML document. > > Thanks for the help! > > Karl > > PS - Is this a DTD weakness? Should I be using schemas to validate? And, I > don't like placing the DTD within the XML document as the standards may > change, old XML may exist on client machines (with old DTD specifications), > etc... > > > ----------------------------------------------------------------- > The xml-dev list is sponsored by XML.org <http://www.xml.org>, an > initiative of OASIS <http://www.oasis-open.org> > > The list archives are at http://lists.xml.org/archives/xml-dev/ > > To subscribe or unsubscribe from this list use the subscription > manager: <http://lists.xml.org/ob/adm.pl>
|

Cart



