Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I process my XML schema

Status
Not open for further replies.

dru312

Programmer
Nov 20, 2002
11
0
0
US
can someone help me with my xml. I have a XML document I need to process using these 2 schemas. I have no idea how. Could somone help???

XML Formatting Guidelines
There are two XML Schemas used for importing contacts.

The first schema: schema_getacctgroupid.xml is used to validate the XML passed to Earnware for validating the account group. The root element, “ValidateAccountGroup” contains one required “Request” node. The “Request” node contains optional child nodes for “WebAccountInfo” and “AccountGroupInfo.”

The “WebAccountInfo” node contains two required nodes: “WebUsername” and “Domain.” The “AccountGroupInfo” node contains two required nodes: “Username” and “Password.”

XML passed to GetEWAcctGroupID.asp must have either a “WebAccountInfo” node or a “AccountGroupInfo” node to return a valid Account Group ID to the request object.

schema_getacctgroupid.xml
<?xml version=&quot;1.0&quot;?>
<Schema xmlns=&quot;urn:schemas-microsoft-com:xml-data&quot; name=&quot;ValidateAccountGroup&quot; xmlns:d=&quot;urn:schemas-microsoft-com:datatypes&quot;>

<ElementType name=&quot;ValidateAccountGroup&quot; content=&quot;eltOnly&quot; order=&quot;seq&quot; model=&quot;closed&quot;>
<description>This is the root element that houses all validation requests</description>
<element type=&quot;Request&quot; maxOccurs=&quot;*&quot; minOccurs=&quot;1&quot;/>
</ElementType>

<ElementType name=&quot;Request&quot; content=&quot;eltOnly&quot; order=&quot;seq&quot; model=&quot;closed&quot;>
<description>This houses a request for account group id validation</description>
<element type=&quot;WebAccountInfo&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
<element type=&quot;AccountGroupInfo&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
</ElementType>

<ElementType name=&quot;WebAccountInfo&quot; content=&quot;eltOnly&quot; order=&quot;seq&quot; model=&quot;closed&quot;>
<description>This houses a request for Web Account info to be validated</description>
<element type=&quot;WebUsername&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;1&quot;/>
<element type=&quot;Domain&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;1&quot;/>
</ElementType>

<ElementType name=&quot;WebUsername&quot; content=&quot;textOnly&quot; order=&quot;seq&quot; model=&quot;closed&quot;>
<description>This houses the Web Account username to be validated</description>
</ElementType>

<ElementType name=&quot;Domain&quot; content=&quot;textOnly&quot; order=&quot;seq&quot; model=&quot;closed&quot;>
<description>This houses the Web Account Domain to be validated</description>
</ElementType>

<ElementType name=&quot;AccountGroupInfo&quot; content=&quot;eltOnly&quot; order=&quot;seq&quot; model=&quot;closed&quot;>
<description>This houses a request for Account Group info to be validated</description>
<element type=&quot;Username&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;1&quot;/>
<element type=&quot;Password&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;1&quot;/>
</ElementType>

<ElementType name=&quot;Username&quot; content=&quot;textOnly&quot; order=&quot;seq&quot; model=&quot;closed&quot;>
<description>This houses the Account Group Username to be validated</description>
</ElementType>

<ElementType name=&quot;Password&quot; content=&quot;textOnly&quot; order=&quot;seq&quot; model=&quot;closed&quot;>
<description>This houses the Account Group Password to be validated</description>
</ElementType>
</Schema>


The second schema: schema_importcontacts.xml is used to validated the contact information to be imported to the account group. The root element, “ImportContacts,” contains a required “Import” node. The “Import” node contains required “AcctGroupID” and “Contact” nodes. The “Contact” node contains optional elements containing contact information and the folder name where the contact will be imported to.

schema_importcontacts.xml
<?xml version=&quot;1.0&quot;?>
<Schema xmlns=&quot;urn:schemas-microsoft-com:xml-data&quot; name=&quot;ValidateWebUsername&quot; xmlns:dt=&quot;schemas-microsoft-com:datatypes&quot;>

<ElementType name=&quot;ImportContacts&quot; content=&quot;eltOnly&quot; order=&quot;seq&quot; model=&quot;closed&quot;>
<description>This is the root element that houses all import requests</description>
<element type=&quot;Import&quot; maxOccurs=&quot;*&quot; minOccurs=&quot;1&quot;/>
</ElementType>

<ElementType name=&quot;Import&quot; content=&quot;eltOnly&quot; order=&quot;seq&quot; model=&quot;closed&quot;>
<description>This houses a request for import</description>
<element type=&quot;AcctGroupID&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;1&quot;/>
<element type=&quot;Contact&quot; maxOccurs=&quot;*&quot; minOccurs=&quot;1&quot;/>
</ElementType>

<ElementType name=&quot;AcctGroupID&quot; dt:type=&quot;ui4&quot; content=&quot;textOnly&quot; model=&quot;closed&quot;>
<description>AcctGroup and GroupName(folder name) that contacts are going to be imported to</description>
</ElementType>

<ElementType name=&quot;Contact&quot; content=&quot;eltOnly&quot; order=&quot;seq&quot; model=&quot;closed&quot;>
<description>Domain to be validated</description>
<element type=&quot;CompanyName&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
<element type=&quot;FirstName&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
<element type=&quot;LastName&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
<element type=&quot;Address1&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
<element type=&quot;Address2&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
<element type=&quot;City&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
<element type=&quot;State&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
<element type=&quot;ZipCode&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
<element type=&quot;DayPhone&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
<element type=&quot;EvePhone&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
<element type=&quot;FaxNumber&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
<element type=&quot;Cellular&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
<element type=&quot;EWNumber&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
<element type=&quot;Email&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
<element type=&quot;Notes&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
<element type=&quot;FolderName&quot; maxOccurs=&quot;1&quot; minOccurs=&quot;0&quot;/>
</ElementType>

<ElementType name=&quot;CompanyName&quot; dt:type=&quot;string&quot; dt:minlength=&quot;1&quot; dt:maxlength=&quot;50&quot; content=&quot;textOnly&quot; model=&quot;closed&quot;/>
<ElementType name=&quot;FirstName&quot; dt:type=&quot;string&quot; dt:minlength=&quot;1&quot; dt:maxlength=&quot;50&quot; content=&quot;textOnly&quot; model=&quot;closed&quot;/>
<ElementType name=&quot;LastName&quot; dt:type=&quot;string&quot; dt:minlength=&quot;1&quot; dt:maxlength=&quot;50&quot; content=&quot;textOnly&quot; model=&quot;closed&quot;/>
<ElementType name=&quot;Address1&quot; dt:type=&quot;string&quot; dt:minlength=&quot;1&quot; dt:maxlength=&quot;100&quot; content=&quot;textOnly&quot; model=&quot;closed&quot;/>
<ElementType name=&quot;Address2&quot; dt:type=&quot;string&quot; dt:minlength=&quot;1&quot; dt:maxlength=&quot;100&quot; content=&quot;textOnly&quot; model=&quot;closed&quot;/>
<ElementType name=&quot;City&quot; dt:type=&quot;string&quot; dt:minlength=&quot;1&quot; dt:maxlength=&quot;50&quot; content=&quot;textOnly&quot; model=&quot;closed&quot;/>
<ElementType name=&quot;State&quot; dt:type=&quot;string&quot; dt:minlength=&quot;1&quot; dt:maxlength=&quot;20&quot; content=&quot;textOnly&quot; model=&quot;closed&quot;/>
<ElementType name=&quot;ZipCode&quot; dt:type=&quot;string&quot; dt:minlength=&quot;1&quot; dt:maxlength=&quot;20&quot; content=&quot;textOnly&quot; model=&quot;closed&quot;/>
<ElementType name=&quot;DayPhone&quot; dt:type=&quot;string&quot; dt:minlength=&quot;1&quot; dt:maxlength=&quot;40&quot; content=&quot;textOnly&quot; model=&quot;closed&quot;/>
<ElementType name=&quot;EvePhone&quot; dt:type=&quot;string&quot; dt:minlength=&quot;1&quot; dt:maxlength=&quot;40&quot; content=&quot;textOnly&quot; model=&quot;closed&quot;/>
<ElementType name=&quot;FaxNumber&quot; dt:type=&quot;string&quot; dt:minlength=&quot;1&quot; dt:maxlength=&quot;40&quot; content=&quot;textOnly&quot; model=&quot;closed&quot;/>
<ElementType name=&quot;Cellular&quot; dt:type=&quot;string&quot; dt:minlength=&quot;1&quot; dt:maxlength=&quot;40&quot; content=&quot;textOnly&quot; model=&quot;closed&quot;/>
<ElementType name=&quot;EWNumber&quot; dt:type=&quot;string&quot; dt:minlength=&quot;1&quot; dt:maxlength=&quot;10&quot; content=&quot;textOnly&quot; model=&quot;closed&quot;/>
<ElementType name=&quot;Email&quot; dt:type=&quot;string&quot; dt:minlength=&quot;1&quot; dt:maxlength=&quot;100&quot; content=&quot;textOnly&quot; model=&quot;closed&quot;/>
<ElementType name=&quot;Notes&quot; dt:type=&quot;string&quot; content=&quot;textOnly&quot; model=&quot;closed&quot;/>
<ElementType name=&quot;FolderName&quot; dt:type=&quot;string&quot; dt:minlength=&quot;1&quot; dt:maxlength=&quot;50&quot; content=&quot;textOnly&quot; model=&quot;closed&quot;/>

</Schema>


The Import Contact Process:
1. The requesting page first posts to one of the following pages for processing:
· Dev: · Live: 2. GetEWAcctGroupID.asp validates the Account Holder information and passes back XML to the requesting page with the results of the validation process. If the Account Holder information passes validation, a valid account group ID is passed to the requesting page.
3. If a valid account group ID is passed to the requesting page, the page then posts XML containing the contact information and the import folder name to one of the following pages for processing:
· Dev: · Live: 4. If the Import Folder name is empty, a new folder, named “ImportContacts” is created in the Account Holder’s Business Center, if it does not already exisit. Then the contact information is imported into the “ImportContacts” folder.
5. If the Import Folder name is not empty. The application looks for a folder with the name supplied. If the folder exists, the contact is imported to it. If the folder does not exist, it is created and the contact is imported to it.

Test Page:
The test page on Earnware’s Dev server for this application can be found at:

optionalvalidatetest.asp is a form with input areas for the Account Holder Information for the business center the contact will be imported into, and areas to enter the contact information. The user can either enter the web username and domain OR the accountgroup username and password. The usernames and passwords are assigned, by Earnware, at the time the user signs up for a package, but may be changed by the user at any time. Web domains remain constant, and cannot be changed by the user.

Optionalvalidatetest.asp uses the information submitted in the account holder portion of the form to request an account group id from Earnware by submitting XML to GetEWAcctGroupID.asp. The asp page contains a function, GetEWAcctGroupID, which creates XML from the account holder information submitted in the form, posts the XML, and retrieves an acctgroupid from the response XML:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top