1 Reply Latest reply on Jan 29, 2009 4:35 AM by Newsgroup_User

    manipulating an xml file

    zubair
      Hi,

      I am trying to use coldfusion to edit an xml file. Well its actually a fusebox file (circuit.xml.cfm).

      I'd like to use the the microsoft xmldom object to do this like so...
      CreateObject("com", "Microsoft.XMLDOM")

      My xml file looks like this:

      <circuit access="public" permissions="news" menu="News services" default="createNewsRelease">

      <fuseaction name="Homepage" access="public" permissions="news">
      <xfa name="createNewsRelease" value="createNewsRelease"/>
      <xfa name="newsEditList" value="listNewsReleases"/>
      <xfa name="newsPublishList" value="listChangesToPublish"/>
      <xfa name="editNewsRelease" value="editNewsRelease"/>
      <relocate url="#myself##myFusebox.originalCircuit#.createNewsRelease"/>
      <set name="variables.strLatestNewsOptions" value="null"/>
      <include template="#variables.strCoreFuses#/news/qry_getNewsReleasesSummary"/>
      <include template="#variables.strCoreFuses#/news/dsp_Homepage" contentvariable="strPageContent" overwrite="false" append="true"/>
      </fuseaction>

      <fuseaction name="createNewsRelease" access="public" permissions="news.create" menu="Create a news release">
      <xfa name="submit" value="createNewsReleaseAction"/>
      <set name="variables.strRecordsetToCopy" value="getNewsRelease"/>
      <include template="#variables.strCoreFuses#/news/qry_getNewsReleaseDefaults"/>
      <include template="#variables.strCoreFuses#/news/act_copyRecordsetToAttributes"/>
      <include template="#variables.strCoreFuses#/news/dsp_createNewsReleaseHeader" contentvariable="strPageContent" append="true"/>
      <do action="formNewsRelease" contentvariable="strPageContent" append="true" overwrite="true"/>
      </fuseaction>

      <fuseaction name="createPDF" access="public" permissions="news.create" menu="Create a news release">
      <xfa name="submit" value="createNewsReleaseAction"/>
      <set name="variables.strRecordsetToCopy" value="getNewsRelease"/>
      <include template="#variables.strCoreFuses#/news/qry_getNewsReleaseDefaults"/>
      <include template="#variables.strCoreFuses#/news/act_copyRecordsetToAttributes"/>
      <include template="#variables.strCoreFuses#/news/dsp_createNewsReleaseHeader" contentvariable="strPageContent" append="true"/>
      <do action="formNewsRelease" contentvariable="strPageContent" append="true" overwrite="true"/>
      </fuseaction>

      </circuit>

      what i'd like to do is to remove the createNewsRelease and createPDF fuseactions (nodes) from this xml file?

      Can anyone help me?

      Thx
        • 1. Re: manipulating an xml file
          Level 7
          zubair wrote:
          > Hi,
          >
          > I am trying to use coldfusion to edit an xml file. Well its actually a fusebox
          > file (circuit.xml.cfm).
          >
          > I'd like to use the the microsoft xmldom object to do this like so...
          > CreateObject("com", "Microsoft.XMLDOM")
          >
          > My xml file looks like this:
          >
          > what i'd like to do is to remove the createNewsRelease and createPDF
          > fuseactions (nodes) from this xml file?

          MS's DOM is based on the w3 one so Node.removeChild(child) should work.
          But there's an easier way in ColdFusion: XmlParse and friends. Is there
          a specific reason why you're not using those ?

          --
          Mack