How can I concatenate this?

Discussion in 'XML' started by Joris Gillis, Feb 25, 2005.

  1. Joris Gillis

    Joris Gillis Guest

    Tempore 04:36:03, die Saturday 26 February 2005 AD, hinc in foro {comp.text.xml} scripsit Zhou Lei <>:

    > <xsl:template match="user">
    > Name:
    > <xsl:apply-templates select="link" />
    > <br/>
    > Email:
    > <xsl:value-of select="@login" />
    > @my.addr.com
    > </xsl:template>


    > But there's a space between username and the domain name in mail address. Can I
    > fix it? Thank you.

    Hi,

    The whitespace appears in the result because it is there in the xslt.

    Write: <xsl:value-of select="@login" />@my.addr.com
    or:
    <xsl:value-of select="@login" />
    <xsl:text>@my.addr.com</xsl:text>

    or: <xsl:value-of select="concat(@login,'@my.addr.com')" />

    regards,
    --
    Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
    "Φιλήκοον ειναι μαλλον η φιλόλαλον" - Κλεόβουλος
     
    Joris Gillis, Feb 25, 2005
    #1
    1. Advertising

  2. Joris Gillis

    Joris Gillis Guest

    Tempore 06:30:18, die Saturday 26 February 2005 AD, hinc in foro {comp.text.xml} scripsit Zhou Lei <>:

    >
    > Thank you for your help! And I'm learning to write a transform file but really I
    > got some problems, one of them is that my xsl file works fine in IE 6, but
    > firefox 1.0 says: Error loading stylesheet: An XSLT stylesheet does not have an
    > XML mimetype. The beginning of my xsl file is here:
    > I'm really confused why this happens.

    I don;t know what a mimetype is, so I can't really help you with this.
    I can only point you to this:
    http://www.mozilla.org/projects/xslt/faq.html

    regards,
    --
    Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
    "Φιλήκοον ειναι μαλλον η φιλόλαλον" - Κλεόβουλος
     
    Joris Gillis, Feb 25, 2005
    #2
    1. Advertising

  3. Joris Gillis

    Zhou Lei Guest

    I'm write an .xsl to transform an .xml to xhtml file, and an xml fragment is
    like this:

    <user login="codename">
    <link target="http://www.my.addr.com/~codename" />
    James Cook
    </link>
    </user>

    I want to display "" as the email address, so I write the
    following xsl to achieve this:

    ....
    <xsl:template match="user">
    Name:
    <xsl:apply-templates select="link" />
    <br/>
    Email:
    <xsl:value-of select="@login" />
    @my.addr.com
    </xsl:template>

    <xsl:template match="link">
    <a href="{@target}">
    <xsl:value-of select="." />
    </a>
    </xsl:template>

    But there's a space between username and the domain name in mail address. Can I
    fix it? Thank you.
     
    Zhou Lei, Feb 26, 2005
    #3
  4. Joris Gillis

    Zhou Lei Guest

    Thank you for your help! And I'm learning to write a transform file but really I
    got some problems, one of them is that my xsl file works fine in IE 6, but
    firefox 1.0 says: Error loading stylesheet: An XSLT stylesheet does not have an
    XML mimetype. The beginning of my xsl file is here:

    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

    I'm really confused why this happens.

    Regards,
     
    Zhou Lei, Feb 26, 2005
    #4
  5. Joris Gillis

    Zhou Lei Guest

    Ok, I'll check it. Anyway, thanks for your help.
     
    Zhou Lei, Feb 26, 2005
    #5
  6. Joris Gillis

    Andy Dingley Guest

    It was somewhere outside Barstow when Zhou Lei
    <> wrote:

    >
    >Thank you for your help! And I'm learning to write a transform file but really I
    >got some problems, one of them is that my xsl file works fine in IE 6, but
    >firefox 1.0 says: Error loading stylesheet: An XSLT stylesheet does not have an
    >XML mimetype.


    The web server needs to serve the XSLT document(s) as application/xml
    or text/xml rather than text/html This should be a minor
    configuration change on the web server.

    Secondly, I suggest _not_ using XSLT on the client side - thansform it
    on the server and serve the results as plain HTML. It's great when it
    works, but it can't be used by so many users that it's often best
    avoided.
     
    Andy Dingley, Feb 26, 2005
    #6
  7. Joris Gillis

    Zhou Lei Guest

    Thank you for your help. But

    >The web server needs to serve the XSLT document(s) as application/xml
    >or text/xml rather than text/html This should be a minor
    >configuration change on the web server.


    How can I do it?

    I'll use cocoon later but I want my firefox works fine also.
     
    Zhou Lei, Feb 27, 2005
    #7
  8. Joris Gillis

    Andy Dingley Guest

    It was somewhere outside Barstow when Zhou Lei
    <> wrote:

    >How can I do it?


    Look at the documentation for the web server you're using.

    I don't know which one you're using, so I can't tell you more than
    this.
     
    Andy Dingley, Mar 1, 2005
    #8
    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. =?Utf-8?B?am9uZWZlcg==?=

    Can't concatenate for data adapters

    =?Utf-8?B?am9uZWZlcg==?=, Oct 11, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    412
    S. Justin Gengo
    Oct 17, 2005
  2. learning_C++
    Replies:
    2
    Views:
    2,078
    Ron Natalie
    Sep 24, 2004
  3. Gabriel Genellina
    Replies:
    0
    Views:
    251
    Gabriel Genellina
    Jan 4, 2010
  4. Gabriel Genellina
    Replies:
    2
    Views:
    3,317
    Gabriel Genellina
    Jan 4, 2010
  5. Carlos

    Concatenate/De-Concatenate

    Carlos, Oct 12, 2012, in forum: VHDL
    Replies:
    10
    Views:
    939
Loading...

Share This Page