sgasch Posted June 27, 2006 Posted June 27, 2006 I am using XML Version 1.0. I use a field which is global in a test to determine the current Mission (as in spacecraft) and what part of the form to present to the user, but I am unable to get the following format to work: I have sessions enabled and have tried modifying gDefaultMission with .global, but it still doesn't work. It does understand what gDefaultMission is when it is used in a gif definition, as in the definition below: ../images/-logo.gif I need to resolve this issue to translate three websites to XSLT, but I am at a loss as how to proceed. Please help!! : : : :(
Martin Brändle Posted June 27, 2006 Posted June 27, 2006 It always depends on the context in which you evaluate an XPath. Context in XSLT means the present position in the XML tree, and it is set either by xsl:template or xsl:for-each In your first expression, you specified an XPath (fmrs:field[@name = 'gDefaultMission']/fmrs:data[1]) which is relative to another position (or context) in the XML result set tree. You should check there the context in your XSLT , probably it is just / (the root element) or /fmrs:fmresultset, and therefore you would get a wrong total XPath (/fmrs:field[@name = 'gDefaultMission']/fmrs:data[1] or /fmrs:fmresultset/fmrs:field[@name = 'gDefaultMission']/fmrs:data[1]), however, the context should be /fmrs:fmresultset/fmrs:resultset/fmrs:record . Maybe you can just prepend a $default-record to fmrs:field[@name = 'gDefaultMission']/fmrs:data[1], but we can not decide that for sure from the code fragment you gave us. In your second expression, the XPath ($default-record/fmrs:field[@name = 'gDefaultMission']/fmrs:data[1]) is absolute, because $default-record was defined somewhere before and fmrs:field[@name = 'gDefaultMission']/fmrs:data[1] is set relative to $default-record. That's why it works.
sgasch Posted June 28, 2006 Author Posted June 28, 2006 Thank you for that clue - I was able to get it to work, but now have another problem. The URL that points to the page in question runs a script (to set up the global value), but it uses a -find which produces multiple value lists in the search page. I know that in Html using a -view did not allow a script to work (and it doesn't seem to in XSLT either), but is there any other way other than a -find (of course with a -edit I would need a recid defined). Suggestions?? The URL is shown below: search.xsl?-db=ssrdataloss&-lay=Web&-script=SetMissionToTerra&-findSearch current Terra data losses
Martin Brändle Posted June 29, 2006 Posted June 29, 2006 Strange that this did work. You did not specify any field that is queried in this URL. You might search for a specific record and set -max to 1. If you edit a global field with -edit, you don't need -recid. Cf. p. 89 of the FMSA CWP Guide. --> search.xsl?-db=ssrdataloss&-lay=Web&Mission.global=Terra&-edit or you might use -process: search.xsl?-db=ssrdataloss&-lay=Web&-script=SetMissionToTerra&-process or you might use within search.xsl the XSLT document() function to set your global field with a separate step.
Recommended Posts
This topic is 6723 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now