[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Cross reference question

Subject: RE: Cross reference question
From: Fredrik <faid@xxxxxxxxxx>
Date: Wed, 30 Mar 2005 18:51:45 +0200
menmachine
At 17:21 2005-03-30 +0100, you wrote:
XSLT can only operate on files that are namespace-well-formed, and a
namespace-well-formed document can't have two colons in a name.
Not knowing RDF, I'm not sure which node you are referring to when you
mention "the node called AdvancedKnowledgeTechnology". You have several
(attribute) nodes here with "AdvancedKnowledgeTechnology" in their content,
but no nodes with this as their name.
Michael Kay
http://www.saxonica.com/


I'm not getting any errors when the file is processed, so I can assume that there is nothing wrong with the formatting.
My terminology isn't spot on so sorry about the confusion. I can print all nodes and their attributes (in sequence!)
but what I'm looking for here is that when I locate this node:


<rdf_:myns:isCourseOf rdf:resource="MenMachine"/>

I want to use the value "MenMachine" to find this node:

<rdf:Description rdf:about="MenMachine"
        rdf_:myns:ProgrammeName="Mens-Machine
        Communicatie en Artificial Intelligence" rdfs:label="MenMachine">

By looking at the rdf:about attribute, because this node contains the attribute rdf_:myns:ProgrammeName which I want to print.
I want to make a transformation to XHTML; a table with two columns: the first is the name of the course, the second
is the name of the programme. However, as you can see I don't have enough information in the node <rdf:Description rdf:about="AdvancedKnowledgeTechnology"
rdf_:myns:CourseECTS="5.0"
rdf_:myns:CourseName="Advanced Knowledge Technology"
rdfs:label="AdvancedKnowledgeTechnology">


and it's children to do this. I do, however, have a "reference", and that's the one I want to use to find additional information.

- Fredrik Henricsson



> -----Original Message-----
> From: Fredrik [mailto:faid@xxxxxxxxxx]
> Sent: 30 March 2005 16:47
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Cross reference question
>
> Hey,
>
> Just started with XSL and I'm guessing my problem is pretty
> simple, but I
> haven't been able to find any examples.
> I'm wondering how I can access the attribute ProgrammeName
> below while I'm
> processing the node called AdvancedKnowledgeTechnology. I
> thought I would
> use the attribute of isCourseOf to find it, but... how?
> XML file below, current XSL file further down.
>
>
> <rdf:RDF
>       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>       xmlns:rdf_="http://protege.stanford.edu/rdf"
>       xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
>
>       <rdf:Description rdf:about="AdvancedKnowledgeTechnology"
>               rdf_:myns:CourseECTS="5.0"
>               rdf_:myns:CourseName="Advanced Knowledge Technology"
>               rdfs:label="AdvancedKnowledgeTechnology">
>               <rdf_:myns:isCourseOf rdf:resource="MenMachine"/>
>               <rdf:type rdf:resource="myns:Course"/>
>       </rdf:Description>
>       <!-- ... some other similar nodes in between -->
>       <rdf:Description rdf:about="MenMachine"
>               rdf_:myns:ProgrammeName="Mens-Machine
> Communicatie en Artificial
> Intelligence"
>               rdfs:label="MenMachine">
>               <rdf_:myns:hasCourse
> rdf:resource="AdvancedKnowledgeTechnology"/>
>               <rdf_:myns:isProgrammeOf rdf:resource="GroningenRUG"/>
>               <rdf:type rdf:resource="myns:ProgrammeAI"/>
>       </rdf:Description>
>       <!-- some other similar nodes after this one ... -->
> </rdf:RDF>
>
> <!-- For each description -->
> <xsl:for-each select="//*">
>       <br></br>
>       <!-- If it's a course.. -->
>       <xsl:if test="contains(local-name(), 'isCourseOf')">
>               <!-- Check which programme the course belongs to -->
>       </xsl:if>
>       <!-- For each attribute of the description -->
>       <xsl:for-each select="@*">
>               <!-- print selected attributes -->
>       </xsl:for-each><br></br>
> </xsl:for-each>
>
> Thanks,
> Fredrik Henricsson

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.