Re: TCL Dom question

From: Gerald Lester (Gerald.Lester_at_cox.net)
Date: 12/14/03

  • Next message: Don Porter: "Re: FYI: win 9x is stubbornly hanging around"
    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  |
    +--------------------------------+---------------------------------------+
    

  • Next message: Don Porter: "Re: FYI: win 9x is stubbornly hanging around"

    Relevant Pages

    • Re: Sending existing XML document to a document-literal web service
      ... When you say you don't want to parse the object and load it into an object, ... My understanding is that you can use XmlSerializer to read the XML document ... which was then sent out through the web service. ...
      (microsoft.public.dotnet.framework.aspnet.webservices)
    • Re: Reading HTML Tables ?
      ... Justin Rogers wrote: ... > then you can load them in an XML Document. ... then you'll have to parse them by hand. ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: How to read configuration section for sub-classes
      ... Not through the configuration interfaces, but you can certainly load web.config into an XML document and then parse the sections directly ...
      (microsoft.public.dotnet.framework)
    • XmlDocument.Load failing with CR must be followed by LF
      ... Dim doc As New XmlDocument ... in VB.NET 2.0 to load an XML document for operating on the nodes thereof. ... System.Xml.XmlTextReaderImpl.DtdParserProxy.System.Xml.IDtdParserAdapter.PushExternalSubset(String systemId, String publicId) ...
      (microsoft.public.dotnet.xml)
    • XmlDocument.Load failing with CR must be followed by LF
      ... Dim doc As New XmlDocument ... in VB.NET 2.0 to load an XML document for operating on the nodes thereof. ... System.Xml.XmlTextReaderImpl.DtdParserProxy.System.Xml.IDtdParserAdapter.PushExternalSubset(String systemId, String publicId) ...
      (microsoft.public.dotnet.xml)