[JDEV] Newbie Question: What's so invalid about my XML?
Peter Saint-Andre
stpeter at jabber.org
Fri May 3 22:04:00 CDT 2002
You don't need the XML declaration. Just start right off with the stream
element. BTW, you can use single quotes in your XML and save yourself from
typing all those backslashes.
I have simple examples of XML chunks you can send to the server (even over
telnet) at the following URL:
http://www.saint-andre.com/jabber/telnet.txt
Peter
--
Peter Saint-Andre
email+jabber: stpeter at jabber.org
weblog: http://www.saint-andre.com/blog/
On Fri, 3 May 2002, Darryl G. Wright wrote:
> Hi there,
>
> I have been going through the Programmers Reference and wrote a small
> application just to poke the server and get a response back. I successfully
> opened the port and fired off the following:
>
> string sXML( "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" );
> sXML.append( "<stream:stream to=\"jabber.org\" " );
> sXML.append( "xmlns=\"jabber:client\" " );
> sXML.append( "xmlns:stream=\"http://etherx.jabber.org/streams\">" );
>
> s.send( sXML.c_str(), sXML.length() );
>
> this is exactly what's listed in all the examples I've seen to open up a
> stream. I also tried single quotes, but what I get back, no matter what
> server I tried is:
>
> <stream:error>Invalid XML.</stream:error>
>
> I know this is one of those things where I am missing something very simple
> and very key but if someone could help me get over this little hirtle, I'd
> really appreciate.
>
> Cheers,
> Darryl
>
> ---
> "I have not failed. I've just found 10,000 ways that won't work." - Thomas
> Alva Edison (1847-1931)
>
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
>
More information about the JDev
mailing list