xsl-list
[Top] [All Lists]

Re: [xsl] Illegal xml chars

2007-12-13 08:05:14
Waqar Ali wrote:

I have an illegal character in my xml (0x08 or ) and when I tries to transform it using xslt, the parser (MS .NET) gives me an error(hexadecimal value 0x08, is an invalid character). I tried everything: using different encoding, wrapping my xml data in CDATA tags but nothing seems
to be working. What do you suggest?

If you are using .NET 2.0 or later then you can use  (a character reference) in your XML 1.0 documents parsed by an XmlReader with XmlReaderSettings.CheckCharacters set to false e.g. C#
  XmlReaderSettings readerSettings = new XmlReaderSettings();
  readerSettings.CheckCharacters = false;
  using (XmlReader reader = XmlReader.Create(@"file.xml", readerSettings))
  {
    // now use that reader here e.g. to be on topic on the list
    XPathDocument doc = new XPathDocument(reader);
    // ...
  }

Using the character literally however is not possible.

If you need more help on that then I suggest we move to the newsgroup microsoft.public.dotnet.xml as we are getting off-topic here on the XSL list.

--

        Martin Honnen
        http://JavaScript.FAQTs.com/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--