Updating HR-XML without wiping it out

AhrimanSefid

New Member
I am currently loading HR-XML PersonName into my database.Details on: [HR-XML PersonName] (http://www.immagic.com/eLibrary/TECH/HR_XML/H011016A.pdf)I use the following function:\[code\]<cffunction name="commit" returnType="boolean" access="remote"><cfargument name="UserID" required="true" type="string"><cfargument name="rc" required="true" type="struct"><cfargument name="ByUserID" required="true" type="string"><cfscript>this.setUser(arguments.UserID);param rc.middleName = "";param rc.postfix = "";param rc.comments = "";// Create a home pathif (not isNumeric(arguments.userID)) { this.ormUser.setCreateBy(this.getName(arguments.byuserid)); homePath = rc.lastname & rc.firstname; homePath = left(replacelist(homePath, "., ", ","), 10); if (this.ormUser.existsHomePath(homePath)) { homepath &= day(now()); } this.ormUser.setHomePath(homepath); }</cfscript> <cfsavecontent variable="local.personname"><cfoutput><PersonName xmlns="http://ns.hr-xml.org/2007-04-15"><GivenName>#trim(rc.firstname)#</GivenName><cfif rc.middleName NEQ ""> <MiddleName>#rc.middleName#</MiddleName></cfif><FamilyName>#trim(rc.lastname)#</FamilyName><cfif rc.postfix NEQ ""> <Affix type="qualification">#trim(rc.postfix)#</Affix></cfif></PersonName></cfoutput> </cfsavecontent><cfscript>// Committhis.ormUser.setPersonName (local.personName);this.ormUser.setStars (rc.stars);this.ormUser.setEmail (rc.email);this.ormUser.setComments (rc.comments);this.ormUser.setuStatus (rc.ustatus);this.ormUser.setModifyBy(this.getName(arguments.byuserid));entitySave(this.ormUser);ormFlush();return true;</cfscript></cffunction> \[/code\]QuestionWhenever I update PersonName, I am overwriting the whole field. If there is a clean way to manipulate the XML, I would prefer that. There is no requirement that I use or not use ORM.
 
Back
Top