pelegk Posted May 18, 2003 Posted May 18, 2003 i am trying to do this : <xsl:if test="position() mod 2!=0"> <xsl:value-of select="<"/> <xsl:value-of select="tr" /> <xsl:value-of select=">"/> </xsl:if> or <xsl:if test="position() mod 2!=0"> <xsl:value-of select="<"/> <xsl:value-of select="tr" /> <xsl:value-of select=">"/> </xsl:if> but no one of this work's! when i try to run it i get i have an error "expression expected" : "--><<-- what can i do to over ride this problem? thanks in advance PEleg
cjaeger Posted May 18, 2003 Posted May 18, 2003 just take the instruction literally - is there any XML node named ">" which the script should select? Or do you just want to include some [xsl:]text here... <xsl:text>></xsl:text> Or may be you want an XML/HTML element named "tr": <xsl:element name="tr">sample text</xsl:element>.... since you are dealing with a template, why not include <tr><xsl:value-of select="table/header/col1" /></tr>...
pelegk Posted May 18, 2003 Author Posted May 18, 2003 i need to use it as opening tag <TR> and clsing </TR> so what to use? thanks peleg
cjaeger Posted May 18, 2003 Posted May 18, 2003 Since you are exporting HTML <tr><xsl:value-of select="table/header/col1" /></tr>...
pelegk Posted May 19, 2003 Author Posted May 19, 2003 ok maybe i didn't explain my self correct : i want to do and if sentence that once will print <tr> and once <td> and of course will close this tags! the problem is when i try to do : <xsl:if test="position() mod 2 =0"> <TR> </xsl:if> it tells me tag <xsl:if> dont match start tag <tr> beacuse of that everyhing i tried didnt work! what to do? thnaks in advance peleg
cjaeger Posted May 19, 2003 Posted May 19, 2003 <xsl:if test="position() mod 2 =0"> <TR><TD>tablerow even</TD></TR> </xsl:if> <xsl:if test="position() mod 2 =1"> <TR><TD>tablerow odd</TR></TR> </xsl:if> xml/html must be well-formed, eg, you will have to close the <TR>tag before closing the <xsl:if> tag ....
pelegk Posted May 19, 2003 Author Posted May 19, 2003 yes but the problem is this : in the start of the code : <xsl:if test="position() mod 2 =0"> <TR> </xsl:if> ..... code..... <xsl:if test="position() mod 2 =0"> </TR> </xsl:if> but this isnt working! what u gave me dont help me! what lse can i do"?
cjaeger Posted May 19, 2003 Posted May 19, 2003 you will have to use correct nesting of tags. no way around it. use <xsl:if test="position() mod 2 =0"> <TR>thecomplete tablerow</TR> </xsl:if> and then <xsl:if test="position() mod 2 =1"> <TR>thecompletetablerow again</TR> </xsl:if> it's not that difficult to repeat the text between <TR> and </TR> since most computers have copy & paste nowadays ....
pelegk Posted May 19, 2003 Author Posted May 19, 2003 i knew that but i didnt want double code( same code ) on my page! beacuse of that i have posted that question hee from the begining! may god bless us all and speically the ones who fight th Terorist ( like arafat!))
cjaeger Posted May 19, 2003 Posted May 19, 2003 Well, then try either ignoring the basic rules of processing XML and make up your own(the WW3C is an international body, after all ..) or learn to analyse your problem a bit further. <TR>
pelegk Posted May 19, 2003 Author Posted May 19, 2003 by the way : how did u put a pic near your name?
cjaeger Posted May 19, 2003 Posted May 19, 2003 ... and while you are editing your prefs, can you take back the thread's rating? This thread doesn't deserve a 5 star rating - we have both not been very intelligent here ...
cjaeger Posted May 19, 2003 Posted May 19, 2003 ... wrong forum for political statements - try a parliament. bye.
cjaeger Posted May 20, 2003 Posted May 20, 2003 welcome back. It might help troubleshootig XSLT if provided with a bit more lines than just the one not working ... i take it does work now, does it?
Recommended Posts
This topic is 7858 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