Problems with a dsld script

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems with a dsld script

ThorQue
Hello,

I have this dsld-script:

currentType(NodeChildren ).accept {
property(name: "Item", type:NodeChildren, doc:"bla1");
property(name: "ItemAttributes", type: NodeChildren)
}

This works fine, but what i really want is this structure:

element.Items.Item.ItemAttribute and so on.

Every property is from the type NodeChildren. So I need another differentiator:
currentType(NodeChildren && name("Items").accept {
property(name: "Item", type:NodeChildren, doc:"
}

currentType(NodeChildren && node("Item") ).accept {
property(name: "ItemAttributes", type: NodeChildren)
}



This doesn't work :( Is there another solution?

Thanks 
Thorsten
Reply | Threaded
Open this post in threaded view
|

Re: Problems with a dsld script

Andrew Eisenberg
Try this pointcut:

contribute ( currentType('NodeChildren') & currentIdentifier('item') ) {

}

The quotes around 'NodeChildren' are important.

On Fri, Jan 20, 2012 at 5:13 AM, Thorsten Kamann
<[hidden email]> wrote:

> Hello,
>
> I have this dsld-script:
>
> currentType(NodeChildren ).accept {
> property(name: "Item", type:NodeChildren, doc:"bla1");
> property(name: "ItemAttributes", type: NodeChildren)
> }
>
> This works fine, but what i really want is this structure:
>
> element.Items.Item.ItemAttribute and so on.
>
> Every property is from the type NodeChildren. So I need another
> differentiator:
> currentType(NodeChildren && name("Items").accept {
> property(name: "Item", type:NodeChildren, doc:"
> }
>
> currentType(NodeChildren && node("Item") ).accept {
> property(name: "ItemAttributes", type: NodeChildren)
> }
>
> …
>
>
> This doesn't work :( Is there another solution?
>
> Thanks
> Thorsten

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email