Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   How to write out special character. (http://forums.winamp.com/showthread.php?t=282781)

mcnam_cs 7th December 2007 02:09

How to write out special character.
 
Hi every body,
I have one problem with Install program. I have tried a lot but i can't solve it; I need helping.
My problem is:
In my install script i uses "XML.DLL" plug-in to access ".xml" file. The code is:

xml::LoadFile /NOUNLOAD "$INSTDIR\Config.xml" .r0

xml::CreateNode /NOUNLOAD "<DataPath>M:\M&V\Data</DataPath>" .R0

xml::FindNextElement /NOUNLOAD "ProjectfilePath" .r0 .r1

xml::ReplaceNode /NOUNLOAD "$R0" .r0

xml::SaveFile "$INSTDIR\Config.xml" .r0

i want to set node <DataPath> with the value is M:\M&V\Data but the problem occur with the result. The character "&" can not be appeared in the result.
The result is : M:\MV\Data
I don't know how to write the character "&" output. I have try to use $\&, &amp;, hexa code ... but it still disappeared.

jimpark 7th December 2007 02:41

This is an XML issue, not NSIS. The problem is that the & character is a special character. Use &amp;amp; instead. For example:
xml::CreateNode /NOUNLOAD "<DataPath>M:\M&amp;amp;V\Data</DataPath>" .R0

mcnam_cs 7th December 2007 03:30

Oh Yes. I had tried that case too. But the result was:<DataPath>M:\M&amp;V\Data</DataPath>.
"&amp;" appeared instead "&". I don't know why.
My xml file is encoded in ANSI; Does it effect the result.
("xml.dll" i'm using is version 1.5)

jimpark 7th December 2007 12:36

The fact that you are using ANSI shouldn't matter.

But maybe the text is being parsed twice. So you need something like: &amp;amp;amp;


All times are GMT. The time now is 05:35.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.