Archive: How can I use GotoPath in Xml Plugins which it goes right position


How can I use GotoPath in Xml Plugins which it goes right position
Please help me!
I am working with XML plugins. In my function, I use GoToPath to find where my element to stay to change it

 My config.xml
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE configdtd[
<!ENTITY hostname 'localhost'>
<!ENTITY server-port '5269'>
<!ENTITY ssl-server-port '5270'>
<!ENTITY client-port '5222'>
<!ENTITY ssl-client-port '5223'>
]>

<targets>

<target path="/openim/IMServer">
<configuration>
<listen-backlog>5</listen-backlog>
<!-- <bind>127.0.0.1</bind> -->
</configuration>
</target>

<target path="/openim/storage/ConnectionPoolManager">
<configuration>
<driver>com.mysql.jdbc.Driver</driver>
<serverurl>jdbc:mysql://127.0.0.1:3306/openim</serverurl>
<username>root</username>
<password>123456</password>
<minconnections>5</minconnections>
<maxconnections>15</maxconnections>
<connectiontimeout>1.0</connectiontimeout>
</configuration>
</target>


<target path="/openim/ServerParameters">
<configuration>
<local-client-port>&client-port;</local-client-port>
<local-ssl-client-port>&ssl-client-port;</local-ssl-client-port>
<local-server-port>&server-port;</local-server-port>
<local-ssl-server-port>&ssl-server-port;</local-ssl-server-port>
<remote-server-port>&server-port;</remote-server-port>
<hostname>servername</hostname>
<hostname>&hostname;</hostname>
<hostname>localhost</hostname>
</configuration>
</target>
</targets>

I use GotoPath like this:

${xml::LoadFile} "config.xml" $0
MessageBox MB_OK "xml::LoadFile$\n$$0=$0"

${xml::GotoPath} "/target[2]/configuration/password" $0
MessageBox MB_OK "xml::GotoPath$\n$$0=$0"

${xml::GetText} $0 $1
MessageBox MB_OK "xml::GetText$\n$$0=$0$\n$$1=$1"

${xml::SetText} "123456789"$0
Messagebox MB_OK "xml::SetText$\n$$0=$0$\n$$1=$1"

${xml::GotoPath} "/target[3]/configuration/hostname" $0
MessageBox MB_OK "xml::GotoPath$\n$$0=$0"

${xml::GetText} $0 $1
MessageBox MB_OK "xml::GetText$\n$$0=$0$\n$$1=$1"

${xml::SetText} "servername"$0
Messagebox MB_OK "xml::SetText$\n$$0=$0$\n$$1=$1"

${xml::SaveFile} "config_test.xml" $0
MessageBox MB_OK "xml::SaveFile$\n$$0=$0"

${xml::Unload}


My problem is Messagebox show GotoPath $1= -1
I do not know I must repair it although I read information on Readme.html careful.
If you used to see this problem, please help me!
Thank a lot for your help,
My word is too bad. If you do not clear, please tell me!
Once again, thank you,

I am sorry for myseft reply,
I think my problem which I see is in xml file


<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE configdtd[
<!ENTITY hostname 'localhost'>
<!ENTITY server-port '5269'>
<!ENTITY ssl-server-port '5270'>
<!ENTITY client-port '5222'>
<!ENTITY ssl-client-port '5223'>
]>

If I delete these lines above and XML plugin do well. There are other styles to help me to change content in config.xml which i do not need to delete it.
Your help is very useful for me!
Thank a lot,

Please help me!!!
Now I can not solve my problem!
Thanks