Jump to content

Advanced XML edit


chomps

Recommended Posts

Hi all,

 

I have a huge problem while trying to edit an xml file via php form. the xml file is very unlike any normal xml as the tags(nodes) have long names. A sample of the xml files that i am manualy editing is as follows:

 

<botxml>

<menu idx="1" title="" description="Welcome!">

<menu idx="1" title="Breaking News" description="Latest news">

<content idx="1" title="content title goes here" bpv="false" charactersPerPage="1000" billing="billing001">

 

Have you seen the National Ledger claims he lost it in Toronto while doing the rounds...blah blah blah

 

</content>

</menu>

<menu idx="2" title="Need Skinz" description="Skinz and themes">

<skin idx="1" title="Our Skinz" category="Skinz" description=""/>

</menu>

<menu idx="6" title="Poll" description="Our Poll">

<form idx="1" title="Do you think question?" billing="bill_4101" description="" onSubmitSuccessMessage="Thank you for voting in daily poll!">

<items>

  <choice param="selected" text="Make you're choice below">

<option name="1" value="Yes" display="Yes"/>

<option name="2" value="No" display="No"/>

  </choice>

</items>

<submit>

<httpget url="http://www.domain.com/folder/xml/file.php?choice=[selected]" />

</submit>

</form>

</menu>

</botxml>

 

I need to keep the tags in '<>' and sometimes I want to add a <menu idx> or <content idx> etc

 

i thought of using a mysql database but not sure how to edit or build the xml file without malforming it.

 

please can someone help me here. any sudgestions would realy be great.

 

thank you

Link to comment
https://forums.phpfreaks.com/topic/138715-advanced-xml-edit/
Share on other sites

you need to look at the order of the current code xml very easy easier then html.

 

if you no the order off the names that represent the html syntax.

 

 

Take a look here see if what you want to do is passable.

url

http://www.w3schools.com/xml/default.asp

 

 

Link to comment
https://forums.phpfreaks.com/topic/138715-advanced-xml-edit/#findComment-725232
Share on other sites

 

quick example.

<form method="post" action="">
<p>
<fieldset>
<legend>Why are you contacting us?</legend>
<div>
<input type="radio" name="q1_why" id="q1a">
<label for="q1a">Technical Support</label><br />
<input type="radio" name="q1_why" id="q1b">
<label for="q1b">Applying for Work</label><br />
<input type="radio" name="q1_why" id="q1c">
<label for="q1c">Wanted to Hire You</label><br />
<input type="radio" name="q1_why" id="q1d">
<label for="q1d">Other</label><br />
</div>
</fieldset>
<fieldset>
<legend>What service are you interested in? (Check all that apply.)</legend>
<div>
<input type="checkbox" name="q2_service[]" id="q2a" value="Heating" />
<label for="q2a">Heating</label><br />
<input type="checkbox" name="q2_service[]" id="q2b" value="Cooling" />
<label for="q2b">Cooling</label><br />
<input type="checkbox" name="q2_service[]" id="q2c" value="Plumbing" />
<label for="q2c">Plumbing</label><br />
<input type="checkbox" name="q2_service[]" id="q2d" value="Wiring" />
<label for="q2d">Wiring</label><br />
<input type="checkbox" name="q2_service[]" id="q2e" value="Carpentry" />
<label for="q2e">Carpentry</label>
</div>
</fieldset>
<fieldset>
<legend>Where are you from?</legend>
<div>
<label for="q3">Pick your state:</label>
<select id="q3" name="q3_state">
<option value="none">Choose One</option>

<option value="MN">Minnesota</option>
<option value="MT">Montana</option>
<option value="NY">New York</option>
</select>
</div>
</fieldset>
<fieldset>
<legend>Comments</legend>
<div>
<label for="q4">Please provide additional comments about our services.</label><br />
<textarea id="q4" name="q4_comments" rows="4" cols="40"></textarea>
</div>
</fieldset>
<fieldset>
<div>
<label for="submit">Submit the form</label>
<input type="submit" id="submit" name="submit" value="Send your Input" />
</div>
</fieldset>
</form>

Link to comment
https://forums.phpfreaks.com/topic/138715-advanced-xml-edit/#findComment-725247
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.