XML over TCP

G

Goran Djuranovic

Hi all,
I have an VB.NET application the is sending XML files over TCP. I would like to know if there is a standard syntax for signaling the "end-of-file" for XML. I know I could concatinate whatever, but am looking for a standard, if it exists.

Thanks in advance
Goran Djuranovic
 
G

Guest

I have an VB.NET application the is sending XML files over TCP. I
would like to know if there is a standard syntax for signaling the
"end-of-file" for XML. I know I could concatinate whatever, but am
looking for a standard, if it exists.

End of file is determined by your file schema.

You can use a DTD to validate if the file was transferred succesfully.
 
G

Goran Djuranovic

Hi,
To use DTD I first have to an XML file (on disc or in-memory), right?
But cannot get the file if I don't known where the file ends. For example,
if I am getting the following stream of data:
<?xml version="1.0" encoding="utf-8"?><Root><Name>Apple</Name></Root><?xml
version="1.0" encoding="utf-8"?><Root><Name>Orange</Name></Root>

I need to be able to read: <?xml version="1.0"
encoding="utf-8"?><Root><Name>Apple</Name></Root>
out of that stream and convert it to an XML file (in order to use DTD or
schema validation), and continue with the rest of the stream.

I CAN do this by sending "<EOF>" right after both </Root> tags, but I was
wondering if there is an XML standard that I can use instead of "<EOF>".

Thanks
Goran Djuranovic
 
H

Holger Boskugel

Hello Goran
I need to be able to read: <?xml version="1.0"
encoding="utf-8"?><Root><Name>Apple</Name></Root>
out of that stream and convert it to an XML file (in order to use DTD or
schema validation), and continue with the rest of the stream.

I CAN do this by sending "<EOF>" right after both </Root> tags, but I was
wondering if there is an XML standard that I can use instead of "<EOF>".

there is no signaling known for XML. A solution of MacroMedia with Flash
is to send a 0 or 1 byte/char as terminator for the XML content, in case
this
characters are not allowed in XML. You can do the same with the <EOF>
for your communication.


Regards

Holger
 
G

Guest

To use DTD I first have to an XML file (on disc or in-memory), right?
But cannot get the file if I don't known where the file ends. For
example, if I am getting the following stream of data:
<?xml version="1.0"
encoding="utf-8"?><Root><Name>Apple</Name></Root><?xml version="1.0"
encoding="utf-8"?><Root><Name>Orange</Name></Root>

Do you know the schema - or is the file format unknown? You could define
the terminator as part of your file format (i.e. <file>....</file>)

Or, I believe if you load an incomplete/invalid file into an XML
document... it will throw an error.
 
M

Michel Posseth [MCP]

Or, I believe if you load an incomplete/invalid file into an XML
document... it will throw an error.

it is a fact :)


regards

Michel Posseth [MCP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top