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 ‘XPath’ Category

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 »

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 »

Schema Central: XML vocabularies with all their XSD schema’s in a nice browsable overview including references, explanations and examples

Posted by jpluimers on 2018/09/11

Schema Central, by [WayBackDatypic, Inc. (Priscilla Walmsley) is to golden that I quote the whole index page below.

The index refers to XML vocabularies. Each vocabulary page links the corresponding XSD pages. Each XSD page lists documentation, elements, etc. Each element page then documents the element, shows where it is referenced from.

Welcome to Schema Central, an interactive tool to traverse and search XML schemas. Please choose your XML vocabulary of interest to get started. Don’t see the XML vocabulary you use? Ask us to add it.

Core XML Technologies

Presentation-Oriented Standards

Office/Narrative Document Standards

Web Services Technologies

Security-Related Technologies

Site developed and hosted by Datypic, Inc.

Please report errors or comments about this site to contrib@functx.com

[WayBack]

If I ever need a long term XML/XSD/XSLT/XQuery hire, this is the “about” information I need:

Datypic provides consulting services and training, specializing in XML, content management and SOA/Web Services architecture and development. We are experts in XML-related technologies such as XML Schema, XSLT and XQuery, and have extensive experience with software development and implementation.

We participate in consulting projects ranging from one day to many months, anywhere in the world. We can arrange to work remotely or at your site, whichever you prefer.

For more information, please read about our services or our company, or contact us as pwalmsley@datypic.com.

Recent news from Priscilla Walmsley

  • I recently updated my book XQuery to match the final XQuery 3.1 recommendation. You can read more about it or order it from O’Reilly or Amazon.
  • I recently taught a course at the XML Summer School on Refactoring XSLT. Slides are available as a PDF.
  • More information about my recent books and articles is available on this site.

–jeroen

Posted in Development, Software Development, XML, XML/XSD, XPath, XSD, XSLT | Leave a Comment »

Some links that helped me with XML processing

Posted by jpluimers on 2017/06/29

XML processing never gets easy. So here are some links that helped me:

–jeroen

Posted in Development, Software Development, XML, XML/XSD, XPath | Leave a Comment »

A great way to interactively browse xml/xhtml/html on the console: xmllint –shell

Posted by jpluimers on 2016/10/12

A while ago, I heard about xmllint, a program that can parse and query xml from the command-line.

Later, I discovered it can also parse html, can recover from xml/html errors and has an interactive shell that has a lot of commands (see table below) to navigate through the loaded command.

The relevant command-line options:

--recover
--html
--shell

Note that --recover will output failing input to stderr. You can ignore that using 2> /dev/null

Some good examples of usage are here:

The table of shell commands:

Shell

xmllint offers an interactive shell mode invoked with the –shell command. Available commands in shell mode include:
Command Parameter Description
base display XML base of the node
bye leave shell
cat node Display node if given or current node.
cd path Change the current node to path (if given and unique) or root if no argument given.
dir path Dumps information about the node (namespace, attributes, content).
du path Show the structure of the subtree under path or the current node.
exit Leave the shell.
help Show this help.
free Display memory usage.
load name Load a new document with the given name.
ls path List contents of path (if given) or the current directory.
pwd Display the path to the current node.
quit Leave the shell.
save name Saves the current document to name if given or to the original name.
validate Check the document for error.
write name Write the current node to the given filename.

–jeroen

via xmllint.

Posted in Development, HTML, HTML5, Software Development, Web Development, XML, XML/XSD, XPath | Leave a Comment »

Some on-line XML tools I use often

Posted by jpluimers on 2014/10/16

A big part of the cloud is not about storage, it is about on-line tools that run in your web-browser so you do not have to install them locally.

Quite a bit of my XML work can be done with on-line tools like these:

–jeroen

Posted in " quot, & amp, > gt, < lt, ' apos, CSV, Development, nbsp, Software Development, XML, XML escapes, XML/XSD, XPath, XSD, XSLT | Leave a Comment »

Some on-line XPath testing tools that support namespaces and XPath functions

Posted by jpluimers on 2012/05/24

In the previous post, you saw some XPath to find the ProviderManifestToken attribute in an .edmx file.

Writing XPath queries can be quite consuming, so it is nice of you can test it somewhere on-line.

Out of the on-line XPath testers, these two worked best:

Both of them support namespaces, including these XPath functionslocal-name and namespace-uri.

These failed:

If you have more on-line tools that work: please let me know!

Edit (20120524T0930):

Danny Thorpe tweeted an interesting comment:

@jpluimers If you’re compiling XPath support, make note of whether it’s XPATH 1.0 or 2.0. I think .NET only implements XPATH 1.0

Indeed, .NET only supports XPath 1.0, and worse, .NET 4 introduced a couple of issues with XSLT (see XPath and XSLT 2.0 for .NET? – Stack Overflow).

Luckily there are some goot XPath 2.0 libraries for .NET (see XPath 2.0 Libraries for .Net – Stack Overflow).

–jeroen

via: XPath tools on not-another-blog

Posted in Development, Software Development, XML, XML/XSD, XPath | Leave a Comment »