This content has been marked as final. Show 5 replies
That's an FAQ in the XML forum.
parse(new InputSource(new StringReader(someString)))
I have built a desktop application that can use theseOk. So, the application works fine then?
calls to check if the xml contained in the document
called "file" is well formed.
DocumentBuilderFactory domFactory =Huh? You lost me there. Are you getting security exceptions from the applet? If yes, you need to sign the applet. Otherwise, what is not 'working' in the applet compared to the application? Also, why do you need to first write it to a file?
DocumentBuilder domBuilder =
lder domBuilder = domFactory.newDocumentBuilder();
They are part of the javax.xml.parsers.*; package.
Problem is that to serve this I need to put it in an
applet but since I have to write the xml string to a
file local to the server the applet is not working.
My question is if anyone knows of some classes in theIf the document is not well-formed, the parse() call will throw an exception. Catch this and process as needed.
API that will allow me to check if a String of XML is
well formed or not.
I basically need to get a string from a field in aIf you want to access an external database from an applet, you will need to sign the applet. You should not need to first write it to a file before parsing. Rather, simply use a stream (either InputStream or Reader) and wrap it in a StreamSource object.
data base in XML format and be able to test it
without first writing it to a document so I can get
the applet to work.
If anyone knows something on this or has an- Saish
alternative suggestion please do tell.
Thanks to all. I missed the XML forum. I'll root around there. My appologies. I know how annoying this can be.
I think what I'm after is a way to eliminate having to write the string to a file which looks possible. Thanks.
Yes. But re-read my reply above. I think you will run into other issues. Also, take a tutorial on Java I/O streams.
Thanks to all. I missed the XML forum. I'll rootThat's what the code I posted does. It parses directly from a string.
around there. My appologies. I know how annoying
this can be.
I think what I'm after is a way to eliminate having
to write the string to a file which looks possible.