Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

manipulating an xml file

Explorer ,
Jan 29, 2009 Jan 29, 2009
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
TOPICS
Advanced techniques
255
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 29, 2009 Jan 29, 2009
LATEST
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources