Hi,
after discussion with some colleagues here in Hamburg I want to describe
how a solution could look like:
The Writer has two possible content types that could be extended to
support the citation element (and other elements generically)
The first is the text field (com.sun.star.text.TextField). A generic
field service could be added to the API of the Writer that would have a
property that contains a DOM tree. This DOM tree contains the
citation-element. The bibliography creates the DOM tree of those fields
and inserts them into the text together with a string that contains the
presentation text.
Such fields can only be formatted as a whole. It is not possible to have
e.g. parts of this presentation printed in bold. This text can not be
spanned over paragraphs. The text cannot be changed manually.
Another possible solution is to add a new object that is similar to
bookmarks (com.sun.star.text.Bookmark). This extended bookmark would
also carry a DOM tree property. This 'bookmark' can span over formatted
text longer than a paragraph. The user can modify the text inside of
this bookmark easily.
In both cases an interface to access the new elements needs to be
implemented (sorted by document position).
The DOM interfaces are in com.sun.star.xml.dom.
(e.g. XDocument.idl, XNode.idl, XElement.idl)
There's also a service com.sun.star.xml.dom.DocumentBuilder available
that supports the creation of DOM trees.
The bibliography component works on the DOM tree and can manipulate it
independently. In case of using a field the component has to set the
resulting string representation of the reference at this field.
Using the field is a bit easier and using the bookmark is more powerful.
Regards,
Oliver
CPHennessy wrote:
Hi,
I'm trying to help the bibliographic implement the OASIS approved changes to
the bibliographic datamodel. However I am unsure how this should be stored
(i.e. what is the right data structures storing this information).
The XML elements and attributes are listed below, and one of the early
requirements is that the data can be manipulated thru a UNO API. It is
envisioned that the bibliographic developers will prototype the UI for
manipulating this data.
So what I am looking for is :
- a direction for which is the best development approach (maybe an example
class based on the data below and needs above);
- at what stage is a spec needed ?
- any other hints
On Sat January 14 2006 16:40, Bruce D'Arcus wrote:
Here's the schema in RELAX NG Compact with comments (probably easier to
read):
====
# Citation schema copyright Bruce D'Arcus, based on related work
# for DocBook with Peter Flynn and Markus Hoenicka, and for OpenOffice
# with Daniel Vogelheim. It has been approved by the OASIS OpenOffice
# TC for inclusion in the open file format.
default namespace cite = "http://purl.org/NET/xbiblio/cite/1.0"
start = citation-element
## A citation consists of two elements; one the structural source data
## and the other the presentational display.
citation-element = element cite:citation {
citation-source-element,
citation-body-element?
}
## The source element consists of one-or-more biblioref elements, which
## are the references within the citation. For example, the citation
## (Doe, 1999; Smith, 2000) contains two references.
citation-source-element = element cite:citation-source {
biblioref-element+
}
## In fields across the social sciences and humanities, it is
## common for citations to include further detail, including
## more specific point citations (for example, page numbers)
## as well as captions. We allow more than one detail element
## to allow for coding such as (Doe, 1999: pages 1, 2, 3-5) or
## (Doe, 1999: page 2, paragraph 3).
biblioref-element = element cite:biblioref {
detail-element*,
caption-element*,
biblioref-attlist
}
## Key is the pointer to the bibliographic record ID.
# note: add cite:style attribute to allow local styling
biblioref-attlist &= attribute cite:key { token }, attribute cite:style
{ token }
## The detail element captures point citation information
## such as cited page numbers.
detail-element = element cite:detail { detail-attlist }
detail-attlist = attribute cite:begin { xsd:string },
attribute cite:end { xsd:string }?,
attribute cite:units {
"chapters"
| "figures"
| "formulas"
| "lines"
| "pages"
| "paragraphs"
| "parts"
| "sections"
}
## For examples such as (for more on this, see Doe, 1999).
caption-element = element cite:caption {
caption-attlist,
cite.text-content
}
caption-attlist = attribute cite:position { "before" | "after" }
## The element to contain the rendered code is uncontrolled.
citation-body-element = element cite:citation-body { cite.text-content }
cite.text-content =
element * {
mixed {
(cite.text-content
| attribute * { text })*
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]