469,279 Members | 2,261 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,279 developers. It's quick & easy.

XSLT Compile problems with Oxygen

I am trying to compile using Oxygen 5.1 and am getting this error:
E Only xsl:when and xsl:otherwise are allowed here
for this code:
[html]<xsl:choose>
<xsl:when test="da_unit/unit_type_cd='PMREG' >Display a checkedbox </xsl:when>
<xsl:when test="da_unit/unit_type_cd='MHUFAS' Display a checkedbox </xsl:when>
<xsl:otherwise>Display a checkbox </xsl:otherwise>
</xsl:choose>[/html]
When I play around with the code, I am able to get a compile if I code like this:
[html]<xsl:choose><xsl:when test="da_unit/unit_type_cd='MHREG' "><Display a checkedbox </xsl:when></xsl:choose>
<xsl:choose><xsl:when test="da_unit/unit_type_cd='MHUFAS' Display a checkedbox </xsl:when><xsl:therwiseDisplay a checkbox </xsl:therwise></xsl:choose>[/html]

The problem is I get 2 check boxes in the output. I don't understand why I can't compile as this is just general coding. Is there a setting that I should be using or update some files somewhere or what? I know that Oxygen is up to 8.1 and maybe I should upgrade but still this should compile. I have substituted the text "Display a checkbox " for a gif checkbox.
Note:I had to delete the o from the word otherwise because a emotion is being inserted for some reason so it there isn't a spelling error.

Warning: Please add code or html tags for samples. (moderator)
Mar 18 '07 #1
4 1688
dorinbogdan
839 Expert 512MB
It seems to me that > is missing after 'MHUFAS'?
Try this:
[html]<xsl:choose>
<xsl:when test="da_unit/unit_type_cd='PMREG'> Display a checkedbox </xsl:when>
<xsl:when test="da_unit/unit_type_cd='MHUFAS'> Display a checkedbox </xsl:when>
<xsl:otherwise>Display a checkbox </xsl:otherwise>
</xsl:choose>[/html]
Mar 19 '07 #2
It seems to me that > is missing after 'MHUFAS'?
Try this:
[html]<xsl:choose>
<xsl:when test="da_unit/unit_type_cd='PMREG'> Display a checkedbox </xsl:when>
<xsl:when test="da_unit/unit_type_cd='MHUFAS'> Display a checkedbox </xsl:when>
<xsl:otherwise>Display a checkbox </xsl:otherwise>
</xsl:choose>[/html]
You are correct in that the > is missing but I had to edit it for posting and that was an edit error. It is correct in the xslt. Do you know why I cannot compile with the when/choose/otherwise? I cannot do multiple when's and one otherswise which shouldn't be. I should be able to do multiple when's and an otherwise. Is there a setting or do I need to modify something in Oxygen?
Mar 19 '07 #3
dorinbogdan
839 Expert 512MB
I don't have Oxygen.
I just checked the second example from this reference for multiple-when syntax.
Eventually, edit the XML file and add a reference to XSL file, then run the xml file in IExplorer browser. If it's working then the problem is in Oxygen.
Mar 19 '07 #4
dorinbogdan
839 Expert 512MB
Hi,
Did you succeed to solve the problem ?
If yes, please let me know, in order to close the thread.
Thanks,
Dorin.
Mar 21 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Jordan Willms | last post: by
reply views Thread by shaun | last post: by
4 posts views Thread by J | last post: by
3 posts views Thread by Oobi Van Doobi | last post: by
8 posts views Thread by Hercules Dev. | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.