Create '<' and '>' by <xsl:eval>

Create '<' and '>' by <xsl:eval>

Post by mall.. » Tue, 03 Aug 1999 04:00:00



Hi,
I wants to create '<TD>' by an <xsl:eval>, but the parser changes it
into '&lt;TD&gt;'. What could I do ?

Thanks for your help

Frank

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

 
 
 

Create '<' and '>' by <xsl:eval>

Post by Donald Kackma » Tue, 03 Aug 1999 04:00:00


Do this

<xsl:eval no-entities="1"><TD></xsl:eval>

don


> Hi,
> I wants to create '<TD>' by an <xsl:eval>, but the parser changes it
> into '&lt;TD&gt;'. What could I do ?

> Thanks for your help

> Frank

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.


 
 
 

Create '<' and '>' by <xsl:eval>

Post by yclept Keshl » Tue, 03 Aug 1999 04:00:00


Can't do it that way. Use <xsl:element> with a computed
name.

--
-----------------------------------------------------------------

 
 
 

Create '<' and '>' by <xsl:eval>

Post by mall.. » Wed, 04 Aug 1999 04:00:00




> Do this

> <xsl:eval no-entities="1"><TD></xsl:eval>

> don




Quote:> > Hi,
> > I wants to create '<TD>' by an <xsl:eval>, but the parser changes it
> > into '&lt;TD&gt;'. What could I do ?

> > Thanks for your help

> > Frank

> > Sent via Deja.com http://www.deja.com/
> > Share what you know. Learn what you don't.

> Thanks a lot, it works !!! Where do you find this parameter ? I've

read a lof of docs, books, msdn, etc.

My example:

        <xsl:script language="JavaScript">
        function test()
        {
                return "&lt;TD&gt;Hello&lt;/TD&gt;"
        };
        </xsl:script>

        <xsl:template match="/">
                <TR>
                <xsl:eval no-entities="1">test();</xsl:eval>
                </TR>
        </xsl:template>

will produces:

        <TR><TD>Hello</TD></TR>

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

 
 
 

Create '<' and '>' by <xsl:eval>

Post by yclept Keshl » Wed, 04 Aug 1999 04:00:00



> My example:

>         <xsl:script language="JavaScript">
>         function test()
>         {
>                 return "&lt;TD&gt;Hello&lt;/TD&gt;"
>         };
>         </xsl:script>

>         <xsl:template match="/">
>                 <TR>
>                 <xsl:eval no-entities="1">test();</xsl:eval>
>                 </TR>
>         </xsl:template>

> will produces:

>         <TR><TD>Hello</TD></TR>

I don't think it should, actually.

You're returning text, rather than structure. When that
document is
written out, the angle brackets in the text should be
converted
back to character entities.

You may get lucky and have it work in some situations. It
isn't
a reliable solution.

--
-----------------------------------------------------------------

 
 
 

Create '<' and '>' by <xsl:eval>

Post by Donald Kackma » Wed, 04 Aug 1999 04:00:00


Quote:

> > Thanks a lot, it works !!! Where do you find this parameter ? I've
> read a lof of docs, books, msdn, etc.

Someone mentioned it here a few months ago. I haven't seen it documented
anywhere but it's really been helpful when you need to get a "<" or ">" into
the output stream in a context that it isn't XML.

don

PS Make's you wonder what other little attribute flags MS has hidden away in
their XSL engine and isn't telling us about...

Quote:

> My example:

> <xsl:script language="JavaScript">
> function test()
>         {
> return "&lt;TD&gt;Hello&lt;/TD&gt;"
> };
> </xsl:script>

> <xsl:template match="/">
> <TR>
> <xsl:eval no-entities="1">test();</xsl:eval>
> </TR>
> </xsl:template>

> will produces:

>         <TR><TD>Hello</TD></TR>

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

 
 
 

Create '<' and '>' by <xsl:eval>

Post by mall.. » Thu, 05 Aug 1999 04:00:00





> > My example:

> >         <xsl:script language="JavaScript">
> >         function test()
> >         {
> >                 return "&lt;TD&gt;Hello&lt;/TD&gt;"
> >         };
> >         </xsl:script>

> >         <xsl:template match="/">
> >                 <TR>
> >                 <xsl:eval no-entities="1">test();</xsl:eval>
> >                 </TR>
> >         </xsl:template>

> > will produces:

> >         <TR><TD>Hello</TD></TR>

> I don't think it should, actually.

> You're returning text, rather than structure. When that
> document is
> written out, the angle brackets in the text should be
> converted
> back to character entities.

> You may get lucky and have it work in some situations. It
> isn't
> a reliable solution.

> --
> -----------------------------------------------------------------

> Hi Joe,

i need this for the following problem:
- I have a XML Table with many records and fields
- The user may decide which columns will be displayed. Also the order
of the columns may be changed, for instance firstname,name or
name,firstname, etc.
Since there are no <xsl:variable> I decided to collect first all
selected columns, reorder them and creates a new text output, which
will be displayed.
The output is no XML structure, but it creates the table, I need. It
works.

In the actual version I dynamically creates various <xsl:apply-
templates... of the fields and order I need.

Frank

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

 
 
 

1. Problem with 'Or' operator in '<xsl:if>' statement

Hi everyone,

I'm using MSXML 3.0 to do XML -> HTML transformations.

I have documents of type 'Contenu' (content) wich may be articles
(Contenu/Article) or Dossiers (Contenu/Dossier).

Any of these contents have an issue origin (Contenu/*/Origine/Parution)

For some of those articles or dossiers I would like to display their Teaser
(Contenu/*/Accroche/Parag).
Only for those articles for which issue origin is '01net' or '01net.'

So here's my <xsl:if> statement (I only want to get those teasers that have
some text content). (I'm in a 'Contenu' context) so
the '*' applies to either an 'Article' or 'Dossier'
    <xsl:if test="*/Accroche/Parag[*/Origine/Parution = '01net.' Or
*/Origine/Parution = '01net']/text())">

But I get the following error :

a.. Error type :
msxml3.dll (0x80004005)
Expected token ']' found 'NAME'. */Accroche/Parag[*/Origine/Parution =
'01net.' -->Or <--*/Origine/Parution = '01net']/text())

The funny thing is that when I rewrite the test expression using 'And'
operators and negations, it works ! :
<xsl: if test="not(*/Accroche/Parag[*/Origine/Parution != '01net' And
*/Origine/Parution != '01net.']/text())">

Can someone explain to me why it works using 'And' and negation (not()) but
doesn't work using 'Or' operator ?

Greetings,
Diego Tercero
Design & programming engineer
Eurocortex
http://www.eurocortex.fr
16, avenue de l'Europe
31520 Ramonville - France
Tl: 33 (0) 5 62 88 33 83
Fax: 33 (0) 5 62 88 33 46

2. Ndetect - illegal operation error message

3. Redefining Tag Delimiter ('<' --> '[')??

4. Palm Vx battery capacity diminishing?

5. outputting '<' and '>'

6. Error in April 1999 _MacTech_ article (concerning exceptions in constructors)?

7. PRB: xsl changing '<' in cdata into '&lt;'

8. MAC accounting

9. XML and the '<' , '>', single quote chararacters

10. output of '<', '>'

11. Problems outputting '<' and '>'

12. Whats wrong with this <xsl:when test="@order='1'">