473,395 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Schema building help

All -

I am very stuck on building a schema for the following xml message. I
feel I'm very close as the message validates if I remove the
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
attribute from the doSpellingSuggestion element. Any help/pointers for
describing the encodingStyle attribute in my schema would be great.

Any help on this would be great.

Thanks.

-------------- Message -------------------

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>

<ns1:doSpellingSuggestion
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:GoogleSearch">
<key xsi:type="xsd:string">QLgFC0VQFHJNq8RfD6sDbGCQD671 0PlS</key>
<phrase xsi:type="xsd:string">rabbbit</phrase>
</ns1:doSpellingSuggestion>

</soapenv:Body>
</soapenv:Envelope>

------------ Schema ---------------

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
targetNamespace="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:GoogleSearch"
version="1.0">

<xs:import namespace="urn:GoogleSearch"
schemaLocation="GoogledoSpellingSuggestion.xsd" />

<xs:element name="Envelope">
<xs:complexType>
<xs:sequence>
<xs:element name="Body">
<xs:complexType>
<xs:sequence>
<xs:element ref="ns1:doSpellingSuggestion"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

</xs:schema>

---------------

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/encoding/"
targetNamespace="urn:GoogleSearch"
xmlns:ns1="urn:GoogleSearch"
version="1.0">

<xsd:element name="doSpellingSuggestion"
type="ns1:doSpellingSuggestion"/>

<xsd:complexType name="doSpellingSuggestion">
<xsd:sequence>
<xsd:element name="key" type="xsd:string"/>
<xsd:element name="phrase" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>

</xsd:schema>

Jul 20 '05 #1
3 2596


jo******@gmail.com wrote:

I am very stuck on building a schema for the following xml message. I
feel I'm very close as the message validates if I remove the
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
attribute from the doSpellingSuggestion element. Any help/pointers for
describing the encodingStyle attribute in my schema would be great.


Why do you need to write your own schema for that, a schema already
exists, you could just import it e.g.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
targetNamespace="urn:GoogleSearch"
xmlns:ns1="urn:GoogleSearch"
version="1.0">

<xsd:import namespace="http://schemas.xmlsoap.org/soap/envelope/"
schemaLocation="http://schemas.xmlsoap.org/soap/envelope/" />

<xsd:element name="doSpellingSuggestion"
type="ns1:doSpellingSuggestion"/>

<xsd:complexType name="doSpellingSuggestion">
<xsd:sequence>
<xsd:element name="key" type="xsd:string"/>
<xsd:element name="phrase" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute ref="soapenv:encodingStyle" />
</xsd:complexType>

</xsd:schema>
If you really think you need to implement it yourself then look at the
schema at
<http://schemas.xmlsoap.org/soap/envelope/>
how that works. It has a global declaration for the attribute and its type.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2
Thanks for the reply

The message fails to to compile with using xmllint using the above
schema

]# xmllint --schema GoogleSoapEnvelope.xsd GoogleMessage.xml
GoogledoSpellingSuggestion.xsd:18: element attribute: Schemas parser
error : Attribute ref. 'soapenv:encodingStyle', attribute 'ref': The
QName value {'http://schemas.xmlsoap.org/soap/envelope/',
'encodingStyle'} does not resolve to a(n) attribute declaration.
WXS schema GoogleSoapEnvelope.xsd failed to compile
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>

<ns1:doSpellingSuggestion xmlns:ns1="urn:GoogleSearch"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

<key xsi:type="xsd:string">QLgFC0VQFHJNq8RfD6sDbGCQD671 0PlS</key>
<phrase xsi:type="xsd:string">rabbbit</phrase>

</ns1:doSpellingSuggestion>

</soapenv:Body>
</soapenv:Envelope>
]#

Jul 20 '05 #3


jo******@gmail.com wrote:

The message fails to to compile with using xmllint using the above
schema

]# xmllint --schema GoogleSoapEnvelope.xsd GoogleMessage.xml
GoogledoSpellingSuggestion.xsd:18: element attribute: Schemas parser
error : Attribute ref. 'soapenv:encodingStyle', attribute 'ref': The
QName value {'http://schemas.xmlsoap.org/soap/envelope/',
'encodingStyle'} does not resolve to a(n) attribute declaration.


I do not use xmllint and I am not familiar with its schema processor.
The message suggests that it does not find the referenced attribute
declaration so either an import is missing or you need to provide the
imported schemas on the command line too to have the processor find it.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Cy Huckaba | last post by:
I have been looking around for a sample on how to read an XSD schema and iterate through the elements to display them. I am working in VB.Net and I have looked at all of the docs on msdn and can...
7
by: Robert Stearns | last post by:
I ran the following bit of SQL and my PRIMARY KEY wound up in schema SYSIBM called SQL.... not schema is3 called primary. The index registation did wind up there. Obviously there's something I...
5
by: dave71 | last post by:
Hi Could someone please advise me how to remove the schema name from linked tables within Access. For example when I connect to a Oracle database via Microsoft ODCB for Oracle the list of...
6
by: Emma Middlebrook | last post by:
Hi there, I have created an XmlSchema to represent the tables in my database and I have specified a primary key for each of the tables. However, to be able to execute the following code: ...
3
by: h4xPace | last post by:
I am building a MySQL query application, and I have run into a small snag. MySQL has released a set of classes that extend the .NET framework base data classes (command, connection, etc), and I am...
8
by: send.me.all.email | last post by:
Hi experts, which approaches would you suggest for: - Reading a database schema (tables, fields, relationships) from SQL Server 2005? - Visualizing the DB schema? For developing a DB tool...
0
by: The Magpie | last post by:
Slightly odd question, but I'm building a Schema library for use in Open Source software and want to test each element of the library. Obviously, hand-testing is easy enough but I would like...
3
by: Gladiator | last post by:
Any Suggestions on the below scenario will be helpful to us. # There are 10 tables in a schema “S1” and I have to give select privilege (Only read access) to a user on all the tables in the...
3
by: nitinpatel1117 | last post by:
Hi, I've got a slight issue which i'm trying to resolve and was wondering if anyone would help. Basically, I was building a web application, and while it was being built I was connecting to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.