Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   problem while writing XML (http://forums.winamp.com/showthread.php?t=267310)

darshanaltekar 7th March 2007 10:41

problem while writing XML
 
i have one XML file as
<?xml version="1.0" encoding="utf-8"?>
<Preference>
<MessageSetting AutoStart="False" RUserPassword="True">
<UserID>123123</UserID>
<UserPassword>VvetqIEfbbA=</UserPassword>
<OrganizationIDList> <OrganizationID>ABC_MORTGAGE</OrganizationID>
</OrganizationIDList>
<RecentOrgID>ABC_MORTGAGE</RecentOrgID>
</MessageSetting>
<preferences>

In this file i have to add(not replce) node at organisation id ie add another organisation id in organisation list How can i do this?

I'm using nsisXML plugin
${nsisXML->CreateElement}
but its giving eroor
It'll be very helpful if some one can give me code example

Joel 7th March 2007 19:00

Your:
PHP Code:

<?xml version="1.0" encoding="utf-8"?>
<Preference>
<MessageSetting AutoStart="False" RUserPassword="True">
<UserID>123123</UserID>
<UserPassword>VvetqIEfbbA=</UserPassword>
<OrganizationIDList> <OrganizationID>ABC_MORTGAGE</OrganizationID>
</OrganizationIDList>
<RecentOrgID>ABC_MORTGAGE</RecentOrgID>
</MessageSetting>
<preferences>

Should:
PHP Code:

<?xml version="1.0" encoding="utf-8"?>
<Preference>
    <MessageSetting AutoStart="False" RUserPassword="True">
        <UserID>123123</UserID>
        <UserPassword>VvetqIEfbbA=</UserPassword>
        <OrganizationIDList> 
            <OrganizationID>ABC_MORTGAGE</OrganizationID>
        </OrganizationIDList>
        <RecentOrgID>ABC_MORTGAGE</RecentOrgID>
    </MessageSetting>
</preferences>


onad 8th March 2007 12:03

One could try to improve the XML Plugin e.g. by stripping spaces first and ten evaluate.

Note: Valid XML not called "file" but "Document"

Backland 8th March 2007 12:51

As Joel corrected, the OPs root element wasnt closed (not sure if this was the issue), but it cant hurt to validate the XML.

darshanaltekar 8th March 2007 13:31

guys soory to put the wrong doc but i have checked the file & root element is closed properly in it i just need the code to add elements to <OrganizationID> (multiple elements)

Comm@nder21 8th March 2007 14:31

Quote:

<Preference>
...
</preferences>
should be either "Preference" or "preferences" in both cases...

darshanaltekar 8th March 2007 14:42

<Preference>
</Preference>
guys i'm telling u there is no problem with XML please just tell me how can i add more than one OrganizationID's
ie
<OrganizationID>1234</OrganizationID>
<OrganizationID>5678</OrganizationID>
<OrganizationID>9012</OrganizationID>
i need code some problem with code that i wrote i'm new to both NSIS & XML

Joel 8th March 2007 15:39

If you are using my plugin see example-2.nsi


All times are GMT. The time now is 04:17.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.