xsl-list
[Top] [All Lists]

Re: [xsl] Typing variables

2012-09-18 05:14:46
On Tue, Sep 18, 2012 at 11:06 AM, Andrew Welch 
<andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> wrote:
"category":["_IOS"," _WEB"," _CTV"] which is what I get if I don't
type it, what should the type be to get the answer I want.

Not sure I follow... the general good practice rule is: always use the
as attribute.


Assign a type to

<xsl:variable name="val">"<xsl:sequence
select="replace(.,',',concat($quot,',',$quot))"/>"</xsl:variable

such that

 <xsl:template match="m__category">
       <xsl:variable name="val">"<xsl:sequence
select="replace(.,',',concat($quot,',',$quot))"/>"</xsl:variable>
       "<xsl:value-of select="if (contains(local-name(),'__')) then
                                 substring-after(local-name(),'__') else
                                 local-name()
                              ,$val"
                      separator='":['/>]<xsl:text/>
    </xsl:template>

applied to
<m__category>_IOS, _WEB, _CTV</m__category> yields

category":["_IOS"," _WEB"," _CTV"].

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>