Is there a way to add a caption to a Frame that has a graphic in it? I can simply add text below a figure, but I would like the captions to be sequences so that I could then build a table of contents. Below is a snippet of xml from an ODT content.xml file that shows what I need (written from OpenOffice). A little bit from the end is a text: sequence element. How do I add this using AODL? The graphics are no problem it's just the sequence that I'm lost on. Is there an easy way to keep the emoticons from taking over?I had to put a space after every ":" below to keep them from showing up..
Post edited by: bradley.campbell, at: 2007/03/16 23:03
The administrator has disabled public write access.
Re:Captions
Date: 2007/03/27 04:35
By: Lars B
Status: Admin
Karma: 1  
Admin
Posts: 33
Hi,
up to now this isn't implemented. As a work around you can insert your "XML sequence node" directly by accessing the content node of the frame.
Regards Lars
The administrator has disabled public write access.
Re:Captions
Date: 2007/05/04 00:12
By: Brad Campbell
Status: User
Karma: 0  
Junior Boarder
Posts: 9
I'm not that familiar with the .NET xml classes. Would you be able to provide a code snippet of how to approach this?
Thanks again, Brad
The administrator has disabled public write access.
Re:Captions
Date: 2007/05/10 03:38
By: Brad Campbell
Status: User
Karma: 0  
Junior Boarder
Posts: 9
I'm so close to having this work. Here is what I have so far:
Code:
//Add Figure title
p = ParagraphBuilder.CreateStandardTextParagraph(doc);
p.TextContent.Add(new SimpleText(doc, "Figure "));
//add the text sequence manually
System.Xml.XmlElement el = doc.XmlDoc.CreateElement(@"text: sequence");
el.SetAttribute(@"text:ref-name", @"refIllsutration0");
el.SetAttribute(@"text:name", @"Illustration");
el.SetAttribute(@"text:formula", @"ooow:Illustration+1");
el.SetAttribute(@"style:num-format",@"1");
i++;
el.InnerText = i.ToString();
p.Node.AppendChild(el);
//add the figure name
p.TextContent.Add(new SimpleText(doc, FigureTitle));
//Add the paragraph to the document
doc.Content.Add(p);
The problem is that in xml element and the attributes the "text:" and "style:" part don't show up in the document. I can edit the content.xml file by hand and it works, but i'm having trouble getting the code to do this properly.
Here is the xml block that the above code produces:
Code:
<text: p text: style-name="Standard">
Figure
<sequence ref-name="refIllsutration0" name="Illustration" formula="ooow:Illustration+1" num-format="1">1</sequence>
. My Figure title
</text: p>
Thanks,
Brad
Post edited by: bradley.campbell, at: 2007/05/10 03:40
Post edited by: bradley.campbell, at: 2007/05/10 03:41
The administrator has disabled public write access.
Re:Captions
Date: 2007/05/10 04:35
By: Brad Campbell
Status: User
Karma: 0  
Junior Boarder
Posts: 9
SUCCESS!!
The code above is almost correct. The XmlElement stuff needs to be as follows:
Code:
//add the text sequence manually
System.Xml.XmlElement el = doc.XmlDoc.CreateElement("text:sequence", "text");
el.SetAttribute("ref-name","text", "refIllsutration0");
el.SetAttribute("name","text", "Illustration");
el.SetAttribute("formula", "text","ooow:Illustration+1");
i++;
el.InnerText = i.ToString();
p.Node.AppendChild(el);
The administrator has disabled public write access.