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

Using XPath in MS Word to select an attribute from a specific node
xml record id with one increment
Filter group by many2many field in tree view Odoo 8?
XML DTD. Empty elements
How can i get arround, that a child produces something, i don't need in his parent neither?
How to iterate through XML file using XQuery to build an XML request?
The Prefix “xsi” For Attribute “xsi:schemaLocation” Associated With An Element Type “store-inventory” Is Not Bound
Visual Studio XML formatting messed up
XML Schema and XML in one file? [duplicate]
How to Import XML table Google Sheets
Generic xslt that transform xml structure in html list
Xpath mislead Expression
Unable to get attribute value using JAXB ( For attribute in Parent class)
How to force unique fields in XML
link image in exported odt file with org mode
How to read header information using StaxEventItemReader in spring batch

Categories

HOME
notepad++
fabricjs
saml-2.0
package
spring-data-redis
echo
settings
trac
nstableheaderview
lanczos
flume
rcloud
endeca
openpyxl
heap
naivebayes
openbugs
comsol
plink
aws-sdk
forgot-password
bourbon
apache2.4
undertow
imagemap
imageresizer
tosca
zxing
flask-sqlalchemy
monit
xunit
jboss6.x
intersystems-cache
soot
recurring-events
python-2.6
git-squash
fstream
clickjacking
xajax
wurfl
metaprogramming
tasm
flask-login
procfile
opennms
jquery-ui-draggable
chai-as-promised
context-switch
trigger.io
py2neo
juice-ui
choice
slackware
async.js
android-wake-lock
nservicebus5
nss
upx
crouton-os
xenomai
pypiserver
microsoft-reporting
doctype
botan
delayed-execution
variadic-templates
showdialog
angular-gettext
genymotion-call
ss7
cuba
live555
buffering
spring-remoting
renderer
websphere-esb
clickbank
openargs
android-usb
unit-of-work
dolby-audio-api
diem
cardreader
apache-abdera
twisted.web
idn
extreme-programming
jquery-blockui
relative
convention
android-holo-everywhere
jqote
drawtobitmap
creole
umra
scrollbars
lxr
data-mapping
technical-debt
pnrp

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