
Reading XML in C Sharp With XDocument and LINQ to XML
Load XML into XDocument, query with LINQ, cast attributes and elements to typed values, handle namespaces, and avoid the culture trap in decimal.Parse.
Tag
590 posts

Load XML into XDocument, query with LINQ, cast attributes and elements to typed values, handle namespaces, and avoid the culture trap in decimal.Parse.

A tested guide to analytics on JSON event data: envelope versus properties, funnels and retention, typed columns, indexes, type drift and backfills.

A tested guide to testing JSON output: asserts, snapshots, volatile fields, schemas, generated data, fixtures and property tests, with a mutation matrix.

Decode JSON into Go structs with struct tags: null versus missing with pointers, case-insensitive keys, int64 ids, wrong-type errors and the omitempty trap.

Why a PUT drops fields, why dict.update clobbers nested objects, how absent differs from null in Pydantic, and how field-level SQL avoids lost updates.

Measure schema drift in a jsonb column with key counts and type counts, see how it changes a sum, and stop it with a NOT VALID check constraint.

A cron job that writes a daily CSV report from SQL: wrapper script, atomic output, a lock against overlap and the environment traps that bite at 2 a.m.

Capture every row an import refuses, with its line, column and reason, in a form a person can fix and replay. A DuckDB example with real reject tables.

Load small reference CSVs with dbt seeds from version control, set column types so zip codes keep their zeros, and learn when seeds are the wrong tool.

Load a daily CSV in Airflow with one plain Python task instead of a chain of operators: idempotent by date, safely retried and testable outside Airflow.

Poll a folder for new CSV files and import each only once it has stopped changing. Why file events fire too early, a stable-file watcher and inotify on Linux.

Move each CSV out of the inbox only after its load commits, compress and verify it into dated folders, and expire old files with a clear retention rule.