Right, it's not a real XML parser. It just happens to work on most XML. Try something based on expat.
On Sat, Jul 28, 2012 at 10:23 AM, Angelo Chen <angelochen...@gmail.com>wrote: > I use this one: > https://github.com/racker/node-elementtree > which in turn use: > https://github.com/isaacs/sax-js > > On Jul 28, 8:09 pm, Matt <hel...@gmail.com> wrote: > > Sounds like this might be a bug in Buffer - it should cope just fine with > > the UTF-8 BOM. > > > > BTW: A SAX parser expecting a string could also be called a bug - all > valid > > XML parsers MUST accept UTF-8 and UTF-16 with valid byte order markers. > > > > Matt. > > > > On Fri, Jul 27, 2012 at 7:14 PM, Angelo Chen <angelochen...@gmail.com > >wrote: > > > > > > > > > > > > > > > > > the SAX parser expects a string, so I have to do following to skip the > > > first 3 bytes: > > > > > resp = data.toString('utf8', 3) > > > > > On Jul 28, 12:29 am, Matt <hel...@gmail.com> wrote: > > > > I don't know much about Node's XML parsers (ironic considering my > history > > > > in the Perl world), but they should be able to handle a Buffer, and > treat > > > > it as binary, and cope with the BOM. > > > > > > On Fri, Jul 27, 2012 at 12:00 PM, Angelo Chen < > angelochen...@gmail.com > > > >wrote: > > > > > > > S = data.toString() > > > > > Then pass it to a sax parser, got an error message > > > > > On Jul 27, 11:43 pm, Matt <hel...@gmail.com> wrote: > > > > > > That is the UTF-8 Byte Order Mark. It's perfectly valid. > > > > > > > >http://en.wikipedia.org/wiki/Byte_order_mark > > > > > > > > On Fri, Jul 27, 2012 at 11:16 AM, Angelo Chen < > > > angelochen...@gmail.com > > > > > >wrote: > > > > > > > > > Hi, > > > > > > > > > using https to post, and expecting data return is xml, but the > > > first > > > > > > > few bytes are not, the rest is, any idea how to instruct https > to > > > > > > > return xml: > > > > > > > > > <Buffer ef bb bf 3c 3f 78 6d 6c 20 > > > > > > > > > thanks, > > > > > > > angelo > > > > > > > > > -- > > > > > > > Job Board:http://jobs.nodejs.org/ > > > > > > > Posting guidelines: > > > > > > > > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > > > > > > > You received this message because you are subscribed to the > Google > > > > > > > Groups "nodejs" group. > > > > > > > To post to this group, send email to nodejs@googlegroups.com > > > > > > > To unsubscribe from this group, send email to > > > > > > > nodejs+unsubscr...@googlegroups.com > > > > > > > For more options, visit this group at > > > > > > >http://groups.google.com/group/nodejs?hl=en?hl=en > > > > > > > -- > > > > > Job Board:http://jobs.nodejs.org/ > > > > > Posting guidelines: > > > > >https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > > > > > You received this message because you are subscribed to the Google > > > > > Groups "nodejs" group. > > > > > To post to this group, send email to nodejs@googlegroups.com > > > > > To unsubscribe from this group, send email to > > > > > nodejs+unsubscr...@googlegroups.com > > > > > For more options, visit this group at > > > > >http://groups.google.com/group/nodejs?hl=en?hl=en > > > > > -- > > > Job Board:http://jobs.nodejs.org/ > > > Posting guidelines: > > >https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > > > You received this message because you are subscribed to the Google > > > Groups "nodejs" group. > > > To post to this group, send email to nodejs@googlegroups.com > > > To unsubscribe from this group, send email to > > > nodejs+unsubscr...@googlegroups.com > > > For more options, visit this group at > > >http://groups.google.com/group/nodejs?hl=en?hl=en > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to nodejs@googlegroups.com > To unsubscribe from this group, send email to > nodejs+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en