[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Searching an xml doc without using an XPath expression?

  • From: "Khattar, Sanjay" <Sanjay.Khattar@s...>
  • To: 'Huaxin Zhang' <hxzhang@c...>,"'xml-dev@l...'" <xml-dev@l...>
  • Date: Mon, 11 Dec 2000 11:27:37 -0800

getelementbytag
The thing is searchable documents have a large number of <frag>  elements of
varying compositions. The <frag> fragment I need to search for has a
variable number and types of child elements. I have 'the' elegant solution -
make an xpath search string out of my search element - and let xpath
implementations do the work for me. I'd be very to know that somebody has
already done that xpath search string generation - something tells me that
this may be a very useful er functionality....

Sanjay   

-----Original Message-----
From: Huaxin Zhang [mailto:hxzhang@c...]
Sent: Monday, December 11, 2000 11:18 AM
To: Khattar, Sanjay
Cc: 'Frank Richards'; 'xml-dev@l...'
Subject: RE: Searching an xml doc without using an XPath expression?


sure, you can use jaxp api.
use  Document 's getElementbyTag("frag")
and then get the child of sectionA from the returned nodelist


On Mon, 11 Dec 2000, Khattar, Sanjay wrote:

> Frank,
> I'm afraid I wasn't very clear - my apologies.
> 
> I get a dom element like the one below in my processing chain 
> <frag>
>     <sectionA/>
> </frag>
>  
> and I need to search for this element in an in-memory dom document like:
> 
> <docroot>
>     <part1>
>         <frag>
>             <sectionA/>
>         </frag>
>     </part1>
>     <part2>
>         <subpart2>releventValue</subpart2>
>     </part2>
> </docroot>
> 
> and retrieve the <subpart2> element.
>  
> Can I do this without having to use XPath like './/frag/sectionA'? I'd
like
> to be able to search with an org.w3c.dom.Element instance representing the
> search fragment.
>  
> Thanks
> Sanjay
> 
> -----Original Message-----
> From: Frank Richards [mailto:frichards@s...]
> Sent: Monday, December 11, 2000 5:11 AM
> To: 'Khattar, Sanjay'
> Subject: RE: Searching an xml doc without using an XPath expression?
> 
> 
> I don't know exactly what you're trying to accomplish, but you always have
> the option of using text processing tools to scan the doc. Perl or
Omnimark
> will do this for instance.
> 
> Frank
> 
> -----Original Message-----
> From: Khattar, Sanjay [mailto:Sanjay.Khattar@s...]
> Sent: Friday, December 08, 2000 7:16 PM
> To: xml-dev@l...
> Subject: Searching an xml doc without using an XPath expression?
> 
> 
> Is there a way to check if a document fragment like 
> <frag>
>     <sectionA/>
> </frag>
>  
> appears in a document like:
>  
> <docroot>
>     <part1>
>         <frag>
>             <sectionA/>
>         </frag>
>     </part1>
>     <part2>
>     </part2>
> </docroot>
>  
> Can I do this without having to use XPath like ". / <file://frag/sectionA>
> /frag/sectionA <file://frag/sectionA> "?
>  
> Thanks
> Sanjay
> 

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.