[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 411
  • Last Modified:

Need transform that will remove ALL id information

I need a transform which will remove all id information from zillions of xml records in the format below. I don't know how to do this. I want to retain just the names, no ids. Who knows how to do this?

<?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="Unspecified" MatchNotFoundAction="Unspecified" 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 Publication" id="Staff_Publication_10759">
      <Records>
        <Record>
          <PropertyValues>
            <PropertyValue name="Record ID" id="Record_ID_10760">14505</PropertyValue>
            <PropertyValue name="Author" id="Author_10761">Vader, Darth</PropertyValue>
            <PropertyValue name="Found In" id="Found_In_10762">Galaxy News</PropertyValue>
            <PropertyValue name="Title" id="Title_10763">The Force: Why it makes me rule</PropertyValue>
            <PropertyValue name="Source" id="Source_10764">Dark Side Inc</PropertyValue>
            <PropertyValue name="Publication Number" id="Publication_Number_10765">00000000</PropertyValue>
            <PropertyValue name="Publication Year" id="Publication_Year_10766">1970</PropertyValue>
            <PropertyValue name="Subject" id="Subject_10767">High potentials</PropertyValue>
            <PropertyValue name="In Print" id="In_Print_10769">Yes?</PropertyValue>
            <PropertyValue name="Location" id="Location_10770">Archives</PropertyValue>
            <PropertyValue name="Notes" id="Notes_10772">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" id="Entry_Date_10776">August 1, 2012</PropertyValue>
            <PropertyValue name="Abstract" id="Abstract_10778">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" id="Last_Modified_10783">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>
0
GessWurker
Asked:
GessWurker
  • 2
1 Solution
 
Geert BormansCommented:
Here you go

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
    <xsl:template match="node() | @*">
        <xsl:copy>
            <xsl:apply-templates select="node() | @*"/>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="@id"/>
</xsl:stylesheet>

Open in new window

0
 
GessWurkerAuthor Commented:
Perfect! Cheers!!
0
 
Geert BormansCommented:
welcome
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now