XPath - complex queries

0
Hello, I have following schema - http://www2.pic-upload.de/img/30903969/schema.png. How could I realize following queries (I think I must save the results from first part (email adress) of query because the two "tables" are joined over the email attribute). 1) Print all the names of the persons who have wrote an email to vorname="Anna" and nachname="Kraus". 2) Print all the persons (vorname and nachname) who has sent an email. 3) Print all elements from al phots which were uploaded by vorname="Anna" and nachname="Kraus".
asked
3 answers
1

Optimized is that:

[MyFirstModule.Nachricht_Freund/MyFirstModule.Freund/MyFirstModule.Freund_Personen/MyFirstModule.Personen 
[vorname = 'Anna' and nachname = 'Kraus']]
answered
0

Here you can find the whole xml file - http://www.file-upload.net/download-11665751/social.xml.html

answered
0

I recreated your schema. Let's assume you are linking many Nachricht objects to one Fruend Object, and many Fruend Objects to one Personen object. In English, A person can have multiple emails, and each email account can be related to multiple Emails. I would tackle your queries as such:

  1. Something like this in Xpath, or break it up if necessary (didn't have time to build data and test). Retrieve from the Personen entity [MyFirstModule.Freund_Personen/MyFirstModule.Freund/MyFirstModule.Nachricht_Freund/MyFirstModule.Nachricht/ MyFirstModule.Nachricht_Freund/MyFirstModule.Freund/MyFirstModule.Freund_Personen/MyFirstModule.Personen/vorname = 'Anna'] [MyFirstModule.Freund_Personen/MyFirstModule.Freund/MyFirstModule.Nachricht_Freund/MyFirstModule.Nachricht/ MyFirstModule.Nachricht_Freund/MyFirstModule.Freund/MyFirstModule.Freund_Personen/MyFirstModule.Personen/vorname = 'Kraus']

  2. Retrieve from the Personen Entity [MyFirstModule.Freund_Personen/MyFirstModule.Freund/MyFirstModule.Nachricht_Freund/MyFirstModule.Nachricht]

  3. Retrieve from the Nachricht Entity [MyFirstModule.Nachricht_Freund/MyFirstModule.Freund/MyFirstModule.Freund_Personen/MyFirstModule.Personen/vorname = 'Anna'] [MyFirstModule.Nachricht_Freund/MyFirstModule.Freund/MyFirstModule.Freund_Personen/MyFirstModule.Personen/nachname = 'Kraus']

answered