Welcome to OpenXML Developer Sign in | Join | Help

special characters like ' (single quote), " (double quote) and ‘, ’ are replaced with series of ? characters.

Last post 04-08-2008, 12:48 AM by Sheela E N. 1 replies.
Sort Posts: Previous Next
  •  04-04-2008, 8:24 AM 3000

    special characters like ' (single quote), " (double quote) and ‘, ’ are replaced with series of ? characters.

    Hi,
    Am doing appending of a set of docx files in to one docx. For that actually, am opening the document.xml file of each docx and appending each of the child node(<w:p>) of body node to a new master document .docx main document part's xml document. when i do that, the special characters ( like ', ", ‘, ’) are getting replaced  with a series of ? symbols like "'" = "???"( single quote with 3 "?" symbols).
    the following is the code snippet used for appending the nodes from child bosy node.
    foreach (XmlNode childNode in childBodyNode.ChildNodes)
    {
     masterBodyNode.AppendChild(masterDocument.ImportNode(childNode, true));
    }
    After that,

    SetStringContentOfPart(masterDocumentPart, masterDocument.OuterXml);

    sets the master document part with the xml content of the document.

    any idea, why simply importing a node in to a document would change the innerXml of a node at nth level .

    Thanks in advance.

    Manjunath.

  •  04-08-2008, 12:48 AM 3010 in reply to 3000

    Re: special characters like ' (single quote), " (double quote) and ‘, ’ are replaced with series of ? characters.

    Hi,

    I have tried to have special charaters in my sub doc and merged with Master document using

    c#. It is not replaced with ? as you explained.

    Note the encoding details for xml file in both sub doc as well as master doc.

      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

    Sheela

     

View as RSS news feed in XML