"bug" in some XML responses

Subscribe to "bug" in some XML responses 3 posts, 2 voices

 
Avatar Alberto Gimeno 2 posts

Hi! bon jour! hola!

I am developing a Java client for your service. I have finished most of the work, but I have had some troubles with some XML responses.

For exmaple when I upload a new video, the XML response returns the information of all raw videos. It is fine, but the response is not ONE XML document but several XML documents. example…

<?xml version=”1.0” encoding=”UTF-8”?> <video> ... </video> <?xml version=”1.0” encoding=”UTF-8”?> <video> ... </video> <?xml version=”1.0” encoding=”UTF-8”?> <video> ... </video>

It makes difficult to parse the response because of any XML complaint parser will not stop the parsing process when a “</video>” is found. It is because strictically the XML document may not have ended. For example, this is a valid XML document:

<video> </video> <?xml-stylesheet type=”text/css” href=”...” ?> <!- a comment ->

What I try to explain is that the XML document may not end with the “</video>” end tag, so any XML complaint parser doesn’t stop there.

So, when I use an XML parser I get an error because it finds a ”<?xml” Processing Instruction after “</video>”, and the ”<?xml” processing instruction is only permitted at the beggining of the document.

I have make a hack to make my java client work. I have stored all the http response in a String and then I have splitted it manually in one chunk per XML document. Then I use a XML parser to parse each chunk. But storing the whole http response in a String is not a good idea.

I suggest to send just ONE XML document like this.

<videos> <video>...</video> <video>...</video> </videos>

Or just ONE XML document containing only the information of the raw video just beign uploaded.

I have had the same problem when trying to get the list of current jobs “http://heywatch.com/job.xml”. The response contains several XML documents.

Best regards!

 
Avatar Bruno Celeste 374 posts

Hi Alberto,

I just fixed the bug, you have now one xml representation of your new video. That is weird because when I used yaml format, I had no bug…

About the job list, I have no problem.

Best regards

 
Avatar Alberto Gimeno 2 posts

Thanks a lot!