You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Richard Emberson <re...@outerharbor.com> on 2002/08/24 03:08:33 UTC

Validating xml generated by Visual Basic

A fellow engineer has generated a ms wsdl file with schema definitions
using
visual basic. Rather than completely specifying the types in VB,
something called
data sets are used. This produces a xml schema definition with the
following construct

for example:

      <s:import namespace="http://www.w3.org/2001/XMLSchema" />
..........
      <s:element name="KnownCustomers2Response">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1"
name="KnownCustomers2Result">
              <s:complexType>
                <s:sequence>
                  <s:element ref="s:schema" />
                  <s:any />
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>

and an instance document then generated by .net contains an embedded
schema defintion
of the data set.
Thats right, there is xml schema in  the instance document.
Its a "neat" idea, making the schema instance self validating (or at
least contains the
missing schema needed for validation - and the schema appears in the
instance right
where the ref="s:schema" appears in the schema file)
But neither alphaworks schema quality checker nor the xerces parser in
validation
mode will accept either the schema or the instance.

any help would be much appreciated - BTW I am pretty much a Unix/Java
guy so
the MS world is a deep dark hole and I would rather not enter it.

Richard


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


Re: Validating xml generated by Visual Basic

Posted by Elena Litani <el...@ca.ibm.com>.
Richard Emberson wrote:
> Thats right, there is xml schema in  the instance document.
> Its a "neat" idea, making the schema instance self validating (or at
> least contains the
> missing schema needed for validation - and the schema appears in the
> instance right
> where the ref="s:schema" appears in the schema file)
> But neither alphaworks schema quality checker nor the xerces parser in
> validation
> mode will accept either the schema or the instance.

Xerces (and quality checker) implement the XML Schema Recommendation.
The operation you are referring to is a proprietary extension.

Xerces provides a mechanism to pre-parse (and validate) XML Schema
document. You can also set the pre-parsed Grammar objects on the parser
to tell parser to use those grammars to validate a document.
For more information, please read Grammar Cashing FAQ:
http://xml.apache.org/xerces2-j/faq-grammars.htm

Also, there is a property that allows you to specify a set of grammars
"http://apache.org/xml/properties/schema/external-schemaLocation":
http://xml.apache.org/xerces2-j/properties.html

Hope this helps. Let us know if you have any additional questions.
-- 
Elena Litani / IBM Toronto

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org