Re: How to parse this plz tell me!!!
- From: Aric Bills <aric.bills@xxxxxxxxx>
- Date: Tue, 29 Apr 2008 23:58:03 -0700 (PDT)
On Apr 29, 10:37 pm, anil_ec1 <401a...@xxxxxxxxx> wrote:
On Apr 30, 11:16 am, Aric Bills <aric.bi...@xxxxxxxxx> wrote:
What have you tried?
I tried with the option
"set node [$doc selectNodes {//name}]
set command [$node asText]"
Thanks for clarifying. (It's always a good idea to tell us what has
worked for you and what has not.)
But here the XML has more than one "name".So its not giving any value.
But I need a generic one like each time whenever I need a text in the
XML I don't want to write again this. So please tell me, is there any
procedure for this?
the [foreach] command iterates over a list:
foreach node [$doc selectNodes {//name}] {
# do something here...
}
You might use [lappend] to make a list of all the values of the string
in question.
There may be a way to do this job with XSLT instead of [foreach], but
I'm not familiar with XSLT so I couldn't help you there.
and one more "dom parse $cmdXML doc" will parse the cmdXML to plain
text or any list?
It will parse it into a DOM tree, which is a complex data structure
that is neither a list nor plain text.
and is there any process to make it as a list?
[$doc documentElement] asList
http://wiki.tcl.tk/8984 has some information about the format of the
resulting list.
.
- Follow-Ups:
- Re: How to parse this plz tell me!!!
- From: anil_ec1
- Re: How to parse this plz tell me!!!
- References:
- How to parse this plz tell me!!!
- From: anil_ec1
- Re: How to parse this plz tell me!!!
- From: Aric Bills
- Re: How to parse this plz tell me!!!
- From: anil_ec1
- How to parse this plz tell me!!!
- Prev by Date: version conflict for package "Tcl": TCL_VERSION vs TCL_PATCH_LEVEL
- Next by Date: Re: how to get values from xml
- Previous by thread: Re: How to parse this plz tell me!!!
- Next by thread: Re: How to parse this plz tell me!!!
- Index(es):
Relevant Pages
|