Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • TomK 7 posts 37 karma points
    Aug 12, 2009 @ 11:05
    TomK
    0

    Escape ' in XSLT

    i have a problem with following sql-statement

    <xsl:variable name="sqlstat" select="'select date(ab.Anlagedatum), char(date(ab.Anlagedatum), EUR) as Anlagedatum, ab.Dateiname from Admin.STABSCHLDRUKDAT ab
       where ab.UAbschlussart = 'NEFRMD' and year(ab.anlagedatum) = 2009'" />

    ERROR:

    System.Xml.Xsl.XslLoadException: Erwartet wurde das Ende des Ausdrucks. Vorgefunden wurde 'NEFRMD'.
    ...ab where ab.UAbschlussart = ' -->NEFRMD<-- ' and year(ab.anlagedatum) = 200... Fehler bei c:\inetpub\wwwroot\xslt\633856709043291350_temp.xslt(14,1).

     

    How can i escape the ' ? i try &apos; and \

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Aug 12, 2009 @ 11:14
    Peter Dijksterhuis
    101

    try putting it in a variable:

    <xsl:variable name="apos">'</xsl:variable>

    Then use that in your second one.

    HTH,

    Peter

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Aug 12, 2009 @ 11:16
    Thomas Höhler
    0

    try

    <xsl:variable name="sqlstat" select="string(select date(ab.Anlagedatum),
    char(date(ab.Anlagedatum), EUR) as Anlagedatum, ab.Dateiname from
    Admin.STABSCHLDRUKDAT ab
       where ab.UAbschlussart = 'NEFRMD' and year(ab.anlagedatum) = 2009)" />

    thomas

  • TomK 7 posts 37 karma points
    Aug 12, 2009 @ 13:58
    TomK
    0

    putting the complete sql statement without the outside ' in a variable solve the problem

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies