Neal Walters published his new XML for Microsoft developers training course on Udemy as of June 2020. Parts of the course apply to non-Microsoft environments and that includes XML basics, XSD, XPath, XQuery, and XSLT, which are all W3C (W3.org) standards. The course shows how to deal with XML in three programming languages: 1) Visual Studio, 2) PowerShell, and 3) Transact SQL (T-SQL) for SQL Server.
The course includes other tools such as how to check, format, and validate XML with the NotePad++ plugins, and how to use other tools like VSCode and Microsoft’s XML Notepad.
The full outline is below.
Intro to XML
- XML Files with Elements and Nesting (Flight01/Flight02) and Empty Element
- XML Files with Attributes (Flight03-07)
- XML Files – Misc Features – Declarative, Comments (Sample01)
- XML Encoding Special Characters (Sample02) – Intro to PowerShell
- XML Unicode & Byte Order Mark (Sample03_Unicode.xml)
- XML Files – Namespace
- Review with chart (see image tab)
- XML to JSON using PowerShell/NewtonSoft .Net Library
- XML to JSON – PowerShell – formatting/indenting
- Bonus: Example of JSON Used in JavaScript
- Finding Well-Formed Errors (The Divide and Conquer Method)
XML Tools: Editors & Browsers
- Editing XML with NotePad++
- Editing XML with Visual Studio (2019)
- Adding Xpath Tools (Extension) to Visual Studio (From Marketplace)
- Editing XML with VS Code
- Microsoft XML Notepad
- Commercial Tools: Stylus Studio, XML Spy, Oxygen
- How Browsers handle XML (normal, with errors, with stylesheet)
XPath
- XPath Intro – and How to Practice Answers to Quizes In this Module
- Simple element selection (including subscripts and text())
- Attributes and simple “where” clauses
- More where clauses (elements and/or)
- Relative paths
- XPath Axes – Documentation and Samples
- Namespaces – Part 1
- Namespaces – Part 2
- Real world, Difficult XPath
- Functions: Count, Sum, Contains, Starts-with, Substring-Before
- XPath 2.0, 3.0, 3.1
C# Programming – XmlDocument and XPath
- XMLDocument – Load, LoadXML, Save, PrettyPrint
- XMLDocument, SelectNodes, SelectSingleNode, GetElementsByTagName
- XMLDocument – pretty print to a string
- XMLDocument – Navigation: NextSibling, PreviousSibling, ParentNode
- Validate XML data against a Schema
- Add a new attribute to existing element
- Add a new element to existing element
- Removing elements and attributes (XmlNode Properties/Methods)
- C# Assignment – Getting values from an XML Config File
- C# Assignment Solution – Getting values from an XML Config File
C# – Streaming – XMLReader
- Validate XML data against a Schema
- XPathNavigator (Streaming)
- Saxon (Third Party Library)
- Microsoft CORE
XSD Schemas
- XSD Schema Intro (also mention DTD, XDR Schemas, RelaxNG, Schematron)
- Generate Schema from Web – Validation in NotePad++
- PowerShell – using .Net Library – Schema Inference
- XSD Elements and Attributes (MaxOccurs)
- XSD Restrictions
- XSD Empty, Elements Only, Text Only, Mixed
- XSD Indicators, All, Choice, Sequence, maxOccurs, MinOccurs, Groups
- Any Element and anyAttribute
- XSD Data Types
- Allowing Nulls
- Validating the Schema Syntax in C#
- PowerShell Equivalent of Last Video
- Discussion of Schema Editors (And Demo of BizTalk)
- Industry Standard Schemas – Example OAGIS
- Schema/Contract Development
JSON Schema
- Generate JSON Schema from JSON file
XSLT
- How Mapping Fits into the Business Processes
- Intro to XSLT – Big Picture
- HelloWorld Example – Running .NET XSLT 1.0 in PowerShell
- HelloWorld Example – Running Saxon XSLT 3.0 in PowerShell
- ForEach and ApplyTemplates
- If/Test and Choose/When (Long Version with Errors/Debugging)
- If/Test and Choose/When (Short pre-canned version)
- Variables in XSLT
- Sort
- Key and Xpath Lookup
- Muenchian Grouping in 1.0 and new feature in 3.0
- Assignment 1 – Map Shakespeare to New XML
- Assignment 1 – Solution
- Assignment 2 – Build HTML Web Page from Flight03
- Assignment 2 – Solution – Part 1 of 3
- Assignment 2 – Solution – Part 2 of 3
- Assignment 2 – Solution – Part 2 of 3
XQuery
- Introduction (Slide Presentation)
- Saxon.exe – Example Flight03.xml
- Saxon.exe – Example Shakespeare Hamlet.xml
- Saxon.exe – Example Vidoes.xml – join and multiple FLWOR
- XQuery in SQL Server Queries
- PowerShell Examples (Saxonica and SQL/XQuery)
C# Programming with Saxonica API
- Downloading and Documentation
- XPath
- XSLT
- XQuery
C# Programming and XSD.exe – Serialization/Deserialization
- Serialize (Object to XML) and Deserialize (XML to Object)
- XSD.exe – big picture (slides)
- XSD.exe – Generated a class from a schema
- Creating a fully populated object from the generated class
- XSD.exe – Generated schema from a class
XML DataType in SQL Server
- The XML Column
- Populating XML Column with Shakespeare File Data
- Querying XML Column using XPath
- Querying XML Column using XPath
- Query XML Column – one to many – with Cross Apply
- XML Column and the Like Clause
- XML Column and the Exist Method
- XML Column and the Modify Method
- Working with Namespaces Prefixes
- Intro to XML Column Indexes
- Vote for Future SQL Improvements
Loading XML into SQL Tables (using T-SQL and SSMS)
- Bonus – Designing/Creating Tables – Part 1
- Bonus – Designing/Creating Tables – Part 2
- Bonus – Database Redesign – Part 3
- Bonus – Manual Data Entry Airlines, Airports, Flights
- Populate Reservation Table from Flight03.xml using OpenRowSet
- Improve Last SQL Script (for Reservation Table)
- Manually Entering Flight Data
- Loading FlightReservation Table (one to many relationships)
- Canned shorter version of prior Video
- Bonus: Overview of UpdateGrams (SQLXML 4.0)
- OpenXML
- Bonus: How The Database could be Populated with Biztalk (and UDTs)
- Assignment – C# Load of Database
- Assignment – C# Load of Database Solution
Querying SQL Data as XML
- Intro to the “For XML” clause and it’s variations
- For XML RAW in T-SQL
- For XML AUTO in T-SQL
- For XML EXPLICIT in T-SQL – Introductory Concepts
- For XML EXPLICIT in T-SQL – Sample
- For XML PATH in T-SQL – Introductory Concepts
- For XML PATH in T-SQL – Sample
- PowerShell to run For XML SQL command and save result to file
XML and PowerShell
- Simple PowerShell with Flight01.xml
- Some PowerShell Tips for Newbies (MOVE TO INTRO???)
- Simple PowerShell – Pipe to Format-Table and Format-List
- Using Select-XML or the .NET SelectNode/SelectSingleNode
- Convert XML To CSV or to HTML
- Convert To XML
- Converting XML to JSON
- Pretty-Print all XML in disk directories (preserving datetime)
Get the XML Course for Microsoft Visual Studio, PowerShell, and SQL Developers here.