Problem using OODoc::Meta and customer user properties.

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Using Jean-Maries rather useful OODoc::Meta to try and automate
some invoice manipulatiom. However the docs say not to use its
used_defined() function. But how else do i extract a list of all
defined user properity names for a document.

The preferred method getUserPropertyElements() returns a list of
all user properites but does not allow me to discover there names.

Am I missing something?

Re: Problem using OODoc::Meta and customer user properties.

Quoth (Fergus McMenemie):
Quoted text here. Click to load it

When in doubt, read the source:

    sub user_defined {
        my $self = shift;

        my @elements = $self->getElementList('//meta:user-defined');

        my %fields = ();
        foreach my $element (@elements) {
            my $name        = $self->getAttribute($element, 'meta:name');
            my $content        = $self->getText($element);
            $fields  = $content;

        return %fields;

    sub getUserPropertyElements {
        my $self = shift;
        return $self->getElementList('//meta:user-defined');

(reformatted and abbreviated, obviously; that module has seriously
bizarre formatting...). So by the looks of things you can use
$doc->getAttribute($element, "meta:name") to extract a property's name.


Site Timeline