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

RE: how to use // starting from the root, when i am few step

Subject: RE: how to use // starting from the root, when i am few steps under the root,
From: David Allouche <david@xxxxxxxxxxxxxxxx>
Date: Tue, 22 Aug 2000 10:33:00 -0200 (GMT+2)
root ten
> <root>
>   <one>
>     <two>
>        <applytemplates select="what to put here if i
> want to start from the root//ten"

I am not sure what you mean here. (and there is a typo in
apply-templates name...). This does not make any sense either as a source
document or as a stylesheet.

One interpretation would be:
- source document -
<one>
  <two>
    <three/>
    ....
  </two>
  ...
      <ten/>
  ...
</one>
- - -
- stylesheet -
<xsl:stylesheet version="1.0"
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
...
  <xsl:template match="two">
    <xsl:apply-template select="something that match the element ten
    wherever it may be in the source tree"/>
  </xsl:template>
...
</xsl:stylesheet>
- - -

Here the correct select attribute is select="//ten"

Using select=".//ten" would select any element named ten (in the null URI
namespace) which is at least a grandchildren of the context node (an
element named two, as says the match attribute of the xsl:template
element).


Another interpretation would be that your are using the simplified
stylesheet syntax (without an explicit <xsl:stylesheet> element).
But in this case you have to use a different name space for literal result
elements <one>, <two>, etc. and for the XSLT elements like
apply-templates.

So a meaningful stylesheet would be:

<root xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <one>
    <two>
      <xsl:apply-templates select="what to put here if i
want to start from the root//ten">
    </two>
    ...
  </one>
  <three>
    ...
    <ten> ... </ten>
    ...
  </three>
</root>

In this case you question has still no answer. What I understand is that
you are somehow trying to have a goto behavior.  If that is the case, do
not even think about it.  Goto is like variable assignement in XSLT: it
does not exist and that IS a feature.

If I still miss the point, could you be more precise about what you is you
data set and what you want to do ?

By the way, you should read a good book on XSLT.

Hope this helps.

                             -- David --


PS: As far as I know, select="///element... is not legal.



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


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.