cancel
Showing results for 
Search instead for 
Did you mean: 

XML validation-Schematron

Former Member
0 Kudos

Hi All,

I validated a XML document using Schematron validation, but its not throwing any errors if there is any mismatch between source document and validation document.

Source Structure:

OrderStats 1

Order 1...unbounded

id

value

id and value are attributes of Order

Validation Code:

<?xml version='1.0'?>

<schema xmlns="http://www.ascc.net/xml/schematron">

<title>OrderStats Schema</title>

<ns uri="http://applicon.dk/teched/06/tns" prefix="ns0"/>

<pattern name="Root">

<rule context="ns0:OrderStats">

<assert test="Order">No Orders</assert>

</rule>

</pattern>

<pattern name ="Order">

<rule context="Order">

<assert test="@id">No Order id</assert>

<assert test="@val">No Order Value</assert>

</rule>

</pattern>

</schema>

I used XSLT mapping, in that i called this Validation template..but if the source document contains wrong tag names or incorrect value it should throw some error..but i am not getting any error based on validation code..

Can anyone suggest some solution for this type of validation

Regards,

Prakash

Accepted Solutions (0)

Answers (1)

Answers (1)

ttrapp
Active Contributor
0 Kudos

Hi there,

as far as I know there is no integrated Schematron validator neither in XI noch in the Netweaver Application Server.

I'm using an XSLT implementation for schematron: The XSLT programm http://xml.ascc.net/schematron/1.5/skeleton1-5.xsl transforms a schematron schema to an XSLT program, which can validate any XML document according to the schematron schema.

You can read it in my blog: /people/tobias.trapp/blog/2006/08/22/xml-processing-in-abap-part-8--using-xslt-for-validation .

Of course there are Schematron Java APIs, for example http://www2.informatik.hu-berlin.de/~obecker/SchematronAPI/ but I think it is still incomplete.

I'm using a simple XML editor to create schematron schemas. If you have further questions about tools like Stylus Studio I recommend to ask them on a special mailing list.

Cheers

Tobias

Edited by: Tobias Trapp on Feb 20, 2008 9:40 PM