Re: TCL Dom question
From: Gerald Lester (Gerald.Lester_at_cox.net)
Date: 12/14/03
- Previous message: Gerald Lester: "Re: How to get the create date of a file ..."
- In reply to: arenaTR: "TCL Dom question"
- Next in thread: Benjamin Riefenstahl: "Re: TCL Dom question"
- Reply: Benjamin Riefenstahl: "Re: TCL Dom question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 14 Dec 2003 12:24:36 -0600
arenaTR wrote:
> I was hoping someone could help with a problem I'm having. I have an XML
> document that I'd like to load into a DOM and use various element-finding
> methods from there to parse the XML document, using TCL. I can't seem to
> get the:
>
> dom::parse
>
> Method to wok correctly.
Can you tell us how you are attempting to use it and how it does not "work
correctly"?
> Can someone advise how I can just load a document
> and maniupate it from there. I'd like to load directly from a file location
> if possible. Thank you very much in advance.
It takes a string not a file, but the read command will read the entire file
at once. Thus to read and parse a file:
set ifd [open snafu.xml r]
set newDoc [::dom::parse [read $ifd]]
close $ifd
-- +--------------------------------+---------------------------------------+ | Gerald W. Lester | "The man who fights for his ideals is | | Gerald.Lester@cox.net | the man who is alive." -- Cervantes | +--------------------------------+---------------------------------------+
- Previous message: Gerald Lester: "Re: How to get the create date of a file ..."
- In reply to: arenaTR: "TCL Dom question"
- Next in thread: Benjamin Riefenstahl: "Re: TCL Dom question"
- Reply: Benjamin Riefenstahl: "Re: TCL Dom question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|