[
Lists Home |
Date Index |
Thread Index
]
- From: "Khattar, Sanjay" <Sanjay.Khattar@schwab.com>
- To: 'Frank Richards' <frichards@softquad.com>,"'xml-dev@lists.xml.org'" <xml-dev@lists.xml.org>
- Date: Mon, 11 Dec 2000 11:20:30 -0800
getElementsByTagName is a w3c method.
This returns an element list which I can walk, checking parents or children
as
the case may be. I guess I'd have to do that after all.
Sanjay
-----Original Message-----
From: Frank Richards [mailto:frichards@softquad.com]
Sent: Monday, December 11, 2000 11:07 AM
To: 'Khattar, Sanjay'
Subject: RE: Searching an xml doc without using an XPath expression?
Well, you can of course just walk the tree, checking each element to see if
it's what you want.
The SoftQuad XMetaL DOM interface has a method getElementsByTagName, which
returns an element list which you can walk, checking parents or children as
the case may be. I don't have the spec in front of me, so I'm not sure if
this is a w3c method or a SoftQuad extension.
Frank
-----Original Message-----
From: Khattar, Sanjay [mailto:Sanjay.Khattar@schwab.com]
Sent: Monday, December 11, 2000 1:55 PM
To: Frank Richards; 'xml-dev@lists.xml.org'
Subject: RE: Searching an xml doc without using an XPath expression?
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@softquad.com]
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@schwab.com]
Sent: Friday, December 08, 2000 7:16 PM
To: xml-dev@lists.xml.org
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
|