Radu,

 

XMLBeans support XML Schemas so, if we have a way to embed schematron
tags within XSD, so my problem is solved. I think I found it..BTW, 

It's the same solution that I found earlier in this note(schematron tags
into <appinfo> context), see sample XSD below:

 

Marcelo:  Seems that we are good to proceed this way. We only need to
check if this solution will catch up all our scenarios.

 

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
        targetNamespace="http://www.demo.org";
        xmlns="http://www.demo.org"; 
        xmlns:sch="http://www.ascc.net/xml/schematron";
        elementFormDefault="qualified">
    <xsd:annotation>
        <xsd:appinfo>
            <sch:title>Schematron validation</sch:title>
            <sch:ns prefix="d" uri="http://www.demo.org"/>
        </xsd:appinfo>
    </xsd:annotation>
    <xsd:element name="Demo">
        <xsd:annotation>
            <xsd:appinfo>
                <sch:pattern name="Check A greater than B">
                    <sch:rule context="d:Demo">
                        <sch:assert test="d:A > d:B" 
                                    diagnostics="lessThan">
                                A should be greater than B.
                        </sch:assert>
                    </sch:rule>
                </sch:pattern>
                <sch:diagnostics>
                    <sch:diagnostic id="lessThan">
                        Error! A is less than B 
                        A = <sch:value-of select="d:A"/>
                        B = <sch:value-of select="d:B"/>
                    </sch:diagnostic>
                </sch:diagnostics>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="A" type="xsd:integer"/>
                <xsd:element name="B" type="xsd:integer"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

 

Reference: http://www.xfront.com/ExtendingSchemas.html

 

 

Atenciosamente

Rafael T. Icibaci
IBM Middleware EAI Team
* + 55 11 2113-7685
* + 55 11 9299-7840
* [EMAIL PROTECTED] 

  _____  

From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] 
Sent: segunda-feira, 9 de abril de 2007 18:22
To: user@xmlbeans.apache.org; Webber, David (NIH/OD) [C]
Cc: Marcelo Martins Pereira
Subject: RE: XMLBeans and SchemaTron

 

First time I hear abour JCam, so no.

 

What I suggest you do is the following:

 

If you can find a Schematron validator somewhere that can act as a
"filter" for a SAX or StAX stream or that works over DOM, you can plug
that in as a separate step and still use XMLBeans and Schema validation.
XMLBeans supports all three of these standard APIs so maybe you can get
around it this way.

 

The thing about it is that implementing a validation engine is a lot of
work, so we had to limit ourselves to 1 and that had to be pretty much
XMLSchema. Now, if someone who knows Schematron would be willing to
contribute something in XmlBeans in that area it would be a welcome
addition, but without a volunteer, it's unlikely to happen, I would say.

 

Anyway, if you do find such a "filter" validator, please do post back
and let us know.

 

Radu

 

  _____  

From: Rafael Tatsuya Icibaci [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 09, 2007 12:08 PM
To: Webber, David (NIH/OD) [C]; user@xmlbeans.apache.org
Cc: Marcelo Martins Pereira
Subject: RE: XMLBeans and SchemaTron

Yes, I need content validation. What we exactly want to do is: We have a
requirement to use XMLBeans, also today we have a need to include
conditional expressions in XSD files (e.g.: if we have a tag so we need
to have the other as well). Schematron appears to be the solution,
because we can set these conditions using XPath, but now the question
is: If we are going to use XMLBeans and we will pass a XSD file to
XMLbeans to validate, XMLBeans support SchemTron ? I can pass a .SCH
file to XMLBeans ? or I have a way to include SchemTron tags into .XSD
files ?? I found a sample of using SchemTron tags into .XSD(see below),
but appears that this is only valid when schematron tags are inside of
<xs:annotation> tag.

 

I'm checking out JCam, seems that it's very similar to SchemaTron.
XMLBeans support JCam ??

 

 

<?xml version="1.0" encoding="UTF-8"?> 

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

    xmlns:xs="http://www.w3.org/2001/XMLSchema"; 

    targetNamespace="http://www.rafael.com";
elementFormDefault="qualified" 

    attributeFormDefault="unqualified"> 

    <xs:annotation> 

        <xs:appinfo> 

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

                <title>Meds</title> 

                <ns uri="http://www.rafael.com"; prefix="ns"/> 

                <pattern name="Medications"> 

                    <rule context="ns:E18"> 

                        <assert test="preceding::E18_02"> 

                            If <name/> is used you must list the
Medications listed 

                        </assert> 

                        <assert test="preceding::E18_07"> 

                            If <name/> is used you must list the patient
response 

                        </assert> 

                    </rule> 

                    <rule context="ns:Header"> 

                        <report test="count(ns:Record) > 0"> 

                            There are <value-of select =
"count(ns:Header\Record)"/> <name/> 

                        </report> 

                    </rule> 

                </pattern> 

            </schema> 

        </xs:appinfo> 

    </xs:annotation>

 

Atenciosamente

Rafael T. Icibaci
IBM Middleware EAI Team
* + 55 11 2113-7685
* + 55 11 9299-7840
* [EMAIL PROTECTED] 

  _____  

From: Webber, David (NIH/OD) [C] [mailto:[EMAIL PROTECTED] 
Sent: sexta-feira, 6 de abril de 2007 13:02
To: user@xmlbeans.apache.org
Cc: Rafael Tatsuya Icibaci
Subject: RE: XMLBeans and SchemaTron

 

Rafael,

 

If you need content validation services - check out the latest OASIS CAM
tool

 

 http://www.jcam.org.uk/ 

 

DW

 

  _____  

From: Rafael Tatsuya Icibaci
Sent: Thu 4/5/2007 2:57 PM
To: user@xmlbeans.apache.org
Subject: XMLBeans and SchemaTron

Hi all,

 

Anyone knows if XMLBeans support SchemaTron ? 

Atenciosamente

Rafael T. Icibaci
IBM Middleware EAI Team
* + 55 11 2113-7685
* + 55 11 9299-7840
* [EMAIL PROTECTED] 

 


Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

Reply via email to