Saving XML Root Attributes

  • AmieCutie
  • Newbie
  • Newbie
  • User avatar
  • Posts: 12

Post 3+ Months Ago

I've been working on a CMS built using AJAX and PHP. Pretty much it saves everything to XML files. Everything is working perfectly except getting the root node's attributes to save. These are never brought in to edit, I don't want these visible in the CMS. So what happens when I save, all of the root node attributes get removed. I've gone over this so much that I can't figure out what's causing this. So I thought another set of eyes my help.

The saving function is called saveXml() and is located at the bottom

http://pastie. org/5055988
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6241
  • Loc: Seattle, WA

Post 3+ Months Ago

Maybe I'm missing something, but it looks like the save function is explicitly writing out the root tag without attributes:
JAVASCRIPT Code: [ Select ]
xmlStr = '<?xml version="1.0" encoding="utf-8"?>\n<'+rootNodeName+'>'+convertHtmlToXml($('#main-editor'))+'\n</'+rootNodeName+'>';
  • AmieCutie
  • Newbie
  • Newbie
  • User avatar
  • Posts: 12

Post 3+ Months Ago

You're right, lol. Just something overlooked I guess :P

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 99 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.