zedlitz Posted October 11, 2008 Share Posted October 11, 2008 I´am trying to create a variable in a xlst stylesheetlike <xsl:variable name="myvar" select="'mytext'"/> (works fine)but I need to give the variable myvar the value</text> insted of the value mytextbut whenever I insert <> in my editor it expect a keyword, is there any way where I can bypass this behaivor or should I do it differently.What I´am looking for is a way to escape the special meaning of <> Link to comment Share on other sites More sharing options...
boen_robot Posted October 11, 2008 Share Posted October 11, 2008 You can escape those characters by writing "<" and ">" for < and > respectively. And you can (and must) write ampersand (&) as "&".BTW, if you're thinking of using XSLT procedurally (creating "<text>", doing something, creating "</text>"), I suggest you look further into using XSLT templates instead. Link to comment Share on other sites More sharing options...
zedlitz Posted October 12, 2008 Author Share Posted October 12, 2008 What i Need is to have a variable with the content of <EtPoname> and </EtPoname> but the characthers <> are giving problems because xml translate this as a command when assigning this value to a variableTIA Link to comment Share on other sites More sharing options...
boen_robot Posted October 12, 2008 Share Posted October 12, 2008 What i Need is to have a variable with the content of <EtPoname> and </EtPoname> but the characthers <> are giving problems because xml translate this as a command when assigning this value to a variableTIAI got that, and I told you the solution already: escape them as I showed above... jees... do I have to spell it all out?<xsl:variable name="myvar" select="'<mytext>'"/> Link to comment Share on other sites More sharing options...
zedlitz Posted October 13, 2008 Author Share Posted October 13, 2008 Sorry, I misunderstood your answer, now I understand what you ment. Thanks for the help/XMLnewbie Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.