[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: Doubts regarding XSL and DOM

Subject: Re: Doubts regarding XSL and DOM
From: Paul Prescod <papresco@xxxxxxxxxxxxxxxx>
Date: Thu, 29 Oct 1998 08:18:40 -0600

Amit Rekhi wrote:
> Paul,
> >Object models do not query source trees. Query languages query source
> >trees. XSL has a very simple query language.
> But what if I want to "traverse" my XML source tree from XSL apart from
> "querying" it?

What do you mean by "traverse"? Do you want to process a node elsewhere in
a tree? You can already do that. 

<xsl:process match="foo//*[attribute(bar)]">

> 1) Why not have DOM interfaces along with pattern match syntax to enable
> full XML src. document control?

DOM is an API. It is a way for programming languages to get access to XML
data. XSL is not a programming language. Ergo, DOM is not useful for XSL.

> 2) whether or not there is facility to incorporate DOM interfaces within XSL
> seperate from the query pattern syntax it already has?

There is no such facility for the reason I mentioned above. What would
such a facility look like? 

It could look like this: node.getElementByName( "foo" ) but that would be
embedding *javascript* into XSL, not the DOM. First you need a programming
language. Then you decide what APIs it should have access to. So is your
question whether XSL should have an embedded programming language?

> 3) Does having such a "traversal"  facility go against the design goals of
> XSL? In other words is it something that goes outside the domain of XSL?

XSL has a traversal facility, but has nothing to do with the DOM API.

 Paul Prescod  - http://itrc.uwaterloo.ca/~papresco

Marge: "It's almost as if Snake is killing from beyond the grave."
Lisa: "I warned you that capital punishment wouldn't be a deterrent."
	- The Simpson's halloween special: "Hell Toupee"

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread