First of all: This is not beans specific.
> Using javax.xml.parsers and org.xml.sax to read the xml file, but receiving
> error "The processing instruction target matching "[xX][mM][lL]" is not
[quoted text clipped - 9 lines]
> Could you give me alternative to do this if possible.
> Thanks
It looks like as if you were getting two XML documents in one stream. You
could get away by storing those in two different files and parsing them
separately. If they are not too big you could keep them in mem in a
ByteArrayInputStream.
FUP set to c.l.j.p
robert
Progmet - 28 Sep 2004 07:31 GMT
Thanks Robert
Is there a way to store the file seperately without having to split it
manually in java?
Robert Klemme - 28 Sep 2004 08:13 GMT
> Thanks Robert
>
> Is there a way to store the file seperately without having to split it
> manually in java?
AFAIK not. But it's really not too difficult.
robert
PS: Why did you post twice?
Progmet - 28 Sep 2004 08:35 GMT
I know but the whole process must be automatically because we receive the
xml file onto a folder on a windows 2000 server where we then have to pick
up the file and send a response back in xml again into another folder on
the server for pickup by them. The posted xml back is also containing two
xml in one stream. Do you think I should use a different method to do
this?
PS: I do not know why it posted twice - did not intent to.
Robert Klemme - 28 Sep 2004 09:25 GMT
> I know but the whole process must be automatically because we receive the
> xml file onto a folder on a windows 2000 server where we then have to pick
> up the file and send a response back in xml again into another folder on
> the server for pickup by them. The posted xml back is also containing two
> xml in one stream. Do you think I should use a different method to do
> this?
There are 1000 ways to split this up depending on the environment your
application. But since you seem to use an XML parser in Java I did
suggest to do it in Java. Heck, this isn't really too difficult, is it?
Where's your creativity?
robert
Progmet - 28 Sep 2004 13:49 GMT
Sorry but all this is a bit new to me.
So what you said was that to use ByteArrayInputStream to read the file and
then write output to the new file, but what about the values I need from
the original file?
Now you probably think my creativity is gone again?
ilana
Robert Klemme - 29 Sep 2004 13:42 GMT
> Sorry but all this is a bit new to me.
> So what you said was that to use ByteArrayInputStream to read the file and
> then write output to the new file, but what about the values I need from
> the original file?
> Now you probably think my creativity is gone again?
> ilana
read input file and copy the content into a first ByteArrayOutputStream
(BAOS) until you see a second "<? xml...". When that arrives close the
first BAOS and create a new one. Now write into this until the end. Now
you can create a ByteArrayInputStream from the bytes in the first BAOS and
have your XML parser read from that. Proceed similarly for the second
BOAS.
robert
Progmet - 28 Sep 2004 07:31 GMT
Thanks Robert
Is there a way to store the file seperately without having to split it
manually in java?