[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [office] Re: [office-comment] Re: my comments on the numberingspec proposal discussed by David F. andFlorian R.
Hi, here comes the conversion algorithm. First converting a list defined using <text:numbered-paragraph> into a list defined using <text:list>: Example: We've got the following list styles in our text document - L1, L2 and L3 We formed the following list: <text:numbered-paragraph text:level="1" text:list-id="MyList1" text:style-name="L1"> <text:p text:style-name="P1">Main chapter</text:p> </text:numbered-paragraph> <text:numbered-paragraph text:level="2" text:list-id="MyList1" text:style-name="L2"> <text:p text:style-name="P2">Foo</text:p> </text:numbered-paragraph> <text:numbered-paragraph text:level="2" text:list-id="MyList1" text:style-name="L2"> <text:p text:style-name="P2">Bar</text:p> </text:numbered-paragraph> <text:numbered-paragraph text:level="2" text:list-id="MyList1" text:style-name="L3"> <text:p text:style-name="P2">annex</text:p> </text:numbered-paragraph> <text:numbered-paragraph text:level="2" text:list-id="MyList1" text:style-name="L3"> <text:p text:style-name="P2">Another annex</text:p> </text:numbered-paragraph> Because all <text:numbered-paragraph> items have the same value for text:list-id, they all belong to the same list. Algorithm: (1) First, you have to choose a certain list style for the top <text:list> element. The best would be to choose the list style, which is used most in the list defined via <text:numbered-paragraph>. In the given example this is list style "L1" (2) Build up <text:list-item> hierachy corresponding to the text:level attribute of the <text:numbered-paragraph> items. For each <text:numbered-paragraph> item, whose list style differs from the one choosen in step (1), include a text:style-override attribute, whose value has to be set to list style, which is used by the <text:numbered-pararaph> item. Applying these steps to the above given example will result in the following list defined using <text:list>: <text:list text:style-name="L1"> <text:list-item> <text:p text:style-name="P1">Main chapter</text:p> </text:list-item> <text:list> <text:list-item> <text:p text:style-name="P2">Foo</text:p> </text:list-item> <text:list-item> <text:p text:style-name="P2">Bar</text:p> </text:list-item> <text:list-item text:style-override="L2"> <text:p text:style-name="P2">annex</text:p> </text:list-item> <text:list-item text:style-override="L3"> <text:p text:style-name="P2">Another annex</text:p> </text:list-item> </text:list> </text:list> Now the other way of the conversion: Taking the above list defined by using <text:list>. (1) First, you have to choose an list-id for the list defined by using <text:list>. I would suggest to choose the name of list style of the top <text-list> followed by an underscore followed by a unique number. For the given example I would choose "L1_87232343" as the list-id (2) Transform each <text:list-item> item into a <text:numbered-paragraph> item with the following constraints for its attributes: - value of text:style-name is the value of the text:style-override attribute, if it exists. Otherwise it's the name of the list-style, which is applied to this <text:list-item> item. - value of text:list-id is the chosen list-id from step (1) Applying these steps to the above given example will result in the following list defined using <text:numbered-paragraph>: <text:numbered-paragraph text:level="1" text:list-id="L1_87232343" text:style-name="L1"> <text:p text:style-name="P1">Main chapter</text:p> </text:numbered-paragraph> <text:numbered-paragraph text:level="2" text:list-id="L1_87232343" text:style-name="L2"> <text:p text:style-name="P2">Foo</text:p> </text:numbered-paragraph> <text:numbered-paragraph text:level="2" text:list-id="L1_87232343" text:style-name="L2"> <text:p text:style-name="P2">Bar</text:p> </text:numbered-paragraph> <text:numbered-paragraph text:level="2" text:list-id="L1_87232343" text:style-name="L3"> <text:p text:style-name="P2">annex</text:p> </text:numbered-paragraph> <text:numbered-paragraph text:level="2" text:list-id="L1_87232343" text:style-name="L3"> <text:p text:style-name="P2">Another annex</text:p> </text:numbered-paragraph> Regards, Oliver. Florian Reuter schrieb: > Hi Oliver, > > your proposal/suggestion/comment seems to violate the statement explicitly made in the ODF spec: > "A list in <text:list> representation could be converted into a list in <text:numbered-paragraph> representation and > vice versa." > > I therfore disagree with your proposal/suggestion/comment. > > ~Florian > > >>>> Oliver-Rainer Wittmann - Software Engineer - Sun Microsystems <Oliver-Rainer.Wittmann@Sun.COM> 01/09/07 12:14 PM >>> > David Faure wrote: >> On Monday 11 December 2006 17:22, Michael Brauer - Sun Germany - ham02 - Hamburg wrote: >>> Hi, >>> >>> The original ODF list concept is that we have <text:list> elements in the content, and a >>> list style. Each list has its own numbering. That is, if I have two <text:list> elements >>> they both start with 1. >> This seems sensible. Note that it contradicts Oliver's interpretation ("If you want to use the same list >> style for two separate lists, then you have to define for the second list, that the numbering has to restart.") >> >>> When using <text:list> elements the list styles only specifies the >>> layout of the list. The lists themselves are identified by <text:list> elements, but not >>> by the style name. >>> The only problem we have is that we cannot change the style within a >>> list. The style:overwrite attribute that has been proposed would solve this. >> ... so you would agree with the style:overwrite attribute being a text:list-item attribute rather than text:list > attribute, right? >> Otherwise you need two <text:list>s to change the style and this breaks the structure. >> E.g. my 1/2/3/A/B example should be modelled as only one text:list, not two. >> Another example would be differently-numbered subsections, like: >> 1. >> 1.1. >> 1.2. >> 2. >> 2.A) >> 2.B) >> In this example it really is just one list, otherwise the numbering will end up being wrong. >> This example also shows why we (koffice) dislike the "define 10 levels in one list style". >> Not all items in this list use the same style. style-override at the item level solves this indeed, >> although it requires that one style is the "normal" one and the other one is the "override" >> With text:numbered-paragraph and one level per list style, the above would simply 6 numbered >> paragraphs pointing to whichever style they want to use. >> >> ==== >> >> To be fair, if OOo is supposed to be implement text:list correctly, then I'm still very confused >> by the semantics. For instance if I increase the level (e.g. using the tab key) I get two paragraphs >> with the same number, see attached document. For 4 paragraphs of depths of 1/1/2/2, I would >> expect to get A/B/a/b or A/B/1/2 or A/B/<nothing>/<nothing> or A/B/A/B if the same style is >> defined for level 2, but certainly not A/B/B/C !? >> >> Why does ODF define 10 levels in one style, while even the OOo GUI doesn't do that? "Numbering 4" >> is "A) B) C) D)", but doesn't say anything about what happens at level 2 and below. >> Not that I would want it to :) But then I would assume that A) B) is used at level 2 as well, unless >> I select another numbering style for those paragraphs. >> >>> We later introduced <text:numbered-paragraph> elements. The problem we face here is that >>> we don't have a <text:list> element, and therefore no way to decide to which list (or >>> numbering) they belong. One option would be to define that they all belong to the same >>> numbering, and to add an attribute that starts the numbering at a certain paragraph. Other >>> options are to re-use the list-style, or to use list-ids. I don't have a clear opinion >>> what is the best solution, but I think it is a different issue than the one for the list >>> elements, and we should discuss it independent of it. >> I agree, that the issue is different and should be solved independently. >> >> "All belong to the same numbering" is actually more or less what we do in koffice. >> For any numbered paragraph, we go up and find other numbered paragraphs of the same level >> to find out what this paragraph's number is; and any upper-level (or outline) paragraph stops >> the search. >> >> However the notion of a list-id for a bit more structure sounds nice, and from what I recall, >> MSWord lists also have the equivalent of a list-id, this is where this idea mostly comes from. >> > > Hi all, > > ok, my interpretation of the list style is some how OpenOffice.org driven. > I agree that each <text:list> element starts a new list. OpenOffice.org > uses attribute text:continue-numbering="true" to achieve the > interpretation, that all lists using the same list style belong together. > > I propose that all <text:numbered-paragraph> by default should belong to > *one* list. Thus, by <text:numbered-paragraph> a list with different > list styles is possible. > > I propose to introduce the attribute text:style-override for the > <text:list-item> element to support different list styles inside a list > defined by the <text:list> element. > > I propose to introduce the attribute text:list-id for the > <text:numbered-paragraph> element to define a group of > <text:numbered-paragraph> element to belong to an own list. > > Regards, Oliver. > > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]