HTTP Posting of XML data
Is it me or is this fantastically powerful?
As you just reacently switched Im betting youve got a ton of good links for the XML noob? I know about the markup stuff, but I dont have a clue about what its good for except tomcats config files.
One of the things I don't really understand is how to escape XML tags and elements from the data you are trying to wrap around.
This guy words it best:
CData tags or other tags within CData will be ignored by the parser. That's what CData is saying to the parser, "don't try to parse what's inside of me".
Eric DeBois: If you are doing Windows Software Development, this is all that you should need: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/htm/sdk_intro_6g53.asp
If you dont want to bother with all that CDATA stuff there are five magic tricks you need to encode your data. The danger characters are > & ' " < and these can be escaped like you would do in HTML with named entities (hopefully this site wont actually format these)
An alternative to having to encode things yourself is to use the MSXML DOM object, and use method/properties to get/set data. This will do the encoding/decoding behind the scenes and there's properties to return the complete XML with all your data encoded.
Be careful with CDATA though, if you think that the XML you are trying to avoid parsing by putting it in the CDATA could ever contain a CDATA tag itself then you are stuffed. CDATA tags cannot be nested.
Oh, and don't assume that you can just put any old data into your CDATA tag. Control characters that are invalid in XML text are just as invalid inside the CDATA tag.
Cheers Wayne. I do data modelling and web apps, but Ill read it non the less.
It's been a while since I force myself through a RFC or something like it but this one basically answers what XML SHOULD accept: http://www.w3.org/TR/REC-xml
Fog Creek Home