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

      15 Proven Benefits of Outsourcing Node.js Development for Large Organizations

      July 9, 2025

      10 Reasons to Choose Full-Stack Techies for Your Next React.js Development Project

      July 9, 2025

      Anthropic proposes transparency framework for frontier AI development

      July 8, 2025

      Sonatype Open Source Malware Index, Gemini API Batch Mode, and more – Daily News Digest

      July 8, 2025

      Microsoft sees its carbon emissions soar on a 168% glut in AI energy demand, “we recognize that we must also bring more carbon-free electricity onto the grids.”

      July 9, 2025

      You can get a Snapdragon X-powered laptop for under $500 right now — a low I didn’t think we’d see this Prime Day week

      July 9, 2025

      Sam Altman admits current computers were designed for an AI-free world — but OpenAI’s new type of computer will make the AI revolution “transcendentally good”

      July 9, 2025

      It doesn’t matter how many laptops I review or how great the deals are — this is the one I keep coming back to over and over again

      July 9, 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

      Leading Experts in Meme Coin Development – Beleaf Technologies

      July 9, 2025
      Recent

      Leading Experts in Meme Coin Development – Beleaf Technologies

      July 9, 2025

      Redefining Quality Engineering – Tricentis India Partner Event

      July 9, 2025

      Enhancing JSON Responses with Laravel Model Appends

      July 9, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Microsoft sees its carbon emissions soar on a 168% glut in AI energy demand, “we recognize that we must also bring more carbon-free electricity onto the grids.”

      July 9, 2025
      Recent

      Microsoft sees its carbon emissions soar on a 168% glut in AI energy demand, “we recognize that we must also bring more carbon-free electricity onto the grids.”

      July 9, 2025

      You can get a Snapdragon X-powered laptop for under $500 right now — a low I didn’t think we’d see this Prime Day week

      July 9, 2025

      Sam Altman admits current computers were designed for an AI-free world — but OpenAI’s new type of computer will make the AI revolution “transcendentally good”

      July 9, 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

    Microsoft sees its carbon emissions soar on a 168% glut in AI energy demand, “we recognize that we must also bring more carbon-free electricity onto the grids.”

    July 9, 2025
    News & Updates

    You can get a Snapdragon X-powered laptop for under $500 right now — a low I didn’t think we’d see this Prime Day week

    July 9, 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

    LACT configures and monitors AMD, NVIDIA and Intel GPUs

    Linux

    CVE-2025-1793 – AWS Run-llama SQL Injection Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Pins creates and edits app shortcuts

    Linux

    This AI Paper Introduces PARSCALE (Parallel Scaling): A Parallel Computation Method for Efficient and Scalable Language Model Deployment

    Machine Learning

    Highlights

    CVE-2025-23178 – Apache HTTP Server SSL/TLS Channel Hijacking Vulnerability

    April 29, 2025

    CVE ID : CVE-2025-23178

    Published : April 29, 2025, 4:15 p.m. | 31 minutes ago

    Description : CWE-923: Improper Restriction of Communication Channel to Intended Endpoints

    Severity: 7.6 | HIGH

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    CVE-2025-3673 – Apache HTTP Server Remote Code Execution Vulnerability

    April 23, 2025

    Borderlands 4 Delays Photo Mode Until After Launch – Here’s Why

    July 8, 2025

    CVE-2025-53076 – Samsung Open Source rLottie Overread Buffer Vulnerability

    June 30, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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