Click here to Skip to main content
12,404,478 members (73,455 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB XML VB.NET
I Getting expression expected Error in Following XML Document Format
I Getting expression expected Error at

Public Sub SetMainDocumentContent2(ByVal part As MainDocumentPart)
 
        Const docXml As String = "<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?>" & _
  "<w:document xmlns:ve=""http://schemas.openxmlformats.org/markup-compatibility/2006"">" & _
 "<xmlns:o=""urn:schemas-microsoft-com:office:office"">" & _
 "<xmlns : r = ""http://schemas.openxmlformats.org/officeDocument/2006/relationships"">" & _
 "<xmlns:m=""http://schemas.openxmlformats.org/officeDocument/2006/math"">" & _
 "<xmlns:v=""urn:schemas-microsoft-com:vml"">" & _
 "<xmlns:wp=""http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"">" & _
 "<xmlns:w10=""urn:schemas-microsoft-com:office:word"">" & _
 "<xmlns:w=""http://schemas.openxmlformats.org/wordprocessingml/2006/main"">" & _
 "<xmlns:wne=""http://schemas.microsoft.com/office/word/2006/wordml"">" & _
 <w:body><w:p w:rsidR="00D45FD9" w:rsidRDefault="001F2E8F"><m:oMathPara><m:oMath><m:sSup><m:sSupPr><m:ctrlPr><w:rPr><w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/></w:rPr></m:ctrlPr></m:sSupPr><m:e><m:d><m:dPr><m:ctrlPr><w:rPr><w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/></w:rPr></m:ctrlPr></m:dPr><m:e><m:r><w:rPr><w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/></w:rPr><m:t>x+a</m:t></m:r></m:e></m:d></m:e><m:sup><m:r><w:rPr><w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/></w:rPr><m:t>n</m:t></m:r></m:sup></m:sSup><m:r><w:rPr><w:rFonts w:ascii="Cambria Math" w:eastAsia="Cambria Math" w:hAnsi="Cambria Math" w:cs="Cambria Math"/></w:rPr><m:t>=</m:t></m:r><m:nary><m:naryPr><m:chr m:val="∑"/><m:grow m:val="on"/><m:ctrlPr><w:rPr><w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/></w:rPr></m:ctrlPr></m:naryPr><m:sub><m:r><w:rPr><w:rFonts w:ascii="Cambria Math" w:eastAsia="Cambria Math" w:hAnsi="Cambria Math" w:cs="Cambria Math"/></w:rPr><m:t>k=0</m:t></m:r></m:sub><m:sup><m:r><w:rPr><w:rFonts w:ascii="Cambria Math" w:eastAsia="Cambria Math" w:hAnsi="Cambria Math" w:cs="Cambria Math"/></w:rPr><m:t>n</m:t></m:r></m:sup><m:e><m:d><m:dPr><m:ctrlPr><w:rPr><w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/></w:rPr></m:ctrlPr></m:dPr><m:e><m:f><m:fPr><m:type m:val="noBar"/><m:ctrlPr><w:rPr><w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/></w:rPr></m:ctrlPr></m:fPr><m:num><m:r><w:rPr><w:rFonts w:ascii="Cambria Math" w:eastAsia="Cambria Math" w:hAnsi="Cambria Math" w:cs="Cambria Math"/></w:rPr><m:t>n</m:t></m:r></m:num><m:den><m:r><w:rPr><w:rFonts w:ascii="Cambria Math" w:eastAsia="Cambria Math" w:hAnsi="Cambria Math" w:cs="Cambria Math"/></w:rPr><m:t>k</m:t></m:r></m:den></m:f></m:e></m:d><m:sSup><m:sSupPr><m:ctrlPr><w:rPr><w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/></w:rPr></m:ctrlPr></m:sSupPr><m:e><m:r><w:rPr><w:rFonts w:ascii="Cambria Math" w:eastAsia="Cambria Math" w:hAnsi="Cambria Math" w:cs="Cambria Math"/></w:rPr><m:t>x</m:t></m:r></m:e><m:sup><m:r><w:rPr><w:rFonts w:ascii="Cambria Math" w:eastAsia="Cambria Math" w:hAnsi="Cambria Math" w:cs="Cambria Math"/></w:rPr><m:t>k</m:t></m:r></m:sup></m:sSup><m:sSup><m:sSupPr><m:ctrlPr><w:rPr><w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/></w:rPr></m:ctrlPr></m:sSupPr><m:e><m:r><w:rPr><w:rFonts w:ascii="Cambria Math" w:eastAsia="Cambria Math" w:hAnsi="Cambria Math" w:cs="Cambria Math"/></w:rPr><m:t>a</m:t></m:r></m:e><m:sup><m:r><w:rPr><w:rFonts w:ascii="Cambria Math" w:eastAsia="Cambria Math" w:hAnsi="Cambria Math" w:cs="Cambria Math"/></w:rPr><m:t>n-k</m:t></m:r></m:sup></m:sSup></m:e></m:nary></m:oMath></m:oMathPara></w:p><w:sectPr w:rsidR="00D45FD9" w:rsidSect="00D45FD9"><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/><w:cols w:space="720"/><w:docGrid w:linePitch="360"/></w:sectPr></w:body></w:document>
 

 
        Dim stream1 As Stream = part.GetStream
        Dim utf8encoder1 As UTF8Encoding = New UTF8Encoding()
        Dim buf() As Byte = utf8encoder1.GetBytes(Docxml)
        stream1.Write(buf, 0, buf.Length)
    End Sub
Posted 28-Mar-13 20:47pm
aviporje1.1K
Comments
Sandeep Mewara 29-Mar-13 5:26am
   
at?

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

You don't have the <wbody> section wrapped in quotes (or double quotes), and all of the double quotes within that string need to be doubled up.
  Permalink  
Comments
aviporje 30-Mar-13 11:29am
   
Thanks H.Brydon Acctully I Want Store Word file in access record Like Objective Question & Answer Wich Retrive From Access as xml Body To Word 2007 using open XML Format
I Tryying using Many Possbilities But Cant
H.Brydon 30-Mar-13 14:54pm
   
If you have to include a large amount of xml in your VB.NET source, I'd suggest getting the syntax and quotes lined up correctly with a small/trivial amount of xml and build up to the huge string you have here. There are too many places you can forget a quote, and the compiler will not help you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 29 Mar 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100