Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. how to specify multiple selection criteria in tag?

how to specify multiple selection criteria in tag?

Scheduled Pinned Locked Moved XML / XSL
xmlhelpcsharphtmltutorial
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rocky
    wrote on last edited by
    #1

    Hi every one, I've generated this xsl code from my C# application and I've given the error statement in bold here. the problem is that I wanna filter the contents of an XML file and generate its HTML. So far its working fine as long as I select one Author(as the filtering is based on the name of the author). but whenever select two or more it gives an error on XSLT. Its actually the XsltCompileException and it points out this line given in bold... So can any one plz help me in this regard and tell how exactly this kind of expression should be formatted. Any help would be highly appreciated... Thanks xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> xsl:output method="html" indent="yes"/> Trying to filter xsl:for-each select="bookstore/book"> xsl:choose> xsl:when test="author/first-name='Herman' | author/first-name='Imaginary' "> /xsl:when> /xsl:choose> /xsl:for-each> /table> /xsl:template> /xsl:style sheet // I've made a few syntactic mistakes here intentionally (removed '<' character)coz this is not showing the contents of Xml when i posted this... its only showing Html... Hello... maderators of this forum... whats happening here?? (no offense):) Rocky

    Title

    Price

    xsl:value-of select="title"/>

    xsl:value-of select="price"/>

    R 1 Reply Last reply
    0
    • R Rocky

      Hi every one, I've generated this xsl code from my C# application and I've given the error statement in bold here. the problem is that I wanna filter the contents of an XML file and generate its HTML. So far its working fine as long as I select one Author(as the filtering is based on the name of the author). but whenever select two or more it gives an error on XSLT. Its actually the XsltCompileException and it points out this line given in bold... So can any one plz help me in this regard and tell how exactly this kind of expression should be formatted. Any help would be highly appreciated... Thanks xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> xsl:output method="html" indent="yes"/> Trying to filter xsl:for-each select="bookstore/book"> xsl:choose> xsl:when test="author/first-name='Herman' | author/first-name='Imaginary' "> /xsl:when> /xsl:choose> /xsl:for-each> /table> /xsl:template> /xsl:style sheet // I've made a few syntactic mistakes here intentionally (removed '<' character)coz this is not showing the contents of Xml when i posted this... its only showing Html... Hello... maderators of this forum... whats happening here?? (no offense):) Rocky

      Title

      Price

      xsl:value-of select="title"/>

      xsl:value-of select="price"/>

      R Offline
      R Offline
      Rocky
      wrote on last edited by
      #2

      xsl:when test="author/first-name='Herman' | author/first-name='Imaginary' "> oh well i got it sorted out myself... just changed it to xsl:when test="author/first-name='Herman' or author/first-name='Imaginary' "> and it worked! Thanks anyway

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups