We help IT Professionals succeed at work.
Get Started

Need a transform. Relatively simple(?)

GessWurker
GessWurker asked
on
465 Views
Last Modified: 2012-08-16
I need what I think is a relatively simple transform (but not for me!).  I just need to add the "match" elements. e.g.,

         <Match>
           <PropertyValues>
              <PropertyValue name="Record ID">14505</PropertyValue>
           </PropertyValues>
         </Match>
 

Here's my input (which lacks <Match>...):

<?xml version="1.0" encoding="UTF-8"?>
<Import>
  <ImportSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ImportFileFormat="Xml" MatchFoundAction="ReplaceRecord" MatchNotFoundAction="RejectRecord" UnrecognizedPropertyOption="Unspecified" ContentDetailExceptionOption="Unspecified" BubbleEventsOption="Unspecified" IsUpgradeOption="IsUpgrade" FileDispositionOption="Unspecified" BinaryFileDispositionOption="Unspecified" SkipRecordCount="0" MaximumRecordCount="0" UseSaxon="false">
    <SinkPath />
    <ExceptionFilePath />
    <AltBinariesPath />
    <TransformURL />
    <TransformFileWrapper />
    <LocalizablePropertyLocale>en-US</LocalizablePropertyLocale>
  </ImportSettings>
  <ContentTypes>
    <ContentType name="Staff Publications">
      <Records>
        <Record>
          <PropertyValues>
            <PropertyValue name="Record ID">13457</PropertyValue>
            <PropertyValue name="Author">Baldwin, David</PropertyValue>
            <PropertyValue name="Author">Grayson, Curt</PropertyValue>
            <PropertyValue name="Title">Influence: Gaining commitment, getting results</PropertyValue>
            <PropertyValue name="Source">Greensboro, NC: Center for Creative Leadership</PropertyValue>
            <PropertyValue name="Publication Number">CCL# 424</PropertyValue>
            <PropertyValue name="Publication Year" id="Publication_Year_10766">2004</PropertyValue>
            <PropertyValue name="Subject">Influence</PropertyValue>
            <PropertyValue name="Notes">Ideas into action guidebook</PropertyValue>
            <PropertyValue name="Notes">Includes: tables, self-guided worksheet, suggested reading</PropertyValue>
            <PropertyValue name="Full Text"/>
            <PropertyValue name="Entry Date">05/26/2004</PropertyValue>
            <PropertyValue name="PDF File">http://leadernet/departments/publications/Docs/CCL%20Press%20Digital%20Bookshelf/424.pdf</PropertyValue>
            <PropertyValue name="Abstract">This book includes an assessment too to help readers determine the influence tactics they currently use. Some tactics depend on logic, others appeal to emotions, and others are cooperative appeals.</PropertyValue>
            <PropertyValue name="Last Modified">7/25/2012 7:19:00 PM</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Others|Driving Team Effort</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Managers|Influencing, Leadership, Power</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Others|Brings Out the Best in People</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Managers|Selecting, Developing, Accepting People</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Managers|Inspiring commitment</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Function|Leading Change</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Others|Motivating Others</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Others|Influence Others</PropertyValue>
            <PropertyValue name="ContentItemLanguage" id="ContentItemLanguage" />
            <PropertyValue name="Active" id="Active">True</PropertyValue>
            <PropertyValue name="inmCreatedBy" id="inmCreatedBy">Admin</PropertyValue>
            <PropertyValue name="inmCommunity" id="inmCommunity" />
          </PropertyValues>
        </Record>
         <Record>
          <PropertyValues>
            <PropertyValue name="Record ID">14505</PropertyValue>
            <PropertyValue name="Author">Vader, Darth</PropertyValue>
            <PropertyValue name="Found In" id="Found_In_10762">Galaxy News</PropertyValue>
            <PropertyValue name="Title">The Force: Why it makes me rule</PropertyValue>
            <PropertyValue name="Source">Dark Side Inc</PropertyValue>
            <PropertyValue name="Publication Number">00000000</PropertyValue>
            <PropertyValue name="Publication Year" id="Publication_Year_10766">1970</PropertyValue>
            <PropertyValue name="Subject">High potentials</PropertyValue>
            <PropertyValue name="In Print" id="In_Print_10769">Yes?</PropertyValue>
            <PropertyValue name="Location" id="Location_10770">Archives</PropertyValue>
            <PropertyValue name="Notes">This is a really important document</PropertyValue>
            <PropertyValue name="Full Text" id="Full_Text_10773">Blah blah blah</PropertyValue>
            <PropertyValue name="Doc Import" id="Doc_Import_10774">How do you do this?</PropertyValue>
            <PropertyValue name="Entry Date">August 1, 2012</PropertyValue>
            <PropertyValue name="Abstract">Blah blah blah blah blah (shortened)</PropertyValue>
            <PropertyValue name="Type" id="Type_10780">Kit</PropertyValue>
            <PropertyValue name="External Link" id="External_Link_10782">http://www.weather.com/</PropertyValue>
            <PropertyValue name="Last Modified">8/1/2012 7:02:00 PM</PropertyValue>
            <PropertyValue name="Rating" id="Rating" UserName="admin" EntryDate="8/1/2012 7:02:00 PM">5.00</PropertyValue>
            <PropertyValue name="Voting" id="Voting" UserName="admin" EntryDate="8/1/2012 7:02:00 PM">1.00</PropertyValue>
            <PropertyValue name="Tags" id="Tags" UserName="admin" EntryDate="8/1/2012 5:45:00 PM">awesomeness, world domination, mind control</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Function|Leading Change|Fosters a climate of experimentation.</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Function|Create a Common Vision</PropertyValue>
            <PropertyValue name="ContentItemLanguage" id="ContentItemLanguage" />
            <PropertyValue name="Active" id="Active">True</PropertyValue>
            <PropertyValue name="inmCreatedBy" id="inmCreatedBy">admin</PropertyValue>
            <PropertyValue name="inmCommunity" id="inmCommunity" />
          </PropertyValues>
        </Record>
      </Records>
    </ContentType>
  </ContentTypes>
</Import>


Here's my desired output:

<?xml version="1.0" encoding="UTF-8"?>
<Import>
  <ImportSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ImportFileFormat="Xml" MatchFoundAction="ReplaceRecord" MatchNotFoundAction="RejectRecord" UnrecognizedPropertyOption="Unspecified" ContentDetailExceptionOption="Unspecified" BubbleEventsOption="Unspecified" IsUpgradeOption="IsUpgrade" FileDispositionOption="Unspecified" BinaryFileDispositionOption="Unspecified" SkipRecordCount="0" MaximumRecordCount="0" UseSaxon="false">
    <SinkPath />
    <ExceptionFilePath />
    <AltBinariesPath />
    <TransformURL />
    <TransformFileWrapper />
    <LocalizablePropertyLocale>en-US</LocalizablePropertyLocale>
  </ImportSettings>
  <ContentTypes>
    <ContentType name="Staff Publications">
      <Records>
        <Record>
         <Match>
           <PropertyValues>
              <PropertyValue name="Record ID">13457</PropertyValue>
           </PropertyValues>
         </Match>
          <PropertyValues>
            <PropertyValue name="Record ID">13457</PropertyValue>
            <PropertyValue name="Author">Baldwin, David</PropertyValue>
            <PropertyValue name="Author">Grayson, Curt</PropertyValue>
            <PropertyValue name="Title">Influence: Gaining commitment, getting results</PropertyValue>
            <PropertyValue name="Source">Greensboro, NC: Center for Creative Leadership</PropertyValue>
            <PropertyValue name="Publication Number">CCL# 424</PropertyValue>
            <PropertyValue name="Publication Year" id="Publication_Year_10766">2004</PropertyValue>
            <PropertyValue name="Subject">Influence</PropertyValue>
            <PropertyValue name="Notes">Ideas into action guidebook</PropertyValue>
            <PropertyValue name="Notes">Includes: tables, self-guided worksheet, suggested reading</PropertyValue>
            <PropertyValue name="Full Text"/>
            <PropertyValue name="Entry Date">05/26/2004</PropertyValue>
            <PropertyValue name="PDF File">http://leadernet/departments/publications/Docs/CCL%20Press%20Digital%20Bookshelf/424.pdf</PropertyValue>
            <PropertyValue name="Abstract">This book includes an assessment too to help readers determine the influence tactics they currently use. Some tactics depend on logic, others appeal to emotions, and others are cooperative appeals.</PropertyValue>
            <PropertyValue name="Last Modified">7/25/2012 7:19:00 PM</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Others|Driving Team Effort</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Managers|Influencing, Leadership, Power</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Others|Brings Out the Best in People</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Managers|Selecting, Developing, Accepting People</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Managers|Inspiring commitment</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Function|Leading Change</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Others|Motivating Others</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Others|Influence Others</PropertyValue>
            <PropertyValue name="ContentItemLanguage" id="ContentItemLanguage" />
            <PropertyValue name="Active" id="Active">True</PropertyValue>
            <PropertyValue name="inmCreatedBy" id="inmCreatedBy">Admin</PropertyValue>
            <PropertyValue name="inmCommunity" id="inmCommunity" />
          </PropertyValues>
        </Record>
        <Record>
         <Match>
           <PropertyValues>
              <PropertyValue name="Record ID">14505</PropertyValue>
           </PropertyValues>
         </Match>
          <PropertyValues>
            <PropertyValue name="Record ID">14505</PropertyValue>
            <PropertyValue name="Author">Vader, Darth</PropertyValue>
            <PropertyValue name="Found In" id="Found_In_10762">Galaxy News</PropertyValue>
            <PropertyValue name="Title">The Force: Why it makes me rule</PropertyValue>
            <PropertyValue name="Source">Dark Side Inc</PropertyValue>
            <PropertyValue name="Publication Number">00000000</PropertyValue>
            <PropertyValue name="Publication Year" id="Publication_Year_10766">1970</PropertyValue>
            <PropertyValue name="Subject">High potentials</PropertyValue>
            <PropertyValue name="In Print" id="In_Print_10769">Yes?</PropertyValue>
            <PropertyValue name="Location" id="Location_10770">Archives</PropertyValue>
            <PropertyValue name="Notes">This is a really important document</PropertyValue>
            <PropertyValue name="Full Text" id="Full_Text_10773">Blah blah blah</PropertyValue>
            <PropertyValue name="Doc Import" id="Doc_Import_10774">How do you do this?</PropertyValue>
            <PropertyValue name="Entry Date">August 1, 2012</PropertyValue>
            <PropertyValue name="Abstract">Blah blah blah blah blah (shortened)</PropertyValue>
            <PropertyValue name="Type" id="Type_10780">Kit</PropertyValue>
            <PropertyValue name="External Link" id="External_Link_10782">http://www.weather.com/</PropertyValue>
            <PropertyValue name="Last Modified">8/1/2012 7:02:00 PM</PropertyValue>
            <PropertyValue name="Rating" id="Rating" UserName="admin" EntryDate="8/1/2012 7:02:00 PM">5.00</PropertyValue>
            <PropertyValue name="Voting" id="Voting" UserName="admin" EntryDate="8/1/2012 7:02:00 PM">1.00</PropertyValue>
            <PropertyValue name="Tags" id="Tags" UserName="admin" EntryDate="8/1/2012 5:45:00 PM">awesomeness, world domination, mind control</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Function|Leading Change|Fosters a climate of experimentation.</PropertyValue>
            <PropertyValue name="Category" id="Category">Competency|Competency Collection|Leading Function|Create a Common Vision</PropertyValue>
            <PropertyValue name="ContentItemLanguage" id="ContentItemLanguage" />
            <PropertyValue name="Active" id="Active">True</PropertyValue>
            <PropertyValue name="inmCreatedBy" id="inmCreatedBy">admin</PropertyValue>
            <PropertyValue name="inmCommunity" id="inmCommunity" />
          </PropertyValues>
        </Record>
      </Records>
    </ContentType>
  </ContentTypes>
</Import>
Comment
Watch Question
Information Architect
CERTIFIED EXPERT
Top Expert 2006
Commented:
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE