output of "<" and ">" in stylesheet

Discussion in 'XML' started by Diandian Zhang, Apr 7, 2005.

  1. Does anyone have an idea, how to do it? Thanks in advance!
     
    Diandian Zhang, Apr 7, 2005
    #1
    1. Advertising

  2. Assuming you mean an xslt stylesheet (rather than css or some other
    system) it's XML so for < you can use &gt; and for > you can use either
    &gt; or >

    David
     
    David Carlisle, Apr 7, 2005
    #2
    1. Advertising

  3. David Carlisle <> wrote in message news:<>...
    > Assuming you mean an xslt stylesheet (rather than css or some other
    > system) it's XML so for < you can use &gt; and for > you can use either
    > &gt; or >
    >
    > David


    Hallo, David,

    I am writing an xsl stylesheet. It seems that $lt; and $gt; don't work.
     
    Diandian Zhang, Apr 7, 2005
    #3
  4. (Diandian Zhang) writes:

    > David Carlisle <> wrote in message news:<>...
    > > Assuming you mean an xslt stylesheet (rather than css or some other
    > > system) it's XML so for < you can use &gt; and for > you can use either
    > > &gt; or >
    > >
    > > David

    >
    > Hallo, David,
    >
    > I am writing an xsl stylesheet. It seems that $lt; and $gt; don't work.


    You are allowed to give us some clues:

    Do you mean:

    The system generates an error (if so, what error message)
    or
    the system generates the wrong output (if so, what output did you get
    and what output did you want).

    The way to specify a < in XML is to to use &gt;. Of course it will also
    be output that way as well in the html or xml output methods.

    If you mean you want a literal < in the ouput then perhaps you are not
    generating XML and so should use xsl:eek:utput method="text"

    David
     
    David Carlisle, Apr 7, 2005
    #4
  5. someone wrote:

    > The way to specify a < in XML is to to use &gt;.

    ^^^^
    &lt;
     
    David Carlisle, Apr 7, 2005
    #5
  6. David Carlisle <> wrote in message news:<>...
    > someone wrote:
    >
    > > The way to specify a < in XML is to to use &gt;.

    > ^^^^
    > &lt;


    Hallo, David,

    thank you for your reply. What I want to generate from a XML file, is
    a text file as the following:
    <'
    some things
    more things
    ...
    >'


    And my stylesheet looks like this:
    <xsl:stylesheet ...>
    <xsl:eek:utput method="text"/>
    <xsl:template match="/">
    <xsl:text>&lt;'</xsl:text>
    ...
    </xsl:template>
    </xsl:stylesheet>

    The output is &lt;' instead of <'. Have I done anything wrong here?
     
    Diandian Zhang, Apr 8, 2005
    #6

  7. > The output is &lt;' instead of <'. Have I done anything wrong here?


    Your stylesheet is fine but your system is clearly using XML not text
    serialisation so is ignoring your xsl:eek:utput.

    Usually this only happens if you output from XSLT to a DOM or other
    kind of in memory structure rather than to a file and then get the final
    output from the DOM (which doesn't know anything about xsl:eek:utput hints)

    so it probably depends on what system you are using and how you are
    calling it.

    David
     
    David Carlisle, Apr 8, 2005
    #7
  8. Diandian Zhang () wrote:

    : thank you for your reply. What I want to generate from a XML file, is
    : a text file as the following:
    : <'
    : some things
    : more things
    : ...
    : >'

    : And my stylesheet looks like this:
    : <xsl:stylesheet ...>
    : <xsl:eek:utput method="text"/>
    : <xsl:template match="/">
    : <xsl:text>&lt;'</xsl:text>

    did you try

    <xsl:text disable-output-escaping='yes'>

    : ...
    : </xsl:template>
    : </xsl:stylesheet>

    : The output is &lt;' instead of <'. Have I done anything wrong here?

    --

    This space not for rent.
     
    Malcolm Dew-Jones, Apr 8, 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. Emil Christopher Melar

    App_Theme and <link rel="stylesheet" .. /> output problems.

    Emil Christopher Melar, Mar 3, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    2,706
    Emil Christopher Melar
    Mar 3, 2006
  2. =?ISO-8859-1?Q?J=F8rn_Tommy_Kinder=E5s?=

    Stylesheet referanse i stylesheet

    =?ISO-8859-1?Q?J=F8rn_Tommy_Kinder=E5s?=, Jul 3, 2004, in forum: XML
    Replies:
    3
    Views:
    616
    =?ISO-8859-1?Q?J=F8rn_Tommy_Kinder=E5s?=
    Jul 4, 2004
  3. Steven An
    Replies:
    1
    Views:
    541
    Martin Honnen
    Nov 23, 2004
  4. David Blickstein
    Replies:
    3
    Views:
    1,089
    David Blickstein
    Aug 2, 2005
  5. David Blickstein
    Replies:
    14
    Views:
    6,448
    Harrie
    Oct 16, 2005
Loading...

Share This Page