'<?' (paired with '?>') simply indicates an XML processing instruction and may appear in various places throughout an XML document. It may very well be the case here, however, that the special 'xml' processing instruction is the only one of its sort in the input document.
Text processing may be the fastest and easiest manner of removing the XML header, but as you can probably guess, it introduces the possibility that you will remove the wrong thing and create non-well-formed XML. If you limit the removal of processing instructions to check the first two characters of the string, then the only allowable removable PI may be limited to the XML header if it exists. On the other hand, do these documents have XML comments above the root node? Will that play havoc with your discovery of an XML header string? Just some things to consider. Good luck! Brion Swanson -----Original Message----- From: Aleksandar Milanovic [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 22, 2002 10:52 PM To: [EMAIL PROTECTED] Subject: RE: What is the best way to remove XML header and serialize it to String Well, if there is no header then I suppose the first thing in the string is an element that starts with < and not <?. I am not sure though if <? can appear in other places. You should check the XML spec. Alex -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: October 22, 2002 5:30 AM To: [EMAIL PROTECTED] Subject: What is the best way to remove XML header and serialize it to String I have XML as a String and I need only to remove an XML header <?xml version="1.0" encoding="UTF-8"?> from this and get XML as a String back. Of course I can cut this string by second symbol < but there is no sure I have XML with header. So, what is the best way to remove XML header? Thanks Jenya --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
