[Home] [By Thread] [By Date] [Recent Entries]
Hi,
Hi list, I am having a problem with my XSLT that is driving me nut. I have the following XML file: <rdf:RDF> <policy:Policy rdf:ID="policy_N100CE"> <deontic:actor rdf:resource="constraint_N10101"/> <policy:grants rdf:resource="deontic_N100D1"/> <policy:context rdf:resource="context_N100D9"/> </policy:Policy> <deontic:Permission rdf:ID="deontic_N100D1"> <deontic:actor rdf:resource="constraint_N10101"/> <deontic:action rdf:resource="http://ontology.ihmc.us/PolicyAction.owl#AddPolicyAction"/> <deontic:constraint rdf:resource="constraint_N100EB"/> </deontic:Permission> <constraint:SimpleConstriant rdf:ID="context_N100D9"> <constraint:subject rdf:resource="urn:KAoS#AddPolicyAction-Subclass-For-Policy-0cf0108c-010f-0000-8000-0000deadbeef-For-Property-ControlInstances0"/> <constraint:object rdf:resource="constraint_N100CE"/> <constraint:predicate rdf:resource="http://ontology.ihmc.us/PolicyAction.owl#involvedPolicy"/> </constraint:SimpleConstriant> <constraint:SimpleConstriant rdf:ID="constraint_N100CE"> <constraint:subject rdf:resource="urn:KAoS#AddPolicyAction-Subclass-For-Policy-0cf0108c-010f-0000-8000-0000deadbeef-For-Property-ControlInstances0"/> <constraint:object rdf:resource="http://ontology.ihmc.us/ActionStatus.owl#Accepted"/> <constraint:predicate rdf:resource="http://example.lornet.sfu.ca/nkaviani/departments/objects/instances.owl#value"/> </constraint:SimpleConstriant> <constraint:SimpleConstriant rdf:ID="context_N100D9"> <constraint:subject rdf:resource="urn:KAoS#AddPolicyAction-Subclass-For-Policy-0cf0108c-010f-0000-8000-0000deadbeef-For-Property-ControlInstances1"/> <constraint:object rdf:resource="constraint_N100CE"/> <constraint:predicate rdf:resource="http://ontology.ihmc.us/Action.owl#hasObjectContext"/> </constraint:SimpleConstriant> </rdf:RDF> and I have used the following construct to store some of the elements in a variable based on an equality between the values of the attributes: <xsl:param name="contextID" select="policy:context/@rdf:resource"/> <xsl:variable name="contexts"> <xsl:copy-of select="//constraint:SimpleConstriant[@rdf:ID = $contextID]"/> </xsl:variable> apparantly the variable "contexts" has stored the relevant information but when I try to read it, using for-each or whatever else, nothing is displayed. so the code below is not working: <xsl:for-each select="xalan:nodeset($contexts)"> <xsl:value-of select="constraint:SimpleConstriant/@rdf:ID"/> </xsl:for-each> while <xsl:copy-of select="xalan:nodeset$contexts)"/> shows that the desired values are stored in the variable. any help please? thanks, -Nima
|

Cart



