Coder Profile - Show off your skills, get a coder profile.
 
 
 
  
Posted: 3.29 Years Ago 

Visie
Belgium
Contrib Level: 1
Total Posts: 5
Hi,

i write a template class. All templates are in an xml-file. To handle comments in html-code (allowed/not allowed), I will delete the "<!-- -->"- and "/* */"-comments.
How can I save the "new" string in my xml-object?
CODE: Copy / Restore  ::  Remove Scroll Bars
  1.       function parseXML($s)
  2.       {
  3.               global $ASSETS;
  4.  
  5.               # load xml-file
  6.               $tf = $this->path.chr(0x2f).$s.$this->suffix_list['data_file'];
  7.  
  8.               $xml = @simplexml_load_file($tf, null, LIBXML_NOCDATA);
  9.  
  10.               /*
  11.               complete this part:
  12.           delete all html-comments */
  13.  
  14. #foreach ($xml as $node => $nodevalue) {
  15. # $nodevalue = preg_replace("#/\*(.*?)\*/#s", "", $nodevalue);
  16. # $nodevalue = preg_replace("#<!--(.*?)-->#s", "", $nodevalue);
  17.  
  18. # problem: how can i rewrite the node-content?
  19. # $xml[$node] = $nodevalue; // ? <- this is my problem. How can I save this data in my xml-object??? :(
  20. #}
  21.  
  22.  
  23. return $xml;
  24.  
  25. }
CODE: Copy / Restore  ::  Remove Scroll Bars
  1. <template>
  2. <meta/>
  3. <template_page>
  4. <[CDATA[
  5. <html>
  6. <head>
  7. <style>
  8. /* i will delete this comment */
  9. </style>
  10. </head>
  11. <body>
  12. <!-- and this comment -->
  13. </body>
  14. </html>
  15. ]]>
  16. </template_page>
  17. <template_nav>
  18. <[CDATA[
  19. <!-- and also this -->
  20. <a onclick="blubb" />
  21. ]]>
  22. </template_nav>
  23. </template>
Kind regards, Lucas
Posted: 3.27 Years Ago 

Dice
Australia
Contrib Level: 5
Total Posts: 163
I don't quite understand.
Posted: 3.27 Years Ago 

Visie
Belgium
Contrib Level: 1
Total Posts: 5
Hi,

the xml is in my object $xml. I would like parse the html-code in the simplexmlobjects, replace all comments in the html-code an save the string of the html-code in my object again.

What is the correct syntax?
Posted: 3.27 Years Ago 

Dice
Australia
Contrib Level: 5
Total Posts: 163
I've figured out why I don't understand...because i haven't got that far yet. lol. Sorry. :(
Posted: 3.27 Years Ago 

Visie
Belgium
Contrib Level: 1
Total Posts: 5
GOOOOOD MORNING!!!!!!!!!
Hahahaha that's amazing :D
So? 'kay. And i believed it was a joke. hihihi I'm glad 4 u.

The xml is my new little madam. With gucci-dress! In pale pink!

ummmmmmmmmmm ya i dont really know wat else to say. shaleeleelee

Anyone here to can post a answere about the topic?
Page 1 of 1
 
 
Latest News About Coder Profile
Coder Profile Poll
If you made money from keeping your profile up to date, say $30 and up, per month. What extra time would you spend on your profile?

No extra time
A few hours at weekends
A whole day each week
Every minute i can get free


please login to cast your vote
and see the results of this poll
Latest Coder Profile Changes
Coder Profile was last updated
3.49 Years Ago
Official Blog :: Make A Donation :: Credits :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents :: Wallpapers
Version 1.46.00
Copyright © 2007 - 2012, Scott Thompson, All Rights Reserved