User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the RSS, Web Services and SOAP section within the Web Development category of DaniWeb, a massive community of 456,507 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,657 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our RSS, Web Services and SOAP advertiser: Programming Forums
Views: 1292 | Replies: 0
Reply
Join Date: May 2007
Location: New Brunswick, Canada
Posts: 45
Reputation: mike.mclennan is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
mike.mclennan's Avatar
mike.mclennan mike.mclennan is offline Offline
Light Poster

XML Schema Question

  #1  
Sep 26th, 2007
I have created a new XML file and schema that is used to run sql scripts but I am having a problem doing a few things. below is an example of what I am hoping to create.

XML file.
<root>

  <script>
    <name> Script for Upgrading </name>
    <file> C:\Files\Scripts\Upgrade.sql </file>
    <SCHEMA> Schema Owner </SCHEMA>
  </script>
  <script>
    <name> Script for Removing Geometeries </name>
    <file> C:\Files\Scripts\replaceGeoms.sql </file>
    <SCHEMA> Schema Owner </SCHEMA>
     <USERNAME> Username </USERNAME>
     <PASSWORD> Password </PASSWORD>
  </script>

  <parameter_type>USERNAME</parameter_type>
  <parameter_type>SCHEMA</parameter_type>
  <parameter_type>PASSWORD</parameter_type>
  <parameter_type>NUMBER</parameter_type>
  <parameter_type>STRING</parameter_type>

</root>

XML schema
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="sqlscripts"
            xmlns="sqlscripts" elementFormDefault="qualified">

    <xsd:element name="root">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="script" type="script_type" maxOccurs="unbounded" />
          <xsd:element name="parameter_type" type="xsd:string" 
                                                                                maxOccurs="unbounded" />    
        </xsd:sequence>
      </xsd:complexType>
     </xsd:element>

    <xsd:complexType name="script_type">
        <xsd:sequence>
            <xsd:element name="name" type="xsd:string" />
            <xsd:element name="file" type="xsd:string" />                    
            <xsd:element type="parameter_type" maxOccurs="unbounded" />
        </xsd:sequence>
    </xsd:complexType>  

</xsd:schema>


The main problem I am having is I want the element that surrounds the parameter to
be parameter type name. So if the element is USERNAME and the value is pparker then I know that ppparker is a username and not a PAssword or string or whatever. But I have not been able to find how to do this with the xml schema.

I also would like to create the name field as a key or a unique, I have found a few examples of that but nothing that has worked for me. (I am validating the XML with C# validationReader)

Any help would be greatly appreciated.
- mike mclennan
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb RSS, Web Services and SOAP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the RSS, Web Services and SOAP Forum

All times are GMT -4. The time now is 3:42 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC