Including xml in a string constant

N

Neil Thompson

Hi

I am trying to write out some a string constant that needs to include
a couple of XML elements. The parser is, quite rightly, complaining
about what I have done but I don't know how to solve it.

I have tried a couple of methods as follows:

<head>
<meta http-equiv="refresh"
content="0;url=logic-js.asp?action=dologon&amp;txtUsername=&lt;xsl:value-of
select="logicresponse/username"/&gt;&amp;txtPassword=&lt;xsl:value-of
select="logicresponse/password"/&gt;"/>
</head>

Which complains about a lack of whitespace

and also:

<xsl:variable name="content">
0;url=logic-js.asp?action=dologon&amp;txtUsername=
<xsl:value-of select="logicresponse/username"/>
&txtPassword=
<xsl:value-of select="logicresponse/password"/>
</xsl:variable>

<head>
<meta http-equiv="refresh" content="$content"/>
</head>

which, of course, just returns $content!

Any one got any idea how I can achieve what I need to do?

Thanks

Neil Thompson
 
A

Andy Fish

your second attempt should work if you put the $content in braces i.e.
<meta http-equiv="refresh" content="{$content}"/>

in fact you can put any xpath expression in side braces, so the first one
might work as well - e.g. {logicresponse/username}

alternatively you can use <xsl:attribute> to add the 'content' attribute to
the meta node, which is more flexible

Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top