Page 1 of 1

Attributes window - include data from other documents in pulldown list for xs:IDREF

Posted: Tue Nov 03, 2015 10:00 pm
by MaNI
I have references of the form:

Code: Select all


<xr refdoc="xx.xml" rid="fooid123"/>
Where rid is of type xs:IDREF.
The document in which the node with the matching ID is to be found is contained in 'refdoc'

When I click on xr and go the attributes window, the attributes windows allows a pulldown list of all possible values for rid, however it populated them only from the current document.
Is there a way (possibly via xpath query? Or alternatively some other built in feature?) that I could have the IDREF pulldown instead either:
1) Show ID values from refdoc instead of the current doc
2) Failing that, have it show all ID values from a list of documents (e.g. all documents in the project could be included?)

Re: Attributes window - include data from other documents in pulldown list for xs:IDREF

Posted: Wed Nov 04, 2015 10:33 am
by alex_jitianu
Hello,

You can configure content completion through a configuration file. In this configuration file you can specify that the values are taken by executing an XSLT:

Code: Select all

<match attributeName="type">
<xslt href="../xsl/get_values_from_db.xsl" useCache="false" action="replace"/>
</match>
In your case the file with the IDs is specified in the @refdoc so please take a look how to use the contextElementXPathExpression parameter, in the section Configuring Proposals in the Context for which the Content Completion was Invoked

Best regards,
Alex

Re: Attributes window - include data from other documents in pulldown list for xs:IDREF

Posted: Wed Nov 04, 2015 1:50 pm
by MaNI
Hello,

I think this will work only in 'edit' mode - while what I am looking at here is the " In-place Attributes Editor (Full Version)" inside author mode.
Will this work also for that?

Thanks,
Malcolm

Re: Attributes window - include data from other documents in pulldown list for xs:IDREF

Posted: Wed Nov 04, 2015 4:39 pm
by alex_jitianu
Hello,

Yes, it will work. You are basically contributing to content completion which means that your values will appear everywhere that attribute is being edited: text page, author page, in-place attributes editor etc.

Best regards,
Alex