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

xpath - if else structure
Multi Level XML to Flat XML using XSLT
grouping string with linq to xml
Declaration of Element
Can't grab value-of content:encoded from Wordpress RSS
Upshot.js and LINQ to XML
changing and xml document with powershell and then saving
How can I reuse assert tests in Schematron with XPath 1.0?
Can't Import XML to FileMaker Pro 11
Sending image from flash to XML file
Match open CDATA section in Vim
Namespace Stopping XSLT Working
Adobe Air - FileMode.APPEND
Prevent xslt to transform xml into html
Strongly typed object vs Plain XML as response from rest API service ? Which one is best
scrape data from “td”class within another “td” class

Categories

HOME
windows
httparty
eclipse
microsoftgraph
adal
paraview
codenvy
webdriver
mysql-workbench
jelastic
spring-data-redis
cq5
jax-ws
jtextpane
teechart
rcloud
extjs4.2
gson
emoji
symmetricds
entitymanager
aws-sdk
fileserver
android-7.0-nougat
asp.net-core-webapi
guzzle
event-store
zxing
dapper-extensions
data.stackexchange.com
moses
fragment-backstack
genexus-sd
rpgle
vex
jbutton
wacom
joomla2.5
python-pptx
alphabetical
railstutorial.org
health-monitoring
mongoose-schema
spring-mvc-test
tasm
xmldocument
user-defined-fields
facebook-pixel
posixct
custom-font
azure-cli
subnet
dt
er-diagram
monkey
template-toolkit
py2neo
swingworker
sandcastle
docpad
grails-plugin
webjars
seek
iotivity
nikeplus-api
jboss-tools
redis-cluster
rewrite
morton-number
include-guards
slash
rdflib
dnssec
alloy-ui
ms-access-2000
matlab-deployment
rrule
umlgraph
structuremap3
punycode
codeplex
functional-java
ray
dct
sbcl
mt4j
gd-graph
kogrid
resource-management
onmousemove
boost-msm
paginator
predicatebuilder
listactivity
clrstoredprocedure
dataform
diagrams
load-time
delimited-text
data-mapping
silverlight-oob
perl5.12
localizable.strings
change-management
great-circle

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