Florian, When the XINCLUDE option is enabled, xpointers are automatically executed. /xpointer/ attribute has to be used on an /<include/>/ element (/href/ one is required to point on the xml document) With this xml contents: in *yourdb/linking.xml:* <Links*xmlns:xi="http://www.w3.org/2001/XInclude"*> <Link> (linking activities with requirements) <*xi:include href=*”requirements-db.xml” x*pointer=”element(/path/to/activity/with/activity-id-node)”*/> * <*xi:include href*=”bpmn-db.xml” *xpointer=”element*(*/path/to/requirement/with/requirement-id-node)*”/> * </Link> </Links> * Unfortunately, element scheme with node IDs is not well implemented (according to my tests) unless your documents are validating against a DTD (link <http://www.w3.org/TR/xptr-framework/#term-ddi>). When you'll execute this query (on the REST interface for example): doc('yourdb/linking.xml')/links/link[1] will returned: <Link> (linking activities with requirements) <Activity Id=”activity-id”> … </Activity> <Requirement Id=”requirement-id”> … </Requirement> </Link> Hope this helps, Jérôme. Le 27/04/2015 15:35, Eckey, Florian a écrit :
Hi Jérôme,
thanks for your input. Following situation: I have two documents in different xml databases (basex). On the one side a business process model document (bpmn 2.0) and on the other side a requirements specification document. These documents have to be consistent. One approach to handle consistency is linking specific elements of both documents with each other. In my approach, i need to link activities (xml nodes) and specific requirements (xml nodes) with each other. So the second approach seems to fit best. I understand the syntax of this approach, but one time I have to evaluate this xpointer expressions. Is the evaluation implemented anywhere? Or how can I do this?
Maybe I even don’t need xinclude, but rather something like this (more similar to xlink; linking in an external document):
Business process document (xml database in basex):
<Package>
…
<Activity Id=”activity-id”>
…
</Activity>
…
</Package>
Business process document (xml database in basex):
<Requirements>
…
<Requirement Id=”requirement-id”>
…
</Requirement>
…
</Requirements >
Linking:
<Links>
<Link> (linking activities with requirements)
<Locator href=”requirements-db” xpointer=”element(Activity[@Id=$activity-id])”/> (use xinclude here feels wrong)
<Locator href=”bpmn-db” xpointer=”element(Requirement[@Id=$requirement-id])”/>
</Link>
</Links>
Is there something similar? Especially to execute xpointer? Or do I have to implement it on my own?
Thanks for your answers.
Regards.
Florian
*Von:*basex-talk-bounces@mailman.uni-konstanz.de [mailto:basex-talk-bounces@mailman.uni-konstanz.de] *Im Auftrag von *Jérôme Chauveau *Gesendet:* Montag, 27. April 2015 15:07 *An:* basex-talk@mailman.uni-konstanz.de *Betreff:* Re: [basex-talk] XLink and XPointer
Hi Florian,
The XINCLUDE Option is enabled in the default BaseX configuration. Which kind of xpointer link do you need?
Those 2 inclusion types seems to be well-implemented is the Java XInclude support (xinclude implementation used in BaseX):
1 - full document inclusion: <xi:include href='myDocument.xml'/> 2 - Fragment inclusion: <xi:include href='myDocument.xml' xpointer='element(/1/path/to/fragment' />
Hope this helps,
Regards.
Jérôme
Le 27/04/2015 13:29, Eckey, Florian a écrit :
Hello,
i am actually writing my master thesis using basex for xml processing. I need to create consistency links between two xml documents, especially basex databases and its content. So I am certainly looking for xlink and xpointer implementations in basex. Are there any examples to do this with basex or if not, has anyone implemented an xquery version to execute it? I recoginzed that there are capabilities with xinclude. But I does not find any references of xinclude in basex, unless this: http://docs.basex.org/wiki/Options#XINCLUDE
So has anyone ideas or experiences using xlink and especially xpointer with basex or xquery?
Regards,
Florian
------------------------------------------------------- >>> business. people. technology. <<< -------------------------------------------------------
adesso AG mit Sitz in Dortmund Vorstand: Michael Kenfenheuer (Co-Vors.), Dr. Rüdiger Striemer (Co-Vors.), Christoph Junge, Andreas Prenneis Vorsitzender des Aufsichtsrates: Prof. Dr. Volker Gruhn Amtsgericht Dortmund HRB 20663
-- Jérôme Chauveau - CERTIC-DSI - Campus I Université de Caen Basse-Normandie
-- Jérôme Chauveau - CERTIC-DSI - Campus I Université de Caen Basse-Normandie