473,796 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

validating using XSL + java

I am using an XML schema to check (validate) the structure of an XML
document. But since I cannot check everything I need using a schema, I
am thinking of using XSL for more detailed checks (value comparisons
etc.) in a second step.

Validation using an XML schema is pretty straight forward: I simply
define the schema document when parsing the XML to a DOM model in my
Java code. Any validation problems comes out as exceptions (which I know
how to handle).

But how do I generate exceptions when applying XSL to my document? I.e.
how will I be notified that some conditions (that I defined in the XSL
document) are false? I guess what I need to know is how to use XSL as a
validation tool in a Java application.

Any advice, links etc would be much apprechiated.
/ulf
Jul 20 '05 #1
1 2109


Ulf Nordlund wrote:

But how do I generate exceptions when applying XSL to my document? I.e.
how will I be notified that some conditions (that I defined in the XSL
document) are false? I guess what I need to know is how to use XSL as a
validation tool in a Java application.


Schematron is a schema language that allows you to make certain
assertions and then check them using an XSLT 1.0 processor:
<http://xml.ascc.net/resource/schematron/schematron.html >
Not sure that is what you are looking for but check that out yourself.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4273
by: bugbear | last post by:
Subject pretty much says it all. I'd like to parse XML (duh!) using Xerces (because its fast, and reliable, and comprehensive, and supports lots of features). I'd like to conform to standards as much as possible, so I'd like to call Xerces under the JAXP API. I'd like to validate the XML against a DTD, so that errors are flagged up to the user, and I can transcribe
1
1834
by: Kevin Partin | last post by:
I have downloaded the latest Xerces-J files from Apache.org and am trying to use them to validate an xml data file against a schema that I wrote. Can someone please provide me with the java command line that I would need to invoke in order to perform this validation? For the life of me I can't find any documentation on this (or at least it is not readily apparent) on the Apache Xerces WWW site. I have also downloaded and installed the...
1
4282
by: scorpion | last post by:
I have this problem that an xml instance is validated correctly by xml tools, but not with my simple code, by setting the validating flag to true. --------------- Schema ----------------------------- <?xml version="1.0" encoding="UTF-8"?> <xs:schema elementFormDefault="qualified" xml:lang="EN" targetNamespace="http://www.mydomain.com/demo/Test" xmlns:test="http://www.mydomain.com/demo/Test" xmlns:xs="http://www.w3.org/2001/XMLSchema">
1
1863
by: Bernd Oninger | last post by:
Ok, in order to validate a given xml file against a given xsd file I would like to type at the command prompt something like java -classpath .;\blah\bluh\foo.jar myxmlfile.xml Is there such a jar file which helps me to do this? Unfortunately XercesImpl.jar is not suitable It yields: Exception in thread "main" java.lang.NoClassDefFoundError: myxmlfile/xml
2
3959
by: Cigdem | last post by:
Hello, I am trying to parse the XML files that the user selects(XML files are on anoher OS400 system called "wkdis3"). But i am permenantly getting that error: Directory0: \\wkdis3\ROOT\home Canonicalpath-Directory4: \\wkdis3\ROOT\home\bwe\ You selected the file named AAA.XML getXmlAlgorithmDocument(): IOException Not logged in
0
2441
by: Gary Shell | last post by:
I am experiencing some strange behavior between a UserControl's validating event and a treeview control. Initially, I thought it was related to an issue in the Knowledgebase article 810852 (http://support.microsoft.com/kb/810852), but then I realized that the hotfix mentioned was in .Net v1.1, which I am using. I took the sample from that article and recreated the situation I see in my application. (Code included below.) If you run the...
1
649
by: Cesar | last post by:
Hello, I've developed a .NET C# web service; which has one method named, let's say, upload_your_data. This method has one parameter ( string your_data). The value that this parameter will actually have is the content of a XML document. This data will be processed and check for a well-formed xml document and will be validated against a XSD. Before putting my code, let me go on and explain the whole situation. This web method is invoked...
232
13359
by: robert maas, see http://tinyurl.com/uh3t | last post by:
I'm working on examples of programming in several languages, all (except PHP) running under CGI so that I can show both the source files and the actually running of the examples online. The first set of examples, after decoding the HTML FORM contents, merely verifies the text within a field to make sure it is a valid representation of an integer, without any junk thrown in, i.e. it must satisfy the regular expression: ^ *?+ *$ If the...
2
1978
by: hardieca | last post by:
Hi, I'd like to know if anyone knows of any resources detailing the best practices of validating rules in the business tier and providing helpful error messages to users in the UI tier. All the information I have come across seems to revolve around using validation controls on the webpages themselves, which is not always feasible. Regards,
0
1806
by: Lucilue2003 | last post by:
Hello, I need help validating an xml file against an external DTD. The below code allows me to read the xml file and gather specific elements of interest. If the xml looked like this, How would i validate it ? <?xml version='1.0' encoding='utf-8'> <simpsons type='bank' platform='TV' app-version='1.0.0'> <header>
0
9679
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9527
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10453
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.