[erlang-questions] xmerl scan file and validate using schema
Frans Schneider
fchschneider@REDACTED
Tue Jan 23 11:39:52 CET 2018
Dear list,
I would like to use validation while reading XML files using
xmerl_scan:file/2 or even better, using xmerl_xsd:validate/2 with a
previously processed schema. In both cases, I get the error
{fetch_fun_failed,{http,"http://www.w3.org/2001/xml.xsd"}}. However, the
documentation gives no details on what the fetch function should look
like and looking through the sources did not help much. I also made a
local copy of the imported xml.xsd file and tried several options
without luck.
My question is if somebody knows about an easy way to get this working?
The xsd's head is listed below.
NB: I know about Erlsom, which does work well but lacks line numbers in
the output which I need for reporting errors in the XML file.
Thanks,
Frans
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright OASIS Open 2010. All Rights Reserved. -->
<xs:schema xmlns:xacml="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
More information about the erlang-questions
mailing list