Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

xsl and outputing <tr> or <td> to

Featured Replies

i am trying to do this :

<xsl:if test="position() mod 2!=0">

<xsl:value-of select="&#60;"/>

<xsl:value-of select="tr" />

<xsl:value-of select="&#62;"/>

</xsl:if>

or

<xsl:if test="position() mod 2!=0">

<xsl:value-of select="&lt;"/>

<xsl:value-of select="tr" />

<xsl:value-of select="&gt;"/>

</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

just take the instruction literally - is there any XML node named "&gt;" which the script should select? Or do you just want to include some [xsl:]text here...

<xsl:text>&gt;</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>...

  • Author

i need to use it as opening tag <TR> and clsing </TR>

so what to use?

thanks

peleg

Since you are exporting HTML

<tr><xsl:value-of select="table/header/col1" /></tr>...

  • Author

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

<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 ....

  • Author

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"?

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 .... grin.gif

  • Author

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!))

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>

  • Author

so u want to say u dont like me>?

  • Author

by the way : how did u put a pic near your name?

1) i dont live in iraq, didn

... 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 ...

... wrong forum for political statements - try a parliament.

bye.

  • Author

take it easy man smile.gif

and GOD bless us all

welcome back.grin.gif

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?

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.