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

Re: XPointers to the start and the end of an element (

Subject: Re: XPointers to the start and the end of an element (not its content)?
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: 09 Jun 2006 06:58:38 +0100
end of an element
>>>>> "Tom" == bitte um hilfe <bitte.um.hilfe@xxxxxxxxxxxxxxxx> writes:

    Tom> E.g. how could I set an XPointer exactly in front of the
    Tom> second <a> element (marked with * in the source code) or
    Tom> exactly behind an element like the 4th </a> (marked with **).

    Tom> Is this doable at all?

It depends on the processor. But I am not sure what you mean by
exactly behind or exactly in front of.

You don't set XPointers - you use XPointers to refer to a fragment of
a document in the URI you pass to the document() function.

    Tom> Because in my opinion XSL is made to
    Tom> navigate trough a given XML structure with the aim to access
    Tom> embedded content and thatbs the reason why it
    Tom> probably is not possible to access elements themselves (they
    Tom> are structure rather than contentb&).

No, you can access elements via any XPath expression.

    Tom> At the moment the marking is done as follows: ? is the
    Tom> paraphrase for * and the same holds for ?? which is the
    Tom> paraphrase for ** This is doable, because Content within an
    Tom> Element is accessible for sure - by using the text() as well
    Tom> as the position() functions navigating is easy.

    Tom> Does someone have a clue if it could work somehow?

It depends upon which XSLT 2.0 processor you are using. As far as I
know, there are none that support the XPointer scheme (which is not a
W3C recommendation - only the element and xmlns schemes made the
recommendation).

Gestalt has a gexslt:xpath2 scheme, so you could use that to select
the nodes you want.
I think the XPath expression you want is (assuming the first div you
show is the first child element of the document element):

/*/div[1]/*[position gt 2 and position lt 7]

    Tom> PS: using XSLT 2.0 - guess the processor doesn't matter for
    Tom> that question!?

It does matter. Which XPointer schemes (if any) are supported by an
XSLT processor is implementation-defined.

-- 
Colin Adams
Preston Lancashire

Current Thread

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
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.