[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Validating against schema a file with another schema in it.

  • To: <xml-dev@l...>
  • Subject: Validating against schema a file with another schema in it.
  • From: "Yuriy" <yuriy@m...>
  • Date: Fri, 15 Feb 2002 15:04:29 +0100

validate wsdl
Hallo.
Could You help me please!
I have a problem I can't solve for a 2 monthes. I investigated archive, but no help found.
The problem is:
I want to validate XML file (namely WSDL file) with Xerces 1.4.3. WSDL file contains part of schema  in it.
And I could not validate it.
I set up all the feautres of parser to enable validation against schema. (I tried different combinations).
I downloaded all files concerning XML schema: datatypes.dtd, xml.xsd, XMLSchema.dtd, XMLSchema.xsd
I changed accordingly every xsi:schemaLocation.
When there is no elements from namespace "http://www.w3.org/2001/XMLSchema", and no location for this namespace is specified, document is valid.
But if I add ones - I have from Xerces J 1.4.3 (if some schemaLocation (local file) for namespace "http://www.w3.org/2001/XMLSchema" is specified )
 
"[Error] sample.wsdl:10:51: Schema error: The namespce name for 'schema' must be http://www.w3.org/2001/XMLSchema.
...................."
 
And I have (if no schemaLocation for namespace "http://www.w3.org/2001/XMLSchema" is specified )
 
"[Error] sample.wsdl:14:59: General Schema Error: Grammar with uri: http://www.w3.org/2001/XMLSchema , can not be found; schema namespace may be wrong:  Xerces supports schemas from the "http://www.w3.org/2001/XMLSchema" namespace or the instance document's namespace may not match the targetNamespace of the schema.
...................."
 
I'm definitly using XMLSchema.xsd for "http://www.w3.org/2001/XMLSchema".
Here is sample.wsdl
 
<?xml version="1.0"?>
<definitions name="StockQuote"
 
targetNamespace="http://example.com/stockquote.wsdl"
          xmlns:tns="http://example.com/stockquote.wsdl"
          xmlns:xsd1="http://example.com/stockquote.xsd"
          xmlns="http://schemas.xmlsoap.org/wsdl/"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://schemas.xmlsoap.org/wsdl/ wsdl.xsd
 http://www.w3.org/2001/XMLSchema XMLSchema.xsd ">
 
    <types>
       <xs:schema targetNamespace="http://example.com/stockquote.xsd"
              xmlns:xs="http://www.w3.org/2001/XMLSchema">
           <xs:element name="TradePriceRequest">
              <xs:complexType>
                  <xs:all>
                      <xs:element name="tickerSymbol" type="string"/>
                  </xs:all>
              </xs:complexType>
           </xs:element>
           <xs:element name="TradePrice">
              <xs:complexType>
                  <xs:all>
                      <xs:element name="price" type="float"/>
                  </xs:all>
              </xs:complexType>
           </xs:element>
       </xs:schema>
    </types>
 
    <message name="GetLastTradePriceInput">
        <part name="body" element="xsd1:TradePriceRequest"/>
    </message>
 
    <message name="GetLastTradePriceOutput">
        <part name="body" element="xsd1:TradePrice"/>
    </message>
 
    <portType name="StockQuotePortType">
        <operation name="GetLastTradePrice">
           <input message="tns:GetLastTradePriceInput"/>
           <output message="tns:GetLastTradePriceOutput"/>
        </operation>
    </portType>
 
</definitions>
Am I wrong? Or is Xerces wrong?
May be someone know success story how to validate WSDL with another parser, or another version of Xerces, then tell me please it also.
Thanks a lot.
Yuriy.

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.