« External Data/004 » : différence entre les versions
De Semantic MediaWiki - Sandbox
(→) |
|||
Ligne 36 : | Ligne 36 : | ||
==Conclusion== | ==Conclusion== | ||
External Data's use of xpath cannot return: | External Data's use of xpath cannot return: | ||
# internal XML tags as '''part''' of the desired string (Loman1, Loman 2 above), where the <w></w> tags are | # internal XML tags as '''part''' of the desired string (Loman1, Loman 2 above), where the <w></w> tags are simply ignored | ||
# nested XML tags (here p tags) around the desired string, which | # nested XML tags (here p tags) around the desired string (Comment above), which simply triggers an error message. (here: Error: no local variable "Comment" was set.) | ||
[[Category:External Data examples]] | [[Category:External Data examples]] |
Dernière version du 16 septembre 2017 à 11:29
Source
External Data/004/source - excerpt from http://www.asnc.cam.ac.uk/irishglossaries/xml/Loman.xml
#get_web_data
{{#get_web_data: url={{fullurl:External Data/004/source|action=raw}} |format=XML |use xpath |delimiter=, |data=Loman1=//body/div/p[@xml:id='Loman.10'],Loman2=//body/div/p[10],Comment=//comment }}
#external_value
- Loman1
.i. lot-te .i. lotan ar tige í 7 tess indti.
- Loman2
.i. lot-te .i. lotan ar tige í 7 tess indti.
- but really should have been
<w type="hw">Lite</w> .i. lot-te .i. lotan ar tige í 7 tess indti.
- Comment with paragraph tags
Erreur : aucune variable locale « Comment » n’a été définie.
Should have rendered
<comment><p>This comment has been added</p></comment>
Conclusion
External Data's use of xpath cannot return:
- internal XML tags as part of the desired string (Loman1, Loman 2 above), where the <w></w> tags are simply ignored
- nested XML tags (here p tags) around the desired string (Comment above), which simply triggers an error message. (here: Error: no local variable "Comment" was set.)