473,395 Members | 1,335 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.

Strange (to me) import statements



I've been asked to look over an integration toolkit that has a bunch
of schemas to specify message format. There are a couple of strange
things I noticed right off the bat and I wanted to get others'
thoughts on it (disclaimer, obviously I'm no XML expert so forgive
me if these are basic).

--------Exhibit A: The start of a response message-----------------
<xsd:schema targetNamespace="http://www.QQQ.com"
xmlns:QQQ="http://www.QQQ.com/datatypes"
xmlns="http://www.QQQ.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified">

<xsd:import namespace="http://www.QQQ.com/datatypes"
schemaLocation="../general/datatypes.xsd"/>

<xsd:import namespace="http://www.QQQ.com"
schemaLocation="../general/datatypes.xsd"/>
--------Exhibit B: The start of general/datatypes.xsd --------------

<xsd:schema targetNamespace="http://www.QQQ.com/datatypes"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.QQQ.com/datatypes"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">

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

#1) Exhibit A seems to be following poor form by using such a generic
targetNamespace (the same one is used for all their top-level schema).
The convention I've seen is that the targetNamespace should be the
public URL of the document.

#2) Exhibit A defines both the default and QQQ namespace to point to
the same schema (namely, Exhibit B). I guess I don't have a problem
with it technically (sans #3) but it does seem bizarre. Seems like a
really bad idea in fact. Would you do this so you could normally refer
to a name X without qualification unless there were some ambiguity with
an X in the current document (and so you could refer to it as QQQ:X)?

#3) The namespace used in the 2nd import of Exhibit A does not match
the targetNamespace of Exhibit B. Why would someone do this?

#4) Please confirm/dispute my interpretation of the elementForDefault and
the attributeFormDefault: all these say is that I do not have to qualify
elements in the document but they are still implicitly part of the
default namespace for that document (and hence would be subject to the
appropriate validations).

If this is all just bad form, so be it (and I may have a chance to
get it fixed) but if there are plausible reasons for why one would
do things this way I sure would like to hear about them.

Thanks,

Charlie Fineman

Jul 20 '05 #1
0 1660

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

Similar topics

0
by: Phil | last post by:
Hi, I don't understand this strange behaviour: I compile this code : #include <Python.h> #include"Numeric/arrayobject.h" static PyObject *
2
by: Aahz | last post by:
There were some posts recently discussing whether it's poor style to put import statements inside functions. I recently got reminded that there's one very good reason to avoid it: Python has an...
1
by: Funduk | last post by:
Hello, So I've been playing with Python and Pygame for a while and I decided I wanted to make a real executable so I could send that stuff over to my friends to show off my <sarcasm>maad...
23
by: Shane Hathaway | last post by:
Here's a heretical idea. I'd like a way to import modules at the point where I need the functionality, rather than remember to import ahead of time. This might eliminate a step in my coding...
1
by: Shane Hathaway | last post by:
Let's talk about the problem I really want help with. I brought up a proposal earlier, but it was only half serious. I realize Python is too sacred to accept such a heretical change. ;-) ...
2
by: dwelch91 | last post by:
Hi, c.l.p.'ers- I am having a problem with the import of xml.parsers.expat that has gotten me completely stumped. I have two programs, one a PyQt program and one a command line (text) program...
6
by: robert | last post by:
I get python crashes and (in better cases) strange Python exceptions when (in most cases) importing and using cookielib lazy on demand in a thread. It is mainly with cookielib, but remember the...
5
by: IloChab | last post by:
Sorry I wasn't able to be more specific on my topic but I really do not know how to classify my problem, I mean that I can't understand if it's a python or a twisted or a Qt4 problem I'm...
5
by: W. Watson | last post by:
Is there a single source that explains these statements? ------------------------------ from Tkinter import * from Numeric import * import Image import ImageChops import ImageTk import time...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.