LogoLogo
HomePricingDocumentation
  • ๐Ÿ’ฟGetting Started
    • Installation and Project Setup
    • Hello Perigee!
    • Perigee Application Design
    • Hello Configuration
    • Hello Logs
    • Hello Integration
    • Troubleshooting
    • Case Studies
  • ๐Ÿ“ƒLicense + Notice
    • ๐Ÿ“‚Licensing
    • Notice of Third Party Agreements
  • ๐Ÿš€Perigee and Beyond
    • Extending - Threads
    • Extending - Loaders
    • โณAll about CRON
  • ๐Ÿ”ฎAPI Generation
    • What is API Generation?
    • API Builder
  • ๐Ÿ—บ๏ธArchitecting YOUR App
    • Design and Requirements
    • Define Sources
    • Requirements
  • ๐ŸงฉCore Modules
    • ๐ŸŒPerigeeApplication
    • ๐ŸชกThread Registry
    • Event Sources
      • Scheduled/Logic
        • CRON Thread
        • Scheduler
        • Sync Agent
      • Watchers
        • SalesForce
        • Sharepoint
        • Directory Watch
        • Directory Notifier
        • IMAP
    • Credential Management
      • Connection Strings
      • Custom Refresh Logic
      • RestSharp Authenticator
      • Credential Store SDK
      • โ‰๏ธTroubleshooting Credentials
    • Integration Utilities
      • HTTP(S) - RestSharp
      • Transaction Coordinator
      • Limiter
      • Watermarking
    • Alert Managers
      • SMS
      • Email
      • Discord
      • Teams
    • File Formats
      • Excel
      • CSV
    • ๐Ÿ“File System Storage
      • File Revision Store
      • Concurrent File Store
      • FileSync + Cache
    • Third Party
      • SmartSheets
      • Microsoft Graph
    • Perigee In Parallel
      • Parallel Processing Reference
      • Extensions
      • GroupProcessor
      • SingleProcessor
    • ๐ŸงฑUtility Classes
      • Metrics
      • F(x) Expressions
      • Multi-Threaded Processor (Scatter Gather)
      • OpenAI - GPT
      • XML Converter
      • Dynamic Data Table
      • Debounce
      • Thread Conditions
      • Perigee Utility Class
      • Network Utility
      • Lists
      • FileUtil
      • Inclusive2DRange
      • Strings, Numbers, Dates
      • Nested Sets
      • Behavior Trees
      • JsonCompress
      • Topological Sorting
      • DBDownloader
    • ๐ŸˆBit Serializer
  • ๐Ÿ“ฃExamples and Demos
    • API + Perigee
    • ๐Ÿ“ฐExcel Quick Load
    • SalesForce Watcher
    • Report Scheduler
    • Agent Data Synchronization
    • ๐Ÿ“ฉIMAP Echo bot
    • Watch and load CSVs
    • Graph Delegated Authorization + DataVerse
    • Coordinator Demo
    • Azure Service Bus
    • QuickBooks Online
  • ๐Ÿ“˜Blueprints
    • Perigee With .NET Hosting
    • Web Host Utilities
    • ๐Ÿ”ŒPlugin Load Context
  • ๐ŸŽž๏ธTransforms
    • ๐ŸŒŸWhat is Transforms?
    • ๐Ÿ“˜Terminology
    • ๐ŸฆพThe Mapping Document
    • ๐Ÿ‘พTransformation Process
    • ๐Ÿ˜ŽProfile
    • ๐ŸŽ’Automation
      • ๐Ÿ•“Package Options
      • ๐Ÿ”ณConfiguration
    • ๐Ÿ”งUtilities
      • ๐ŸงนClean
      • ๐Ÿ“‘Map File
      • ๐Ÿ”ŽFile Identification
      • ๐Ÿ—บ๏ธMap Generation
      • ๐Ÿช…Insert Statement Generation
  • ๐Ÿ—ƒ๏ธTransform SDK
    • ๐Ÿ‘‹Quick Start Guide
    • ๐ŸฅณMapTo
    • ๐Ÿ”ŒAuthoring Plugins
      • ๐Ÿ”˜File IO Process
      • ๐Ÿ“ขData Quality
      • ๐ŸŸขTransform Process
    • SDK Reference
      • ๐Ÿ”˜FileIOProcessData
      • ๐Ÿ“ขDataQualityContext
      • ๐ŸŽ›๏ธTransformDataContext
      • ๐Ÿ…TransformResult
Powered by GitBook
On this page
Export as PDF
  1. Core Modules
  2. Utility Classes

XML Converter

The XML Converter is a useful class designed to transform a simple XML "List" into a structured list of classes. In the example provided, there are three test_scores elements nested within the data element. Utilizing the converter simplifies the process of reading and utilizing the relevant data effectively.

//Sample data
string XScores = @"
<root>
  <result>
    <data>
      <test_scores>
        <firstName>John</firstName>
        <lastName>Doe</lastName>
        <score>87.5</score>
      </test_scores>
      <test_scores>
        <firstName>Jane</firstName>
        <lastName>Smith</lastName>
        <score>92.3</score>
      </test_scores>
      <test_scores>
        <firstName>Alice</firstName>
        <lastName>Brown</lastName>
        <score>78.9</score>
      </test_scores>
    </data>
  </result>
</root>";

//Read and convert the 3 test_scores to a List<APIXMLSample>
var xml = XMLConverter.FromXML<APIXMLSample>(XScores, "//result/data/test_scores");


/* Sample class, using XmlElement attribute */
public class APIXMLSample
    {
        [XmlElement("firstName")]
        public string FirstName { get; set; }

        [XmlElement("lastName")]
        public string LastName { get; set; }

        [XmlElement("score")]
        public decimal Score { get; set; }
    }
PreviousOpenAI - GPTNextDynamic Data Table

Last updated 3 months ago

๐Ÿงฉ
๐Ÿงฑ
Page cover image