[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to extract data from RDF written in many different ways
I'm using XSLT to present data from RDF documents to users and run into some problems because of the ambiguous nature of RDF. Below is an example document of RDF that has the same thing, i.e. I'm the creator of this document, expressed in few possible ways. What I'm trying to solve here is how to manage the different tree structures that my stylesheet might have to handle. I would like to gain access to the actual value elements so that I could use them in a template to format the data. The values are (see example RDF in the end): [1] "Jarno Elovirta" [2] "Jarno Elovirta" [3] "Jarno Elovirta" [4] "Jarno Elovirta" [5] "<vc:N rdf:parseType="Resource"> <vc:Family>Elovirta</vc:Family> <vc:Given>Jarno</vc:Given> </vc:N>" [4] "Jarno Elovirta" [5] "<vc:N rdf:parseType="Resource"> <vc:Family>Elovirta</vc:Family> <vc:Given>Jarno</vc:Given> </vc:N>" Also the qualifier element values (if they exist) need to be used in that stylesheet. My first problems arose with the need to define the ordering of multiple occurrences of the same Dublin Core element. Also the fact that I want to use a template for the value presented some problems (don't ask me how, I tried about a million stylesheets). All of this would not be difficult to do if I just wrote a template to handle all the possibilities, but Dublin Core has 15 fields and we use our own fields, too, so writing templates for all possibilities would be... not that good of an idea. So, if there's anyone willing to share their stylesheets on this problem, I'd be grateful. And if there's a simple solution to this I missed, you can publicly shave my legs and call me grandpa! Jarno ======= <?xml version="1.0" encoding="ISO-8859-1"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.0/" xmlns:dcq="http://purl.org/dc/qualifiers/1.0/" xmlns:vc="http://imc.org/vCard/3.0#"> <rdf:Description about="" [1] dc:creator="Jarno Elovirta"> [2] <dc:creator>Jarno Elovirta</dc:creator> [3] <dc:creator rdf:parseType="Resource"> <dcq:creatorType>Author</dcq:creatorType> <dcq:creatorScheme>vCard</dcq:creatorScheme> <rdf:value>Jarno Elovirta</rdf:value> </dc:creator> [4] <dc:creator> <rdf:Description> <dcq:creatorType>Author</dcq:creatorType> <dcq:creatorScheme>vCard</dcq:creatorScheme> <rdf:value>Jarno Elovirta</rdf:value> </rdf:Description> </dc:creator> [5] <dc:creator rdf:parseType="Resource"> <dcq:creatorType>Author</dcq:creatorType> <dcq:creatorScheme>vCard</dcq:creatorScheme> <rdf:value rdf:parseType="Resource"> <vc:N rdf:parseType="Resource"> <vc:Family>Elovirta</vc:Family> <vc:Given>Jarno</vc:Given> </vc:N> </rdf:value> </dc:creator> <dc:creator> <rdf:Bag> [6] <rdf:_1>Jarno Elovirta</rdf:_1> [7] <rdf:_2> <rdf:Description> <dcq:creatorType>Author</dcq:creatorType> <dcq:creatorScheme>vCard</dcq:creatorScheme> <rdf:value> <rdf:Description> <vc:N> <rdf:Description> <vc:Family>Elovirta</vc:Family> <vc:Given>Jarno</vc:Given> </rdf:Description> </vc:N> </rdf:Description> </rdf:value> </rdf:Description> </rdf:_2> </rdf:Bag> </dc:creator> </rdf:Description> </rdf:RDF> BEGIN:VCARD VERSION:2.1 N:Elovirta;Jarno FN:Jarno Elovirta ORG:Evitech;KNIXMAS Project TITLE:Information Technology Engineer TEL;WORK;VOICE:+358 9 511 9845 ADR;WORK:;;;;;;Finland LABEL;WORK:Finland EMAIL;PREF;INTERNET:jarnose@xxxxxxxxxx REV:19990913T062920Z END:VCARD
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|