[Tclxml-users] TclXML confusions (was: How can I ensure that I always have a list?)
by Cameron Laird other posts by this author
Nov 25 2006 3:59PM messages near this date
Re: [Tclxml-users] newbie basic question using parser to extract Tag names and characterdata together...
|
Re: [Tclxml-users] TclXML confusions (was: How can I ensure that I always have a list?)
In article <jijl34-ipc.ln1@[...].us> , I recommended:
> In article <1164440504.571107.104710@[...].com>,
> comp.lang.tcl <phillip.s.powell@[...].com> wrote:
> .
> .
> .
> >> What exactly are you attempting to do?
> >
> >It's so easy. All I want to do is convert an XML file into a TCL list,
> >that's it, just a TCL list:
> >
> >attr1 {val1} attr2 {val2}
> .
> .
> .
> Should we recommend a SAX or XQuery approach for this?
> A SAX accumulator used to be canonical for something
> this simple; I haven't worked with Rolf's XPath, but I
> suspect it affords a one-liner that satisfies the
> requirements.
Oh, my; I *do* perceive deficiencies in TclXML documentation.
I know that TclXML has had XPath since 2001. In particular, by 2004,
Steve wrote about selectNodes in 3.0 <URL:
http://talkaboutprogramming.com/group/comp.lang.tcl/messages/253140.html > .
When I run
puts [package require dom]
set xml_image {<?xml version = "1.0" encoding = "UTF-8" ?>
<via id="1" trivia_id="255" question="How much wood would a
woodchuck chuck?" answer_id="1" answer="A lot"
expDate="116494926"> </via>
}
set doc [dom::parse $xml_image]
set nodes [$doc selectNodes //via]
on a recent Mac OS, though, I see
3.1
bad method "selectNodes": must be cget, configure, createElement,
createDocumentFragment, createTextNode, createComment,
createCDATASection, createProcessingInstruction, createAttribute,
createEntity, createEntityReference, createDocTypeDecl, importNode,
createElementNS, createAttributeNS, getElementsByTagNameNS,
getElementsById, createEvent, getElementsByTagName, dtd, or schema
So: what's it take to get TclXML to do XPath?
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Tclxml-users mailing list
Tclxml-users@[...].net
https://lists.sourceforge.net/lists/listinfo/tclxml-users
Thread:
Cameron Laird
Steve Ball
|