Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XML
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 22nd, 2004, 05:51 AM
Registered User
 
Join Date: Sep 2004
Location: Chennai, Tamilnadu, India.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Search and display fields in XML file

How do I search for records in this particular XML file and display all the fields being searched???
The name of the xml file whose content is to be searched is "first.xml" and it is as follows:

<? xml version="1.0" ?>
<? xml:stylesheet type='text/xsl' href="sample.xsl" ?>
<DATABASE>

<RECORD>
<NAME>abc</NAME>
<AGE>24</AGE>
<DESIG>programmer</DESIG>
</RECORD>

<RECORD>
<NAME>xyz</NAME>
<AGE>45</AGE>
<DESIG>CEO</DESIG>
</RECORD>

</DATABASE>
.................................................. .................

Please help me. I am waiting for a favourable reply.



Reply With Quote
  #2 (permalink)  
Old September 22nd, 2004, 06:18 AM
Friend of Wrox
Points: 1,288, Level: 14
Points: 1,288, Level: 14 Points: 1,288, Level: 14 Points: 1,288, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2004
Location: Stockholm, Sweden
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

Do you want to search the records on some condition or display whole records in the XML file ?



Numan
--------------------------------------------------
Love is the most precious thing of this world. So find it and grab it!
Reply With Quote
  #3 (permalink)  
Old September 24th, 2004, 01:31 AM
Registered User
 
Join Date: Sep 2004
Location: Chennai, Tamilnadu, India.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I want to search the records based on some condition, for example-search for the record having the name as "abc" or search for records having designation as "programmer".

Reply With Quote
  #4 (permalink)  
Old September 24th, 2004, 03:46 AM
mhkay's Avatar
Wrox Author
Points: 18,274, Level: 58
Points: 18,274, Level: 58 Points: 18,274, Level: 58 Points: 18,274, Level: 58
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,932
Thanks: 0
Thanked 282 Times in 277 Posts
Default

That's what XPath is for. Google for "XPath tutorial".

Michael Kay
http://www.saxonica.com/

Michael Kay
http://www.saxonica.com/
Reply With Quote
  #5 (permalink)  
Old September 27th, 2004, 05:12 AM
Registered User
 
Join Date: Sep 2004
Location: Chennai, Tamilnadu, India.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Noted. I will check out the website and XPATH very soon. Thank You.

Reply With Quote
  #6 (permalink)  
Old September 28th, 2004, 09:17 AM
Registered User
 
Join Date: Sep 2004
Location: delhi, delhi, India.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

why don't u use xsl
with
for each match case......
or
other wise
use xpath with patterns

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Search and Replace a text in XML file AyatKh XML 17 May 23rd, 2012 10:05 PM
how to display xml file? asiye Apache Tomcat 0 January 22nd, 2007 10:03 AM
Search XMl File Problem :@ sir_hosam XML 1 February 1st, 2006 05:16 AM
VBA Script to search fields and display contents Jwill1014 Access VBA 8 June 2nd, 2005 08:33 AM
Search and display fields in XML file kts_33 Classic ASP XML 1 September 22nd, 2004 06:16 AM



All times are GMT -4. The time now is 06:54 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.