The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Archive for the ‘XML/XSD’ Category

Hopefully by now the Chocolatey .nuspec extensions and limitations are documented in a more central way

Posted by jpluimers on 2025/08/08

Chocolatey extends the NuGet file format .nuspec based XML files as base for their packages with at the time of writing very sparse and limited documentation in what it extends, why it does that and what extra limitations it imposes on the fields used inside .nuspec files.

Hopefully by now that has improved, so this post is a reminder to myself to check that out eventually.

At the time of writing, the NuGet .nuspec documentation was at [Wayback/Archive] .nuspec File Reference for NuGet | Microsoft Learn and the file format at [Wayback/Archive] NuGet.Client/nuspec.xsd at dev · NuGet/NuGet.Client. Most fields are defined as primitive data types xs:boolean, xs:string and xs:anyURI (of the 19 available primitive XML SChema (W3C) types). Some composite data types are are composed from them using local and global complexType, most using xs:all, xs:attribute or single-type unbounded xs:sequence (which all imply no particular order).

Since an XML Schema allows to both use restriction and extension on data types (the eXtensible in XML!), making them more strict is a relatively straight-forward operation and has the benefit of having these in a central place.

In the past for more than 5 years [Wayback/Archive] Is there a specification for the package format? · Issue #379 · chocolatey/choco was just pointing to the NuGet .nuspec format, but after a request to re-open new comments were made pointing to a current issue (basically a stub, but still) and a Chocolatey nuspec.xsd file, yay!

Still it was a quest to figure out the additional rules they have added, especially since the documentation was sparse and sloppy.

Read the rest of this entry »

Posted in Chocolatey, Development, Power User, Windows, Windows 10, Windows 11, Windows 7, Windows 8, Windows 8.1, XML/XSD, XSD | Tagged: , , , , , , | Leave a Comment »

Windows event log querying from the command line: wevtutil (with XPath query parameters and XML output)

Posted by jpluimers on 2025/04/23

A while ago, I needed to investigate reboot events on some Windows 10 systems. I wanted to use the console instead of the eventvwr GUI Event Viewer.

There is a tool for that called wevtutil which – like eventvwr – uses XPath query parameters and produces XML output.

Postprocessing XML can be a thing, but since .NET has great XML support, you can use PowerShell for that (which for me often is way easier than going the XSLT route, for instance because Windows lacks built-in console XSLT tooling).

Based on the help and the below links, my query command then on these machines turned out to be this: Read the rest of this entry »

Posted in Batch-Files, CommandLine, Development, PowerShell, PowerShell, Scripting, Software Development, XML, XML/XSD, XPath, XSLT | Leave a Comment »

Enabling XML Auto Commenting C# in Visual Studio Code is in an odd setting (via Stack Overflow)

Posted by jpluimers on 2025/03/18

In Visual Studio Code I already had [Wayback/Archive] C# – Visual Studio Marketplace: C# for Visual Studio Code (powered by OmniSharp) installed in (through code --install-extension ms-dotnettools.csharp), and wanted automatic XML documentation comments generation just like Visual Studio does:

[Wayback/Archive] XML documentation comments – document APIs using /// comments | Microsoft Learn

Read the rest of this entry »

Posted in .NET, C#, Development, Hardware, Java, Java Platform, Keyboards and Keyboard Shortcuts, KVM keyboard/video/mouse, Power User, Software Development, XML, XML/XSD | Tagged: , , , , , | Leave a Comment »

Weather info in plain text or JSON

Posted by jpluimers on 2025/03/06

Two sites that can help you out getting weather info on the console:

wttr.in

wttr.in is developed by [Wayback/Archive] Igor Chubin (@igor_chubin) / X and looks at the request header to figure out what kind of output it sends.

It supports various output formats, so on my TODO list is to see how they do their mapping: always an opportunity to learn (it’s based on Python and Go so I am curious what libraries they use as well).

From the documentation:

wttr.in currently supports five output formats:

  • ANSI for the terminal;
  • Plain-text for the terminal and scripts;
  • HTML for the browser;
  • PNG for the graphical viewers;
  • JSON for scripts and APIs;
  • Prometheus metrics for scripts and APIs.

The ANSI and HTML formats are selected based on the User-Agent string.

There are more parameters in the documentation on the main page of the repository and through this command:

curl wttr.in/:help

The idea is derived from [Wayback/Archive] GitHub – schachmat/wego: weather app for the terminal.

Oh: Igor has more repositories at [Wayback/Archive] chubin (Igor Chubin) · GitHub (including [Wayback/Archive] GitHub – chubin/cheat.sh: the only cheat sheet you need which is hosted at [Wayback/Archive] cheat.sh; I thought I had blogged about that before, but found it only in a draft note mentioning that I got it via [WaybackSave/Archive] Nicolas Krassas on X: “The only cheat sheet you need cheat.sh)

7timer

A 7 timer JSON usage example is at [Wayback/Archive] Get Weather from 7Timer! · GitHub

It has documentation at

Output formats can be chosen from HTML, PNG, XML and JSON.

Via

[Wayback/Archive] Hacker Public Radio – hpr4266 :: What’s the weather?
Lee writes a script to check what the weather is like ~ The Technology Community Podcast

HPR is a great podcast series!

--jeroen

Posted in *nix, *nix-tools, ash/dash, bash, bash, Development, Go (golang), JavaScript/ECMAScript, JSON, Power User, Python, Scripting, Software Development, Web Development, XML/XSD | Leave a Comment »

Updated monthly after the 8th day of the month – Welcome to the BAG: The Dutch Building and Addresses database – Bert Hubert’s writings

Posted by jpluimers on 2025/01/17

[Wayback/Archive] Welcome to the BAG: The Dutch Building and Addresses database – Bert Hubert’s writings

Bert made a test page for it too: [Wayback/Archive] berthub.eu/pcode/2513AA/14 (postal code for “Binnenhof”)

And a repository: [Wayback/Archive] GitHub – berthubert/bagconv: Convert Dutch building/dwelling administration into a simpler format

The BAG (Basisregistratie Adressen en Gebouwen) information, which is maintained by the Dutch Kadaster (Cadastre), allows bug reporting, which is processed remarkably quickly: [Wayback/Archive] Postcode + huisnummer niet uniek in Emmen? – Datasets / BAG – Geoforum

Via: [Wayback/Archive] bert hubert 🇺🇦🇪🇺: “I’ve updated my conversion of the official Dutch address, postcode, building database (BAG) with the July 2024 release. Description in English, API, code, CSV files can be found on …” – Fosstodon

--jeroen

Posted in C++, Database Development, Development, Software Development, SQLite, XML, XML/XSD | Leave a Comment »

How to extract playlists (list of file locations) from iTunes using python – Stack Overflow

Posted by jpluimers on 2024/12/18

While migrating from iTunes on one machine to Apple Music on another one, I needed to migrate part of the (disorganised) playlists.

I knew there was a binary ~/Music/iTunes/iTunes Library.itl file, but that is encoded or encrypted, making it hard to parse.

Luckily there is also ~/Music/iTunes/iTunes Music Library.xml which I found via the links below.

Read the rest of this entry »

Posted in Apple, Development, iTunes, Mac OS X / OS X / MacOS, Power User, Python, Scripting, Software Development, XML, XML/XSD | Leave a Comment »

Markdown has been the Internet’s lingua franca for documentation. Microsoft finally the documentation format with markitdown: Python tool for converting files and office documents to Markdown.

Posted by jpluimers on 2024/12/17

Finally an easier way to convert Office documents (and other formats) to markdown: [Wayback/Archive] GitHub – microsoft/markitdown: Python tool for converting files and office documents to Markdown. (after Google added a Markdown export feature to Google Docs about half a year ago, and basic Markdown formatting about 2 years ago – see below):

There are quite a few dependencies in [Wayback/Archive] markitdown/pyproject.toml at main · microsoft/markitdown · GitHub, so be prepared for that.

Supported formats (added links for clarity):

The MarkItDown library is a utility tool for converting various files to Markdown (e.g., for indexing, text analysis, etc.)
It presently supports:
  • PDF (.pdf)
  • PowerPoint (.pptx)
  • Word (.docx)
  • Excel (.xlsx)
  • Images (EXIF metadata, and OCR)
  • Audio (EXIF metadata, and speech transcription)
  • HTML (special handling of Wikipedia, etc.)
  • Various other text-based formats (csv, json, xml, etc.)

Google was first though:

  1. [Wayback/Archive] Google Workspace Updates: Compose with Markdown in Google Docs on web
  2. [Wayback/Archive] Google Workspace Updates: Import and export Markdown in Google Docs

There is speculation on why Microsoft introduced it just now ranging from “they need it for AI training” to “just late to the game”. I’m with the latter. Apple is even later, so if you want to convert Apple Notes to markdown, then you can use [Wayback/Archive] Import from Apple Notes – Obsidian Help.

Via various sources, including:

Read the rest of this entry »

Posted in CSV, Development, Excel, HTML, HTML5, JSON, Lightweight markup language, MarkDown, Office, PDF, Power Point, Power User, Software Development, Word, XML/XSD | Tagged: , | Leave a Comment »

ValueError: invalid literal for int() with base 10: ” by tzwickl · Pull Request #768 · sivel/speedtest-cli

Posted by jpluimers on 2024/11/22

Somehow this post missed the schedule and for a long time I forgot to properly checked for “missed schedule” posts.

Back in 2021, suddenly systems with speedtest-cli threw a [Wayback/Archive] ValueError: invalid literal for int() with base 10: ” by tzwickl · Pull Request #768 · sivel/speedtest-cli after accessing the speedtest.net servers.

Around 7-8 April, 2021 the speedtest.net/speedtest-config.php XML configuration suddenly had changed the value for the XPath expression /settings/server-config/@ignoreids from being a list of integers into empty, see the archived files below.

Read the rest of this entry »

Posted in Development, JavaScript/ECMAScript, Python, Scripting, Software Development, XML/XSD, XPath | Tagged: , | Leave a Comment »

XPath based bookmarklets for Archive.is: more JavaScript fiddling!

Posted by jpluimers on 2023/09/20

As I promised a few months back in Bookmarklets for Archive.is and the WayBack Machine to go to the original page, moar JavaScript fiddling, this time with XPath based bookmarklets to navigate from Archive.is pages to Saved From, Redirected from, Via and Original pages.

An alternative would be using XPath as the additional fields are always structured in a table like the html below (taking complex pages like https://archive.ph/5iVVH and https://archive.ph/2015.11.14-044109/http://www.example.org/ as an example).

I got triggered to using XPath from this answer from [Wayback/Archive] gdyrrahitis at [Wayback/Archive] Javascript .querySelector find by innerTEXT – Stack Overflow (thanks [Wayback/Archive] passwd for asking):

Read the rest of this entry »

Posted in Agile, Bookmarklet, Code Quality, Code Review, Development, HTML, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Browsers, Web Development, XML/XSD, XPath | Leave a Comment »

HTML / XML / RSS link checker – Visual Studio Marketplace

Posted by jpluimers on 2022/10/04

On my list of Visual Studio Code extensions to try (after I change the shortcuts, as direct Alt shortcuts are not a good idea, luckily those are configurable)

[Wayback/Archive.is] HTML / XML / RSS link checker – Visual Studio Marketplace (partly paraphrased):

VSCode extension that checks for broken links in an HTML, XML, RSS, PHP, or Markdown file.

Checks currently open file:

  • for broken links in anchor-href, link-href, img-src, and script-src tags in currently-open HTML or PHP file
  • both clearnet and onion (Tor) links
  • for badly-formatted mailto links, and duplicate local anchors (anchor-name, anchor-id)
  • for working HTTPS equivalents of HTTP links

Optionally checks for invalid characters and common mistakes (missing tag content, empty attribute value, more).

Also checks for errors in a small subset of semantic HTML tags (in HTML and PHP files): checks that each page has header, main, footer; checks that each heading is inside a section, article, or aside; checks that each section/article/aside has exactly one heading in it; checks that heading values are nested properly.

To see/change settings for this extension, open Settings (Ctrl+,) / Extensions / “HTML / XML / RSS link checker”.

To change the key-combinations for this extension, open File / Preferences / Keyboard Shortcuts and search for Alt+H or Alt+T or Alt+M or Alt+L.

–jeroen

Posted in .NET, Development, HTML, Lightweight markup language, MarkDown, Power User, RSS, Software Development, vscode Visual Studio Code, Web Development, XML, XML/XSD | Leave a Comment »