Puzzling xsl problem

Discussion in 'ASP .Net' started by CS ADNT, Feb 19, 2010.

  1. CS ADNT

    CS ADNT Guest

    Hello,

    I am trying to understand how these 2 kind of files could be used.
    Context: template used to generate crm email from objects

    file 1
    <?xml version="1.0" ?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
    <xsl:eek:utput method="text" indent="no"/>
    <xsl:template match="/data">
    <![CDATA[<P>Dear ]]>
    <xsl:choose><xsl:when test="contact/fullname"><xsl:value-of
    select="contact/fullname" /></xsl:when><xsl:eek:therwise>Valued
    Customer</xsl:eek:therwise></xsl:choose>
    <![CDATA[,</P> <P>We have not heard from you for a while. We wanted to check
    in and make sure that you are still having a great experience using our
    product(s). We have asked ]]>
    <xsl:choose><xsl:when test="contact/ownerid/@name"><xsl:value-of
    select="contact/ownerid/@name" /></xsl:when><xsl:eek:therwise>a customer
    service representative</xsl:eek:therwise></xsl:choose>
    <![CDATA[ to contact you next week to get your feedback on the product(s)
    you are currently using and to give you details about our upcoming
    products.</P> <P>Thank you.</P>]]>
    </xsl:template></xsl:stylesheet>
    file 2
    <xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"
    version=\"1.0\"><xsl:eek:utput method=\"text\" indent=\"no\"/><xsl:template
    match=\"template\"><xsl:for-each select=\"*\">"+
    "<xsl:apply-templates select=\".\"
    /></xsl:for-each></xsl:template><xsl:template match=\"text\"><xsl:value-of
    select=\".\" /></xsl:template>"+
    "<xsl:template match=\"slugs\"><![CDATA[<span
    class=\"dataslug\"><span style=\"display:none;\"
    id=\"DataSlug\">{!]]><xsl:for-each select=\"slug\"><xsl:value-of
    select=\"entity\" />:<xsl:value-of select=\"attribute\"
    />;</xsl:for-each><xsl:value-of select=\"default\" />"+
    "<![CDATA[}</span>{!]]><xsl:for-each
    select=\"slug\"><xsl:value-of select=\"entity/@displayname\"
    />:<xsl:value-of select=\"attribute/@displayname\"
    />;</xsl:for-each><xsl:value-of select=\"default\"
    /><![CDATA[}</span>]]></xsl:template></xsl:stylesheet>";

    seems that file2 is used to display an html string from file 1 in the
    template editor


    Any Xsl expert advice welcome on which instructions to use.

    CS
    CS ADNT, Feb 19, 2010
    #1
    1. Advertising

  2. On Feb 19, 10:16 pm, "CS ADNT" <> wrote:
    > Hello,
    >
    > I am trying to understand how these 2 kind of files could be used.
    > Context: template used to generate crm email from objects
    >
    > file 1
    > <?xml version="1.0" ?>
    > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    > version="1.0">
    > <xsl:eek:utput method="text" indent="no"/>
    > <xsl:template match="/data">
    > <![CDATA[<P>Dear ]]>
    > <xsl:choose><xsl:when test="contact/fullname"><xsl:value-of
    > select="contact/fullname" /></xsl:when><xsl:eek:therwise>Valued
    > Customer</xsl:eek:therwise></xsl:choose>
    > <![CDATA[,</P> <P>We have not heard from you for a while. We wanted to check
    > in and make sure that you are still having a great experience using our
    > product(s). We have asked ]]>
    > <xsl:choose><xsl:when test="contact/ownerid/@name"><xsl:value-of
    > select="contact/ownerid/@name" /></xsl:when><xsl:eek:therwise>a customer
    > service representative</xsl:eek:therwise></xsl:choose>
    > <![CDATA[ to contact you next week to get your feedback on the product(s)
    > you are currently using and to give you details about our upcoming
    > products.</P> <P>Thank you.</P>]]>
    > </xsl:template></xsl:stylesheet>
    > file 2
    > <xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"
    > version=\"1.0\"><xsl:eek:utput method=\"text\" indent=\"no\"/><xsl:template
    > match=\"template\"><xsl:for-each select=\"*\">"+
    >                         "<xsl:apply-templates select=\".\"
    > /></xsl:for-each></xsl:template><xsl:template match=\"text\"><xsl:value-of
    > select=\".\" /></xsl:template>"+
    >             "<xsl:template match=\"slugs\"><![CDATA[<span
    > class=\"dataslug\"><span style=\"display:none;\"
    > id=\"DataSlug\">{!]]><xsl:for-each select=\"slug\"><xsl:value-of
    > select=\"entity\" />:<xsl:value-of select=\"attribute\"
    > />;</xsl:for-each><xsl:value-of select=\"default\" />"+
    >             "<![CDATA[}</span>{!]]><xsl:for-each
    > select=\"slug\"><xsl:value-of select=\"entity/@displayname\"
    > />:<xsl:value-of select=\"attribute/@displayname\"
    > />;</xsl:for-each><xsl:value-of select=\"default\"
    > /><![CDATA[}</span>]]></xsl:template></xsl:stylesheet>";
    >
    > seems that file2 is used to display an html string from file 1 in the
    > template editor
    >
    > Any Xsl expert advice welcome on which instructions to use.
    >
    > CS


    Yes, it is used to transformate XML document from the file 1. To see
    sample output you can open xslt in Visual Studio, go to XML - Show
    XSLT output.

    This will result the following being displayed

    <P>Dear
    Valued
    Customer
    ,</P> <P>We have not heard from you for a while. We wanted to check
    in and make sure that you are still having a great experience using
    our
    product(s). We have asked
    a customer
    service representative
    to contact you next week to get your feedback on the product(s)
    you are currently using and to give you details about our upcoming
    products.</P> <P>Thank you.</P>
    Alexey Smirnov, Feb 22, 2010
    #2
    1. Advertising

  3. CS ADNT

    CS ADNT Guest

    Thanks for confirmation, but how could I use the 'slugs', they represent
    things as contact/@ownerid ?



    "Alexey Smirnov" <> a écrit dans le message de
    groupe de discussion :
    ...
    > On Feb 19, 10:16 pm, "CS ADNT" <> wrote:
    >> Hello,
    >>
    >> I am trying to understand how these 2 kind of files could be used.
    >> Context: template used to generate crm email from objects
    >>
    >> file 1
    >> <?xml version="1.0" ?>
    >> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    >> version="1.0">
    >> <xsl:eek:utput method="text" indent="no"/>
    >> <xsl:template match="/data">
    >> <![CDATA[<P>Dear ]]>
    >> <xsl:choose><xsl:when test="contact/fullname"><xsl:value-of
    >> select="contact/fullname" /></xsl:when><xsl:eek:therwise>Valued
    >> Customer</xsl:eek:therwise></xsl:choose>
    >> <![CDATA[,</P> <P>We have not heard from you for a while. We wanted to
    >> check
    >> in and make sure that you are still having a great experience using our
    >> product(s). We have asked ]]>
    >> <xsl:choose><xsl:when test="contact/ownerid/@name"><xsl:value-of
    >> select="contact/ownerid/@name" /></xsl:when><xsl:eek:therwise>a customer
    >> service representative</xsl:eek:therwise></xsl:choose>
    >> <![CDATA[ to contact you next week to get your feedback on the product(s)
    >> you are currently using and to give you details about our upcoming
    >> products.</P> <P>Thank you.</P>]]>
    >> </xsl:template></xsl:stylesheet>
    >> file 2
    >> <xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"
    >> version=\"1.0\"><xsl:eek:utput method=\"text\" indent=\"no\"/><xsl:template
    >> match=\"template\"><xsl:for-each select=\"*\">"+
    >> "<xsl:apply-templates select=\".\"
    >> /></xsl:for-each></xsl:template><xsl:template
    >> match=\"text\"><xsl:value-of
    >> select=\".\" /></xsl:template>"+
    >> "<xsl:template match=\"slugs\"><![CDATA[<span
    >> class=\"dataslug\"><span style=\"display:none;\"
    >> id=\"DataSlug\">{!]]><xsl:for-each select=\"slug\"><xsl:value-of
    >> select=\"entity\" />:<xsl:value-of select=\"attribute\"
    >> />;</xsl:for-each><xsl:value-of select=\"default\" />"+
    >> "<![CDATA[}</span>{!]]><xsl:for-each
    >> select=\"slug\"><xsl:value-of select=\"entity/@displayname\"
    >> />:<xsl:value-of select=\"attribute/@displayname\"
    >> />;</xsl:for-each><xsl:value-of select=\"default\"
    >> /><![CDATA[}</span>]]></xsl:template></xsl:stylesheet>";
    >>
    >> seems that file2 is used to display an html string from file 1 in the
    >> template editor
    >>
    >> Any Xsl expert advice welcome on which instructions to use.
    >>
    >> CS

    >
    > Yes, it is used to transformate XML document from the file 1. To see
    > sample output you can open xslt in Visual Studio, go to XML - Show
    > XSLT output.
    >
    > This will result the following being displayed
    >
    > <P>Dear
    > Valued
    > Customer
    > ,</P> <P>We have not heard from you for a while. We wanted to check
    > in and make sure that you are still having a great experience using
    > our
    > product(s). We have asked
    > a customer
    > service representative
    > to contact you next week to get your feedback on the product(s)
    > you are currently using and to give you details about our upcoming
    > products.</P> <P>Thank you.</P>
    CS ADNT, Feb 23, 2010
    #3
  4. On Feb 23, 11:03 am, "CS ADNT" <> wrote:
    > Thanks for confirmation, but how could I use the 'slugs', they represent
    > things as contact/@ownerid ?
    >
    > "Alexey Smirnov" <> a écrit dans le message de
    > groupe de discussion :
    > ...
    >
    >
    >
    > > On Feb 19, 10:16 pm, "CS ADNT" <> wrote:
    > >> Hello,

    >
    > >> I am trying to understand how these 2 kind of files could be used.
    > >> Context: template used to generate crm email from objects

    >
    > >> file 1
    > >> <?xml version="1.0" ?>
    > >> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    > >> version="1.0">
    > >> <xsl:eek:utput method="text" indent="no"/>
    > >> <xsl:template match="/data">
    > >> <![CDATA[<P>Dear ]]>
    > >> <xsl:choose><xsl:when test="contact/fullname"><xsl:value-of
    > >> select="contact/fullname" /></xsl:when><xsl:eek:therwise>Valued
    > >> Customer</xsl:eek:therwise></xsl:choose>
    > >> <![CDATA[,</P> <P>We have not heard from you for a while. We wanted to
    > >> check
    > >> in and make sure that you are still having a great experience using our
    > >> product(s). We have asked ]]>
    > >> <xsl:choose><xsl:when test="contact/ownerid/@name"><xsl:value-of
    > >> select="contact/ownerid/@name" /></xsl:when><xsl:eek:therwise>a customer
    > >> service representative</xsl:eek:therwise></xsl:choose>
    > >> <![CDATA[ to contact you next week to get your feedback on the product(s)
    > >> you are currently using and to give you details about our upcoming
    > >> products.</P> <P>Thank you.</P>]]>
    > >> </xsl:template></xsl:stylesheet>
    > >> file 2
    > >> <xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"
    > >> version=\"1.0\"><xsl:eek:utput method=\"text\" indent=\"no\"/><xsl:template
    > >> match=\"template\"><xsl:for-each select=\"*\">"+
    > >>                         "<xsl:apply-templates select=\".\"
    > >> /></xsl:for-each></xsl:template><xsl:template
    > >> match=\"text\"><xsl:value-of
    > >> select=\".\" /></xsl:template>"+
    > >>             "<xsl:template match=\"slugs\"><![CDATA[<span
    > >> class=\"dataslug\"><span style=\"display:none;\"
    > >> id=\"DataSlug\">{!]]><xsl:for-each select=\"slug\"><xsl:value-of
    > >> select=\"entity\" />:<xsl:value-of select=\"attribute\"
    > >> />;</xsl:for-each><xsl:value-of select=\"default\" />"+
    > >>             "<![CDATA[}</span>{!]]><xsl:for-each
    > >> select=\"slug\"><xsl:value-of select=\"entity/@displayname\"
    > >> />:<xsl:value-of select=\"attribute/@displayname\"
    > >> />;</xsl:for-each><xsl:value-of select=\"default\"
    > >> /><![CDATA[}</span>]]></xsl:template></xsl:stylesheet>";

    >
    > >> seems that file2 is used to display an html string from file 1 in the
    > >> template editor

    >
    > >> Any Xsl expert advice welcome on which instructions to use.

    >
    > >> CS

    >
    > > Yes, it is used to transformate XML document from the file 1. To see
    > > sample output you can open xslt in Visual Studio, go to XML - Show
    > > XSLT output.

    >
    > > This will result the following being displayed

    >
    > > <P>Dear
    > > Valued
    > > Customer
    > > ,</P> <P>We have not heard from you for a while. We wanted to check
    > > in and make sure that you are still having a great experience using
    > > our
    > > product(s). We have asked
    > > a customer
    > > service representative
    > > to contact you next week to get your feedback on the product(s)
    > > you are currently using and to give you details about our upcoming
    > > products.</P> <P>Thank you.</P>- Hide quoted text -

    >
    > - Show quoted text -


    What do you mean?
    Alexey Smirnov, Feb 23, 2010
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Richard

    puzzling <div> problem

    Richard, Sep 12, 2003, in forum: HTML
    Replies:
    2
    Views:
    350
  2. Replies:
    1
    Views:
    3,595
    A. Bolmarcich
    May 27, 2005
  3. Dfenestr8

    Puzzling form/cgi problem

    Dfenestr8, Nov 2, 2003, in forum: Python
    Replies:
    2
    Views:
    501
    Bengt Richter
    Nov 3, 2003
  4. George Sakkis

    Puzzling OO design problem

    George Sakkis, Apr 9, 2005, in forum: Python
    Replies:
    18
    Views:
    524
    George Sakkis
    Apr 11, 2005
  5. richard

    Puzzling problem with code

    richard, Feb 18, 2013, in forum: HTML
    Replies:
    5
    Views:
    458
    Mike Duffy
    Feb 19, 2013
Loading...

Share This Page