Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Puzzling xsl problem

Reply
Thread Tools

Puzzling xsl problem

 
 
CS ADNT
Guest
Posts: n/a
 
      02-19-2010
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 xmlnssl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xslutput 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><xsltherwise>Valued
Customer</xsltherwise></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><xsltherwise>a customer
service representative</xsltherwise></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 xmlnssl=\"http://www.w3.org/1999/XSL/Transform\"
version=\"1.0\"><xslutput 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


 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      02-22-2010
On Feb 19, 10:16*pm, "CS ADNT" <(E-Mail Removed)> 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 xmlnssl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xslutput 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><xsltherwise>Valued
> Customer</xsltherwise></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><xsltherwise>a customer
> service representative</xsltherwise></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 xmlnssl=\"http://www.w3.org/1999/XSL/Transform\"
> version=\"1.0\"><xslutput 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>
 
Reply With Quote
 
 
 
 
CS ADNT
Guest
Posts: n/a
 
      02-23-2010
Thanks for confirmation, but how could I use the 'slugs', they represent
things as contact/@ownerid ?



"Alexey Smirnov" <(E-Mail Removed)> a écrit dans le message de
groupe de discussion :
70afafb1-7609-4e98-8f9a-8bb32de0693b...oglegroups.com...
> On Feb 19, 10:16 pm, "CS ADNT" <(E-Mail Removed)> 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 xmlnssl="http://www.w3.org/1999/XSL/Transform"
>> version="1.0">
>> <xslutput 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><xsltherwise>Valued
>> Customer</xsltherwise></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><xsltherwise>a customer
>> service representative</xsltherwise></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 xmlnssl=\"http://www.w3.org/1999/XSL/Transform\"
>> version=\"1.0\"><xslutput 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>


 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      02-23-2010
On Feb 23, 11:03*am, "CS ADNT" <(E-Mail Removed)> wrote:
> Thanks for confirmation, but how could I use the 'slugs', they represent
> things as contact/@ownerid ?
>
> "Alexey Smirnov" <(E-Mail Removed)> a écrit dans le message de
> groupe de discussion :
> (E-Mail Removed)...
>
>
>
> > On Feb 19, 10:16 pm, "CS ADNT" <(E-Mail Removed)> 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 xmlnssl="http://www.w3.org/1999/XSL/Transform"
> >> version="1.0">
> >> <xslutput 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><xsltherwise>Valued
> >> Customer</xsltherwise></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><xsltherwise>a customer
> >> service representative</xsltherwise></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 xmlnssl=\"http://www.w3.org/1999/XSL/Transform\"
> >> version=\"1.0\"><xslutput 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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Puzzling VPN problem with Windows 2003 John Rennie Cisco 0 03-14-2006 07:19 PM
XSL Question tp xsl:for-each and xsl:variable schaf@2wire.ch XML 1 05-27-2005 09:25 PM
Puzzling Hijack (I think) Problem Steve Meyerson Computer Support 7 09-23-2004 06:27 AM
puzzling routing problem Geert Cisco 0 04-07-2004 10:28 PM
puzzling <div> problem Richard HTML 2 09-12-2003 08:56 PM



Advertisments