xml


validate an XML based on an XSD and throw all errors at once in perl


I am trying to validate an XML based on a XSD. Below is the part of the code where i am validating the xml against xsd:
my $schema = XML::LibXML::Schema->new(location => $xsd);
my $parser = XML::LibXML->new;
my $doc = $parser->parse_file($xml);
eval { $schema->validate( $doc ) };
if ( my $ex = $# ) {
return $ex;
}
The code works fine but if the xml is not validated it gives me an error once i fix the issue in the xml and rerun the code i get different set of errors i just want to know if there is any way i can print all the validation errors at once?
I have even tried the solution given by #Paulo SantAnna in the below link:
Perl XML::LibXML::Schema will stop validation on first error
but even this didn't work.

Related Links

Spring data storage: xml and database
Count number of Children
XSL Transformation: Count Elements
OpenERP 7 tree view doesn't show search box and other filters
Scalatest maven plugin: ERROR: -c has been deprecated for a very long time and is no longer supported
Generate an XML file in Delphi 10.1 and Perform basic Operations?
Moving search to top menu
Malformed config.xml in Phonegap
Solr index xml file with html tag (with DataImportHandler)
Collections in XML, the right structure
XSLT - add a namespace declaration to some children
Each element of a collection must go between their corresponding <element></element> in XSD?
Not able to copy values from two tags to another in XML using XSL
How to convert to PDF from XSL-FO with MathML
How can I set Spring property from the XML configuration file?
What input format is reuired for Ellucian DegreeWorks to create profile/user account? If any specific API level input to be sent over?

Categories

HOME
windows
twig
battery
graphics
sublimetext
spring-data-mongodb
telegram-bot
square
polling
webix
bing-maps
watson-conversation
startup
emoji
jsonpath
pybossa
firefox-addon
chargify
nim
user-experience
poedit
dataflow-diagram
roslyn
visual-studio-extensions
flask-sqlalchemy
twiml
constexpr
dotspatial
r-grid
memory-address
android-gridview
android-maps-extensions
joomla2.5
arduino-ide
protege4
sharepoint-workflow
hivemq
docfx
protein-database
apns-php
css-position
typesafe-config
c9.io
watchface
vmware-fusion
postgresql-8.4
dbnull
angular-http
vaadin-charts
jboss-4.2.x
remedy
java-bytecode-asm
oracleclient
android-testing
payload
template-toolkit
cubism.js
qtplugin
myspace
resourcemanager
mapinfo
cifilter
gogs
jbase
roadkill-wiki
microsoft-reporting
rpart
keyup
google-refine
nutiteq
teamcity-9.1
qtwebengine
dbaccess
webmatrix-3
structuremap3
sql-scripts
jama
insight.database
radiant
git-repo
oocss
gpars
server-administration
android-sdk-2.3
dopostback
android-loadermanager
frameworkelementfactory
web-farm
rmiregistry
jqote
clrstoredprocedure
hbm2java
wcf-instancing
alsb
mathematical-typesetting
cardspace

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App