Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      A Week In The Life Of An AI-Augmented Designer

      August 22, 2025

      This week in AI updates: Gemini Code Assist Agent Mode, GitHub’s Agents panel, and more (August 22, 2025)

      August 22, 2025

      Microsoft adds Copilot-powered debugging features for .NET in Visual Studio

      August 21, 2025

      Blackstone portfolio company R Systems Acquires Novigo Solutions, Strengthening its Product Engineering and Full-Stack Agentic-AI Capabilities

      August 21, 2025

      The best AirTag alternative for Samsung users is currently 30% off

      August 24, 2025

      One of the biggest new features on the Google Pixel 10 is also one of the most overlooked

      August 24, 2025

      I tested these viral ‘crush-proof’ Bluetooth speakers, and they’re not your average portables

      August 24, 2025

      I compared the best smartwatches from Google and Apple – and there’s a clear winner

      August 24, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      MongoDB Data Types

      August 23, 2025
      Recent

      MongoDB Data Types

      August 23, 2025

      Building Cross-Platform Alerts with Laravel’s Notification Framework

      August 23, 2025

      Add Notes Functionality to Eloquent Models With the Notable Package

      August 23, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Microsoft Teams updated with a feature you probably thought already existed — “Can you hear me?” is now a thing of the past

      August 24, 2025
      Recent

      Microsoft Teams updated with a feature you probably thought already existed — “Can you hear me?” is now a thing of the past

      August 24, 2025

      Xbox Game Pass gets Gears of War: Reloaded, Dragon Age: The Veilguard, and more — here’s what is coming through the rest of August

      August 24, 2025

      Resident Evil ‘9’ Requiem has some of the most incredible lighting I’ve seen in a game — and Capcom uses it as a weapon

      August 24, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: The XML Dating Service

    CodeSOD: The XML Dating Service

    July 9, 2025

    One of the endless struggles in writing reusable API endpoints is creating useful schemas to describe them. Each new serialization format comes up with new ways to express your constraints, each with their own quirks and footguns and absolute trainwrecks.

    Maarten has the “pleasure” of consuming an XML-based API, provided by a third party. It comes with an XML schema, for validation. Now, the XML Schema Language has a large number of validators built in. For example, if you want to restrict a field to being a date, you can mark it’s type as xsd:date. This will enforce a YYYY-MM-DD format on the data.

    If you want to ruin that validation, you can do what the vendor did:

    <xsd:simpleType name="DatumType">
      <xsd:annotation>
        <xsd:documentation>YYYY-MM-DD</xsd:documentation>
      </xsd:annotation>
      <xsd:restriction base="xsd:date">
        <xsd:pattern value="(1|2)[0-9]{3}-(0|1)[0-9]-[0-3][0-9]" />
      </xsd:restriction>
    </xsd:simpleType>
    

    You can see the xsd:pattern element, which applies a regular expression to validation. And this regex will “validate” dates, excluding things which are definitely not dates, and allowing very valid dates, like February 31st, November 39th, and the 5th of Bureaucracy (the 18th month of the year), as 2025-02-31, 2025-11-39 and 2025-18-05 are all valid strings according to the regex.

    Now, an astute reader will note that this is a xsd:restriction on a date; this means that it’s applied in addition to ensuring the value is a valid date. So this idiocy is harmless. If you removed the xsd:pattern element, the behavior would remain unchanged.

    That leads us to a series of possible conclusions: either they don’t understand how XML schema restrictions work, or they don’t understand how dates work. As to which one applies, well, I’d say 1/3 chance they don’t understand XML, 1/3 chance they don’t understand dates, and a 1/3 chance they don’t understand both.

    [Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleBlizzard announces release date for World of Warcraft: The War Within’s 3rd major content patch — a patch that will feature the largest, city-sized raid boss in MMORPG history
    Next Article Free Ad Text Generator

    Related Posts

    News & Updates

    The best AirTag alternative for Samsung users is currently 30% off

    August 24, 2025
    News & Updates

    One of the biggest new features on the Google Pixel 10 is also one of the most overlooked

    August 24, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    CVE-2025-5829 – Autel MaxiCharger AC Wallbox Commercial JSON Stack-based Buffer Overflow Remote Code Execution

    Common Vulnerabilities and Exposures (CVEs)

    How to Protect Your Remote Workforce from Cyber Attacks

    Development

    CVE-2025-5997 – Beamsec PhishPro Privileged API Abuse

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-46224 – Dropbox Authentication Bypass

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    Linux

    Sono Spazzatura: Questo il Giudizio di Linus Torvalds sulle Patch di RISC-V per il Kernel Linux 6.17

    August 14, 2025

    L’architettura RISC-V (Reduced Instruction Set Computer – Version V) rappresenta una delle innovazioni più promettenti…

    iRasptek Raspberry Pi 5 8GB Starter Kit Review

    May 28, 2025

    Reducing Barriers to Entry: The Power of AI as a Service

    July 30, 2025

    CVE-2025-4533 – JeecgBoot Document Library Upload Remote Resource Consumption Vulnerability

    May 11, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.