Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: simple XML file to fill list boxes etc.


Message #1 by Colin.Montgomery@C... on Mon, 29 Apr 2002 12:17:10 +0100
Hi,

I'm working on an Intranet site which has no DB access.  It would take 6
months to get thru the red tape to get a SQL DB online for this and to be
honest the project doesn't warrant it.  MS Access is not an option due to
company Intranet policy.

I've got no experience of XML and was wondering if it would be a reasonable
option for the following:

A search page which has 4 dependent list boxes, for which I want to use XML
to fill the JavaScript client side arrays.  On clicking search the matching
results will appear - again i'm thinking of using XML to store the records.

I'm thinking of an XML structure similar to the following (prob not valid
XML):
Search Options/Questions
<array1>
     <option1>
	<value>legislation</value>
	<text>Legislation</text>*
     </option1>
     <option2>
     ...
     ...
     </option2>
</array1>
<array2>
...

* I could probably remove the need for a seperate value and text attribute

Results/Answers
I have no idea!  The only text I need to appear is an entry for Source, one
for Note, and one for Userguide.  Source and Userguide can be hyperlinks, so
i'll need a URL attribute for each i'm guessing.

1. Can I do this with IIS4?
2. How do I do this?  Can I query an XML file in a SQL like way?  Do I need
to use XSL or is there an easier way?
3. In my results/answers XML file, would I include attributes for each
question/list box value indicating which combination of values it's relevant
for?

If anyone could offer me any advice on any part of this and/or code snippets
i'd REALLY appreciate it.

Thanks,
Col


*******

This message and any attachment are confidential and may be privileged or otherwise protected from disclosure.  If you are not the
intended recipient, please telephone or email the sender and delete this message and any attachment from your system.  If you are
not the intended recipient you must not copy this message or attachment or disclose the contents to any other person.

For further information about Clifford Chance please see our website at http://www.cliffordchance.com or refer to any Clifford
Chance office.

Message #2 by Colin.Montgomery@C... on Mon, 29 Apr 2002 18:24:33 +0100
i'll try a query which is a little more specific!  I've done a bit more
research on it and hence can refine it to:

Given the following XML **file** format, how would I query it so as it
returns only the 'records' or sources with "xxx" in each of option1,
option2, option3 and option4?  I.e. the SQL would be SELECT * FROM
sourcelist WHERE option1=xxx AND option2=xxx  etc.  Some example code wld be
fantastic.

<?xml  blah blah?>
<sourcelist>
    <source>
	<option1>Case Law</option1>
	<option2>England</option2>
	<option3>Citations</option3>
	<option4>Meaning of a citation</option4>
	<sourcename>Online Law Info Company</sourcename>
	<sourceurl>http://www.blah.com</sourceurl>
	<note>Random words right here</note>
	<userguideurl>http://intranet.blah/userguide/</userguideurl>
    </source>
    ...
    ...
</sourcelist>

And once it's read the records in, do you just manipulate them like you
would a recordset?

Any help and/or pointers would be really appreciated,
Col

-----Original Message-----
From: Colin.Montgomery@C...
[mailto:Colin.Montgomery@C...]
Sent: 29 April 2002 12:17
To: ASP Databases
Subject: [asp_databases] simple XML file to fill list boxes etc.


Hi,

I'm working on an Intranet site which has no DB access.  It would take 6
months to get thru the red tape to get a SQL DB online for this and to be
honest the project doesn't warrant it.  MS Access is not an option due to
company Intranet policy.

I've got no experience of XML and was wondering if it would be a reasonable
option for the following:

A search page which has 4 dependent list boxes, for which I want to use XML
to fill the JavaScript client side arrays.  On clicking search the matching
results will appear - again i'm thinking of using XML to store the records.

I'm thinking of an XML structure similar to the following (prob not valid
XML):
Search Options/Questions
<array1>
     <option1>
	<value>legislation</value>
	<text>Legislation</text>*
     </option1>
     <option2>
     ...
     ...
     </option2>
</array1>
<array2>
...

* I could probably remove the need for a seperate value and text attribute

Results/Answers
I have no idea!  The only text I need to appear is an entry for Source, one
for Note, and one for Userguide.  Source and Userguide can be hyperlinks, so
i'll need a URL attribute for each i'm guessing.

1. Can I do this with IIS4?
2. How do I do this?  Can I query an XML file in a SQL like way?  Do I need
to use XSL or is there an easier way?
3. In my results/answers XML file, would I include attributes for each
question/list box value indicating which combination of values it's relevant
for?

If anyone could offer me any advice on any part of this and/or code snippets
i'd REALLY appreciate it.

Thanks,
Col


*******

This message and any attachment are confidential and may be privileged or
otherwise protected from disclosure.  If you are not the intended recipient,
please telephone or email the sender and delete this message and any
attachment from your system.  If you are not the intended recipient you must
not copy this message or attachment or disclose the contents to any other
person.

For further information about Clifford Chance please see our website at
http://www.cliffordchance.com or refer to any Clifford Chance office.



  Return to Index