XML::V...:MSXML(3pm)

πŸ“¦
version 1.025 Β· 2 versions
  • 1.025 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.025 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

XML::Validate::MSXML β€” it's the interface to MSXML's validator, bestie. Yes, that's the whole name. Yes, it's a 3pm perl manpage from the User Contributed Perl Documentation. We love a humble queen.


✨ SYNOPSIS ✨

okay so here's the whole moment in four lines:

my $validator = new XML::Validate::MSXML(%options);
if ($doc = $validator->validate($xml)) {
  ... Do stuff with $doc ...
} else {
  print "Document is invalid\n";
}

you make a validator, you feed it $xml, and either you get your doc back (slay) or you get told it's invalid (😭). that's it.


🌸 DESCRIPTION 🌸

XML::Validate::MSXML is an interface to Microsoft's MSXML parser β€” the one that's often available in Windows environments πŸͺŸβœ¨ β€” and you can use it with the XML::Validate module. it's giving "windows-only bestie" and honestly? iconic for that.


πŸŽ€ METHODS πŸŽ€

  • new(%options) β€” Returns a new XML::Validate::MSXML instance using the specified options. (See OPTIONS below, because the options live down there, not here πŸ’…)
  • validate($xml) β€” Returns true if $xml could be successfully parsed, undef otherwise. that's the main character method fr fr.
  • last_dom() β€” Returns the MSXML DOM object of the document last validated. it's holding onto the receipts for you 🧾
  • last_error() β€” Returns the error from the last validate call. This is a hash ref with the following fields:
  • create_doc_and_cache() β€” Internal method for instantiation of MSXML DOMDocument and SchemaCache objects for use within the module. internal business, not for you, but we still list it because we keep every detail πŸ’–
  • dependencies_available() β€” Internal method to determine that the necessary dependencies are available for instantiation of MSXML DOMDocument and SchemaCache objects. also internal! also still listed! no cap.
  • load_schemas($msxml, $msxmlcache) β€” Internal method to perform loading of XML schema(s) into SchemaCache object.

and the fields of that last_error hash ref, which the original page drops right here so we're dropping them right here too (iykyk):

  • message
  • line
  • column

Note that the error gets cleared at the beginning of each validate call. so peek at it before you validate again, or it's gone, poof, bye πŸ¦‹

  • version() β€” Returns the version of the MSXML component that is installed. good to know, love to know πŸ’œ

πŸ’… OPTIONS πŸ’…

XML::Validate::MSXML takes the following options:

  • strict_validation β€” If this boolean value is true, the document will be validated during parsing. Otherwise it will only be checked for well-formedness. Defaults to true. so like… it's strict by default. it's a strict queen πŸ‘‘ only set it false if you just wanna know if it's well-formed and nothing more.

πŸ”₯ ERROR REPORTING πŸ”₯

When a call to validate fails to parse the document, the error may be retrieved using last_error. that's your lil detective moment πŸ”

On errors not related to the XML parsing, these methods will throw exceptions. Wrap calls with eval to catch them. this is the part where you go "not me forgetting the eval again" 😭

seriously, wrap it in eval. the exceptions are not shy, they will absolutely come for you.

🌈 PACKAGE GLOBALS 🌈

$XML::Validate::MSXML::MSXML_VERSION contains the version number of MSXML. one whole global, living its best life ⭐


🧚 DEPENDENCIES 🧚

  • Win32::OLE
  • MSXML 4.0 or 5.0

that's the list. that's the whole list. if you're not on Windows with the right MSXML, this module is not for you, and that's okay 🫢


⭐ VERSION ⭐

$Revision: 1.18 $ on $Date: 2006/04/18 10:00:31 $ by $Author: mattheww $


πŸ’œ AUTHOR πŸ’œ

Nathan Carr, Colin Robertson

<cpan _at_ bbc _dot_ co _dot_ uk>


(c) BBC 2005. This program is free software; you can redistribute it and/or modify it under the GNU GPL. See the file COPYING in this distribution, or http://www.gnu.org/licenses/gpl.txt


and that's the whole page, bestie!! this lil legend was built on perl v5.34.0 and last touched way back on 2022-06-28 β€” XML::Validate::MSXML(3pm), forever iconic, mwah πŸ’–πŸŽ€πŸ¦‹