Menu

Can the header "<?xml" be editable?

Developer
SpinyMan
2007-11-26
2013-05-20
  • SpinyMan

    SpinyMan - 2007-11-26

    Sometimes I need to write the xml documents with the diffrent headers:
    <?wpl version="1.0" ?> like this for example.
    As u see here <?wpl header used instead. And I can't create documents with other headers using ur script. can u do smth, pls?

     
    • Zmey

      Zmey - 2007-11-30

      > As u see here <?wpl header used instead. And I can't create documents with other headers using ur script. can u do smth, pls?

      You can change it yourself using your favourite text editor.
      Just find-and-replace "?xml? with "?wpl" in all tinyxml source files.
      Note that TinyXML is not a script, so you must recompile your application.

       
      • SpinyMan

        SpinyMan - 2007-11-30

        You don't understand me. I meen that the header "<?xml" need to be changeable at any time. For example: now I need "xml" and in second "wml". I just put in my code for example 'TinyXML->header="wml";' and o-pa I get the result without changing the TinyXML source code every time. Get it?

         
        • Zmey

          Zmey - 2007-12-26

          > You don't understand me.

          This must be, "I failed to explain what I meant". Got it? :)

          > I meen that the header "<?xml" need to be changeable at any time.
          > For example: now I need "xml" and in second "wml". I just put in my
          > code for example 'TinyXML->header="wml";' and o-pa I get the result
          > without changing the TinyXML source code every time.

          Modify the source code once:
          1. Add a new member where you will store your header to TiXmlDeclaration class. Initialize it to "xml" default in the constructor.
          2. Replace all occurrances of "?xml" literal with "?" + YourMember.
          3. To change the header, assign new text to your member: doc->declaration.YourMember = "wml";

           

Log in to post a comment.