XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 30th, 2004, 08:56 AM
akbandara akbandara is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 1 akbandara User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Applying template to XPath expression in XML Attribute

I am trying to use an XSL transformation on an XML document of the following form:

Code:
<?xml version="1.0" encoding="ASCII"?>
<uk.ac.ic.doc.part.partInfomodel:PARTInformationModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:uk.ac.ic.doc.part.partInfomodel="http:///uk/ac/ic/doc/part/partInfomodel.ecore" modelName="DSE Information Model">
  <managedTypes managedObjectTypeName="printer">
    <attributes attrName="status" attrType="String" attrValue="idle"/>
    <operations managedOpName="printDoc">
      <parameters varName="documentName" varType="String"/>
      <parameters varName="documentSize" varType="Integer"/>
    </operations>
  </managedTypes>
  <behaviourModels>
    <states stateName="SS1" model="//@behaviourModels.0"/>
    <states stateName="SS2" model="//@behaviourModels.0">
      <stateConstraints objectRefName="typePrinter" attrVarName="status" value="idle"/>
    </states>
    <transitions transitionLabel="TT1" transitionOp="//@managedTypes.0/@operations.0" toState="//@behaviourModels.1/@states.1" fromState="//@behaviourModels.1/@states.0"/>
  </behaviourModels>
</uk.ac.ic.doc.part.partInfomodel:PARTInformationModel>


Now, when processing the <transitions> tag in the XSLT, I would like to make use of information in the nodes referenced by the XPath expressions in the @transitionOp, @fromState and @toState attributes - ideally I would like to force the processor to apply the templates defined for those nodes.

Is there any way to do this? If not, could someone suggest a better way of cross-referencing elements in the XML document such that the cross-references can be processed using XSLT?

Thanks in advance for any help!

Cheers,

- Arosha

Reply With Quote
  #2  
Old April 1st, 2004, 02:18 AM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
What you really want here is probably xpointer. Barring that I'd suggest making the values of your attributes valid xpath and seeing if any of the exslt extensions will let you turn an attribute value into an expression.
__________________
-james

Reply With Quote
  #3  
Old April 1st, 2004, 07:45 AM
MattSidesinger's Avatar
MattSidesinger MattSidesinger is offline
Java PHP Oracle Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: C-Bus OH-IO
Posts: 204 MattSidesinger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 26 sec
Reputation Power: 5
Send a message via AIM to MattSidesinger
The Xalan XSL transformer has an evaluate xpath function that will evaluate a given xpath expression.
Code:
<xsl:value-of select="xalan:evaluate($pathExpression)"/>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Applying template to XPath expression in XML Attribute


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT