Working with MSSOAP

When working with MSSOAP, you have the option of using an RPC client or a Serialization client. The RPC client works essentially the same way that SOAPy does however, there are some subtle differences. For example, to initialize a connection with remote service description, use the mssoapinit method as opposed to SOAPy's get_proxy, but the net effect is the same as shown here sc response sc.methodName param, param Again, the net effect of web service RPC implementations is to allow you to work...

Creating the CGI Script

The xslt.cgi script pulls the stylesheets together and coordinates the processing and updating of the XML on disk. While this application lets you edit and display XML in your browser, it only consists of a single CGI script and two XSL sheets. The source data that may constantly change is also stored on disk as XML. XSLT transformations can be done programmatically using the xml.xslt.processor.Processor class provided 4XSLT is installed, as shown earlier . When the CGI script launches, it...

MSXML NamedNodeMap Object

The NamedNodeMap object is MSXML3.0's support for namespaces and attribute nodes. getNamedItem name This method retrieves the attribute with the given name. getQualifiedItem baseName, namespaceURI This method retrieves the attribute but within the given namespace context. item index This method returns the item at the given index. If there is no such item, None is returned. This method returns the next node in the collection. This method removes the given item from the node collection....

Determining a Nodes Type

You can use the constants built in to the DOM to see what type of node you are dealing with. It may be an element, an attribute, a CDATA section, or a host of other things. All the node type constants are listed in Appendix D. To test a node's type, compare its nodeType attribute to the particular constant you're looking for. For example, a CDATASection instance has a nodeType equal to cdata_section_node. An Element with potential children has a nodeType equal to element_node. When traversing a...

Canonical XML

The term canonicalization originally was borrowed loosely from its more ancient context to indicate that one structure of an instance document is the same as the master, or commonly accepted, structure of the document. Canonicalization is sometimes referred to as C14N for brevity this is similar to the more common use of I18N for internationalization. Canonical XML is an emerging W3C recommendation that allows you to see if one physical representation of a document is equivalent to another...

NodeList

The NodeList interface is a generic list containing the child nodes of the node, regardless of their specific subtype. In other words, Text nodes are in the list alongside Element and Processinginstruction nodes. This interface is not defined in terms of the Node interface. This read-only attribute indicates the number of nodes in the list. If the length is 10, then the actual indexes are 0 through 9. This method returns the node with the corresponding index in the NodeList. If the index is out...

ContentHandler

The ContentHandler is the most used of the SAX handler objects. It is this handler that receives information about the elements being parsed, their attributes, and the content between start and end tags. The parse and parsestring convenience functions described in the previous section require a ContentHandler implementation to be passed in. SAX parsers are encouraged to supply a locator for finding the origin of events within the document, so that you can determine the end position of any...

Selecting a Mode

After the CGI has fetched the query_string, it's used to determine which mode edit, change, or display you are selecting. In the case of no mode whatsoever, the script sends back a complaint and exits mode query.getvalue mode, if not mode print lt html gt lt body gt print lt p gt No mode given lt p gt print lt html gt lt body gt sys.exit 0 In the case of a show command, the simple stylesheet and source XML are loaded by the XSLT processor and the resultant HTML is sent to the browser run XML...

Processing Instructions

Processing Instructions PI allow an XML document to pass instructions to a handling application. The XML processor does not consider Processing Instructions to be part of the document's character data. The point of PIs is to hand information to an application. For example, if you are communicating an urgent piece of news and want the receiving application to present some sort of alert to the user, you might place the following instruction within the XML, so that varying applications can act...

NamedNodeMap

This interface is similar to a NodeList, but its designed to allow the accessing of nodes from the list by name. Nodes are not guaranteed to be in any particular order within the map. This interface is not defined in terms of the Node interface. The number of nodes in the map. As with the NodeList, if length is 10 then actual indexes are 0 through 9. This method retrieves the node specified by the parameter name. The node is returned if found, or None is returned if not. getNamedItemNS...

The Interfaces

The CustomerProfile class supports four distinct operations. These operations allow for retrieval, insertion, updates, and deletes. This class is used by the XML switch to manage the insertion and retrieval of CustomerProfile information at runtime in the distributed system. All communication to and from this class takes the form of XML this enables greater flexibility in how the data is stored on the backend. This also alleviates the burden of requiring distributed applications to connect...

The Topology

As shown earlier in Figure 10-4, the CGI application is primarily a series of transactions between itself and a web browser. However, when the user requests dynamic information, the CGI script uses the XML Switch client to talk to the XML Switch on the network. This example has broad network implications intro.html and sp.py are served up by your web server the sp.py script uses the XML Switch client xsc, created in Example 10-11 to connect back to wherever you are running the XML Switch server...

XMLReader

This is the basic parser interface used in SAX 2. It provides methods to get and set the handler objects and a control variety of configurable options. Starts the parser working on the document in the entity identified by source. The parameter may be a filename, a URL, or an InputSource object. The InputSource interface is described later in this Appendix. Returns the currently configured content handler, or None if there isn't one. Returns the currently configured DTD handler, or None if there...