Free Support Forum - aspose.com

Xpath question with Wordml document

I have download the trial version of aspose words..The question is my original document is wordml (xml) that has nodes. Now if i want to insert html at particular node how do i move to that node.

for eg if the node has xpath of "//ns0:DataSet//ns0:Table//ns0:MyField"

i cant use

Document.selectnodes(xpath) as there is no option to set namespace mgr(provided by word interop)

So i can never get to the node where i want to insert html.

I want something like this

DocumentBuilder builder = new DocumentBuilder(doc);

foreach(Node n in mynodelist) //mynodelist is nodelist from doc.selectnodes

{

builder.moveTo(n);

builder.Inserthtml(myhtml);

}

Secondly

I want to format document to have arial font 9 and remove all formattings done by html string(Like background color.). How can i do that using ASPOSE Words

Regards

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. The easiest way is inserting bookmarks into your document. Then you will be able to use DocumentBuilder.MoveToBookmark method. Also if your nodes are paragraphs or runs then you can use DocumentBuilder.MoveTo method. For more information see the following link.

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/aspose.words.documentbuilder.moveto.html

Also please provide me your code and attach your document for investigating.

Best regards.