[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Processing Select Patterns in XSL...

  • From: Tyler Baker <tyler@i...>
  • To: xml-dev@i...
  • Date: Thu, 17 Sep 1998 01:47:37 -0400

xsl select pattern
One thing that is slightly confusing with select patterns is selecting
elements containing parent anchors.

For example, say I have:

<xsl:template match="book">
  <fo:block>
    <xsl:process select="../../../heading"/>
  </fo:block>
</xsl:template>

>From what I understand, this would say first go to the third parent node
of the current node and select all heading elements and process them.
This would seem to be an error since another template may already have
processed these heading elements.

Match patterns seem to be pretty straightforward in how you use them as
all you need to really do is start at the right-most pattern component
and work left.  If everything matches up then finally make sure that the
anchor matches up with the parent of the node that matched the left most
pattern.  If everything still holds, then apply the template rule to
this particular element in the source tree when spitting out the result
tree.

Now select patterns it seems from first glance that you would instead
start from the current node and work left to right instead of right to
left as in the case of match patterns.  Essentially, you would start
from the current node and recursively process all of the descendants
that end up matching the ancestry pattern from left to right.  For
ancestry patterns that do not contain an immediate ancestor operator
this process would be rather cheap.

But in the above example, what do you do when relative or absolute
anchors withing select patterns anchor a node which is an ancestor of
the current node in context.  In this case, it seems as if you can have
multiple template rules acting on the same elements.

Another question is what to do with Absolute Anchors.  I would think
that for select patterns it would not make sense for this to be allowed
as the entire template match then has nothing to do with the actual
processing.  For example if I match a particular element and then select
a set of nodes who are anchored at the root, this would be like doing
global processing independent of the match argument.

I am sure many of these questions are things which I do not understand
due to my relative inexperience with stylesheet languages (most people
are probably also in this boat) and the fact that the most recent spec
is very much incomplete, but it would be nice to know if these are
errors overlooked in the spec, or just my complete misunderstandings on
these issues.

Regards,

Tyler


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.