[Tutor] xml

Alan G alan.gauld at freenet.co.uk
Wed May 25 09:18:17 CEST 2005


Hi Denise,

Sounds like you need a tutor on the basics of the web rather
than one on the Python aspects. It seems you are not familiar
with the web terminology and therefore can't understand the
explanations in the Python docs.

I'll try to help with a few specifics here but you probably
need to google for a web tutor somewhere.

> modules it seems like I need xmlrpclib - I created a serverproxy
> instance, which I want to use to talk to a server - to send it
> information (in this case, a name), and return to me its response.

I don't think you need this if you only want to use XML as
a local storage medium. (Although a database is probably a
better idea for that!) XNL serves several purposes but the
one for which it was designed is as a platform independane
data transport. So the expected use is for sending data
between two different types of box - Windows and Linux say...
Thats when you need servers and proxies and RPC (Remote Procedure
Calls) etc.

> (forgive my probably erroneous wording of things).  It
> said: "The returned instance is a proxy object with methods
> that can be used to invoke corresponding RPC calls on the
> remote server.

So basically this thing is creating an object on your system
that can talk to an object on another box somewhere (including
on your own system of course!). This saves you the trouble of
writing networking code, you just send messages to the local
proxy object and it relays them to the remote object.

But for your address book you don;t need this unless you intend
to make the address list available over the network.

> discovery) and fetch other server-associated metadata."
> - and that sounds like what I want. Perhaps I am wrong?

You might want to do that but the meta-data it refers to is data
about data - for example the schema definition file that
defines what your XML file looks like is an example of meta data.

> Also, when I read the ElementTree page, it talked about element
> instances

instances of XML elements. An XML element being, basically, a single
<tag>...</tag> segment of your file. So you might have an address
element with nested street and city elements.

> and adding "code to load SML files as trees of Element

And the above address elements form a tree structure.

> objects, and save them back again" - as often happens to me (and, I
> hope to other beginners), this explanation does not even tell me if
it
> does the same thing, or anything remotely related to what I am
looking
> for.

When you start using a new technology its important to spend
the time understanding the terminology of that tehnology, because
the documentation will invariably assume you already know that.

> "Both the HTTP and HTTPS transports support the URL syntax extension
> for HTTP Basic Authentication: http://user:pass@host:port/path. The

> http://myname:mypass/www.mysite.com
>
> does not work - but I dont know a "host" or "port" .... ?

You missed an @ sign for a start! :-)

The host is the IP address part:
www.mysite.com

ports are optional and by default http uses port 80. But you can
specify a different port and this can be useful for building a
test site prior to going live, so you might specify that as

www.mysite.com:8080

to use port 8080 instead of port 80. In most cases you don't
need to worry about that.

Finally the path is the bit after the slash and looks like
a file path, but is relative to the home directory of the web
site and may have html references added on to the end.

> documentation is not always user-friendly for beginners!)

It assumes you are a beginner to the library but not to XML
and XML tutors generally assume you are new to XML not to http
or HTML. So you need to start at the beginning of web technology
and read your way up the tree.

HTH,

Alan G.



More information about the Tutor mailing list