[Schematron] Schamatron validation using java
Luis Costa
luis.costa at alert.pt
Tue Jan 6 11:01:09 EST 2009
Thank you all,
I discover what my error was,
The problem wasn't in the style sheet but in the output in java code,
My idea is to this output style sheet be in XML and not in text (the way it is right now)
When in the workflow can I define the output?
a) in Schematron scheme?
b) modifying the style sheet created by saxon putting the elements in place of text output message?
Thank you for your attention and best regards,
Luís Costa
Software Developer
luis.costa at alert.pt
www.alert-online.pt
ALERT Life Sciences Computing, S.A.
Edifício Lake Towers - pisos 7, 8 e 9
Rua Daciano Baptista Marques, n.º 245
4400-617 Vila Nova de Gaia
Portugal
Tel.: +351 22 832 89 80
Fax.: +351 22 832 89 82
info at alert.pt
This e-mail is privileged, confidential and contains private information. Any reading, retention, distribution or copying of this communication by any person other than its intended recipient is prohibited.
-----Original Message-----
From: Albertson, Jacob [USA] [mailto:albertson_jacob at bah.com]
Sent: terça-feira, 6 de Janeiro de 2009 15:23
To: Luis Costa; Dave Pawson; schematron at eccnet.com
Subject: RE: [Schematron] Schamatron validation using java
Hi Luis,
I am not sure if your Schematron is invalid or if you processing is code is wrong. I have attached a small java program I wrote a while ago to do Schematron validation. It should have all the style sheets and Saxon processors you need. Hope this helps.
Jacob
-----Original Message-----
From: schematron-bounces at eccnet.com [mailto:schematron-bounces at eccnet.com] On Behalf Of Luis Costa
Sent: Tuesday, January 06, 2009 9:52 AM
To: Dave Pawson; schematron at eccnet.com
Subject: Re: [Schematron] Schamatron validation using java
Hi all,
So far I understand, to validate a Document.XML with a shematron scheme "scheme.sch" in a java method I can't perform like a schema validation (schema.xsd) so I need to:
1. Transform my schematron "chema.sch" in a style sheet, to perform this I use saxon 9.105 for instance "java -jar saxon9.jar -o schema-compiled.xsl schema.sch iso_schematron_skeleton.xsl "
2. Then in my java method I've to submit the xml document to this "schema-compiled.xsl" style sheet.
y. But I'm having some problems with this style sheet that was creates by saxon, when I submit the XML document that I'm trying to validate I getting the following error:
"schema-compiled.xsl; Line #213; Column #28; org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted."
Question:
a) Am I following the right workflow to do this kind of validation?
b) is there a way to validate a XML with the schematron (sch) the same way has validating XML with an schema (.xsd) (when an error occurs throws an exception)?
c) Is y. a known problem with saxon style sheet generated?
Thank you for your attention and best regards,
Luís Costa
Software Developer
luis.costa at alert.pt
www.alert-online.pt
ALERT Life Sciences Computing, S.A.
Edifício Lake Towers - pisos 7, 8 e 9
Rua Daciano Baptista Marques, n.º 245
4400-617 Vila Nova de Gaia
Portugal
Tel.: +351 22 832 89 80
Fax.: +351 22 832 89 82
info at alert.pt
This e-mail is privileged, confidential and contains private information. Any reading, retention, distribution or copying of this communication by any person other than its intended recipient is prohibited.
-----Original Message-----
From: schematron-bounces at eccnet.com [mailto:schematron-bounces at eccnet.com] On Behalf Of Dave Pawson
Sent: terça-feira, 6 de Janeiro de 2009 10:43
To: schematron at eccnet.com
Subject: Re: [Schematron] Schamatron validation using java
2009/1/5 Kendall Shaw <kshaw at kendallshaw.com>:
> "Luis Costa" <luis.costa at alert.pt> writes:
>
>> Hi all,
>>
>> Does anyone know how can schematron (.sch file) be used to validate a XML in java code.
>
> If you are asking how to invoke schematron from java,
But if you are asking if Schematron can be used to unpick XML from java code..
then no, I don't think so.
regards
--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk
_______________________________________________
Schematron mailing list
Schematron at eccnet.com
http://www.eccnet.com/mailman/listinfo/schematron
_______________________________________________
Schematron mailing list
Schematron at eccnet.com
http://www.eccnet.com/mailman/listinfo/schematron
More information about the Schematron
mailing list