Form --> xml --> remote server --> reply -->format in html/p

admin

Administrator
Staff member
Hey guys,

Having never played with xml before im after a piece of php coding to do the below:

HTML Form --> xml --> remote server --> reply -->format in html/php

Im collecting two pieces of user input, telephone and postcode.

Need to post to a remote server, telephone, postcode, username, password, and ID.

xml has to be posted in the following schema

<?xml version="1.0" encoding="UTF-8" ?>
- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
- <xs:element name="check">
- <xs:annotation>
<xs:documentation>example xml schema</xs:documentation>
</xs:annotation>
- <xs:complexType>
- <xs:all>
- <xs:element name="sp">
- <xs:complexType>
- <xs:all>
- <xs:element name="username">
- <xs:simpleType>
- <xs:restriction base="xs:string">
<xs:maxLength value=http://www.webdeveloper.com/forum/archive/index.php/"50" />
<xs:whiteSpace value="collapse" />
</xs:restriction>
</xs:simpleType>
</xs:element>
- <xs:element name="password">
- <xs:simpleType>
- <xs:restriction base="xs:string">
<xs:maxLength value="50" />
<xs:whiteSpace value="collapse" />
</xs:restriction>
</xs:simpleType>
</xs:element>
- <xs:element name="id">
- <xs:simpleType>
- <xs:restriction base="xs:string">
<xs:length value="3" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
- <xs:element name="check">
- <xs:complexType>
- <xs:all>
- <xs:element name="telephone">
- <xs:simpleType>
- <xs:restriction base="xs:string">
<xs:maxLength value="12" />
<xs:whiteSpace value="collapse" />
</xs:restriction>
</xs:simpleType>
</xs:element>
- <xs:element name="postcode" minOccurs="0">
- <xs:simpleType>
- <xs:restriction base="xs:string">
<xs:maxLength value="9" />
<xs:whiteSpace value="preserve" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>

Having posted the above to the remote server, i then want to format the reply in a nice fluffy userfriendly html/php formated page.

reply will be in the following format:


<?xml version="1.0" encoding="UTF-8" ?>

- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
- <xs:element name="check">
- <xs:annotation>
<xs:documentation>example results</xs:documentation>
</xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element name="results">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="info1">
<xs:complexType />
</xs:element>
- <xs:element name="info2">
<xs:complexType />
</xs:element>
- <xs:element name="info3">
<xs:complexType />
</xs:element>
- <xs:element name="info4">
<xs:complexType />
</xs:element>
- <xs:element name="info5">
<xs:complexType />
</xs:element>
- <xs:element name="info6">
<xs:complexType />
</xs:element>
- <xs:element name="info7">
<xs:complexType />
</xs:element>
- <xs:element name="info8">
<xs:complexType />
</xs:element>
- <xs:element name="info9">
<xs:complexType />
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="error">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="error_number">
<xs:complexType />
</xs:element>
- <xs:element name="error_desc">
<xs:complexType />
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>



Would really appreciate any help, looking for a quick fix here!

Thanks

Matt :)
 
Back
Top