> Stuart Subscription wrote:
>
> Does anyone have any knowledge or example code on
> validating an incomming (over HTTP) XML file using
> a Java Servlet
>

 There's not much servlet-specific about validating
XML. There are plenty of validating parsers, but
you might want to take a look at:

  http://xml.apache.org/

 Check out xerces. I believe the documentation
contains some examples of using it inside a servlet.
The only thing you might have to watch out for is
conflicts between your XML parser and the XML parser
that the servlet engine uses. That isn't supposed to
happen, but because of problems with classloaders
it's historically been kind of a pain.


> and either recording an error in the file
>

 Use the servlet engine's built in logging
facilities. Or just open a file and write to it.
Or if you want to get fancy, there are logging
packages like log4j:

 http://jakarta.apache.org/


> or if valid, sending the file onwards (pass-through)
> to another destination over HTTP.
>

 Depends on where the other destination is. If
it's not on the same machine, you can just open
a URLConnection. There's discussion in the
servlet-interest archives (search keys like "applet
servlet communication") or you can check the Java
Tutorial at java.sun.com. Using a URLConnection
from a servlet is just like using it from anywhere
else.


--
Christopher St. John [EMAIL PROTECTED]
DistribuTopia http://www.distributopia.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to