You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "M. David Peterson" <m....@gmail.com> on 2004/12/30 03:39:58 UTC

Re: [xsl] convert a url path to an xpath

The folowing post from a while back showcases how to do this kind of
thing to build a yahoo-style directory based on a parameter passed in
that contains the current path location within your site...

http://www.stylusstudio.com/xsllist/200405/post80280.html

Hope this helps!

<M:D/>


On Thu, 30 Dec 2004 10:33:53 +0800, Lincoln Mitchell
<li...@linc.net.au> wrote:
> I have a path like www.domain.com/company/about/staff.htm and match
> "company/about/staff" in the sitemap.
> However, I cannot use this path directly in my xpath expression as the xml
> looks like:
> 
> ...
> <wx:sub-section>
>  <w:p>
>    <w:r>
>      <w:t>company</w:t>
>    </w:r>
>  </w:p>
>  ...
>  <wx:sub-section>
>    <w:p>
>      <w:r>
>        <w:t>about</w:t>
>      </w:r>
>    </w:p>
>    ...
>    <wx:sub-section>
>      <w:p>
>        <w:r>
>          <w:t>staff</w:t>
>        </w:r>
>      </w:p>
>      ...
> ...
> 
> So, somehow I need to create a xpath from the path "company/about/staff"
> that looks like:
> "wx:sub-section[w:p/w:r/w:t='company']/wx:sub-section[w:p/w:r/w:t='about']/w
> x:sub-section[w:p/w:r/w:t='company']"
> 
> But how?
> Any help greatly appreciated.
> 
> Linc
> 
> --~------------------------------------------------------------------
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail: <ma...@lists.mulberrytech.com>
> --~--
> 
> 


-- 
:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: [xsl] convert a url path to an xpath

Posted by Lincoln Mitchell <li...@linc.net.au>.
Yes, saw that on the thread. Thx!

Lincoln Mitchell
Graphic Designer & Programmer
m: 0414 286 433
t: 618 9250 6772
www.linc.net.au
lincoln@linc.net.au



-----Original Message-----
From: M. David Peterson [mailto:m.david.x2x2x@gmail.com] 
Sent: Thursday, 30 December 2004 10:44 AM
To: xsl-list@lists.mulberrytech.com
Cc: users@cocoon.apache.org
Subject: Re: [xsl] convert a url path to an xpath

BTW... if using XSLT 2.0 Michael Kay pointed out in a post or two
before the link I just sent you a MUCH easier way to do this kind of
thing...

http://www.stylusstudio.com/xsllist/200405/post00270.html


On Wed, 29 Dec 2004 19:39:58 -0700, M. David Peterson
<m....@gmail.com> wrote:
> The folowing post from a while back showcases how to do this kind of
> thing to build a yahoo-style directory based on a parameter passed in
> that contains the current path location within your site...
> 
> http://www.stylusstudio.com/xsllist/200405/post80280.html
> 
> Hope this helps!
> 
> <M:D/>
> 
> 
> On Thu, 30 Dec 2004 10:33:53 +0800, Lincoln Mitchell
> <li...@linc.net.au> wrote:
> > I have a path like www.domain.com/company/about/staff.htm and match
> > "company/about/staff" in the sitemap.
> > However, I cannot use this path directly in my xpath expression as the
xml
> > looks like:
> >
> > ...
> > <wx:sub-section>
> >  <w:p>
> >    <w:r>
> >      <w:t>company</w:t>
> >    </w:r>
> >  </w:p>
> >  ...
> >  <wx:sub-section>
> >    <w:p>
> >      <w:r>
> >        <w:t>about</w:t>
> >      </w:r>
> >    </w:p>
> >    ...
> >    <wx:sub-section>
> >      <w:p>
> >        <w:r>
> >          <w:t>staff</w:t>
> >        </w:r>
> >      </w:p>
> >      ...
> > ...
> >
> > So, somehow I need to create a xpath from the path "company/about/staff"
> > that looks like:
> >
"wx:sub-section[w:p/w:r/w:t='company']/wx:sub-section[w:p/w:r/w:t='about']/w
> > x:sub-section[w:p/w:r/w:t='company']"
> >
> > But how?
> > Any help greatly appreciated.
> >
> > Linc
> >
> > --~------------------------------------------------------------------
> > XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> > To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> > or e-mail: <ma...@lists.mulberrytech.com>
> > --~--
> >
> >
> 
> 
> --
> :: M. David Peterson ::
> XML & XML Transformations, C#, .NET, and Functional Languages Specialist
> 


-- 
:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <ma...@lists.mulberrytech.com>
--~--


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [xsl] convert a url path to an xpath

Posted by "M. David Peterson" <m....@gmail.com>.
BTW... if using XSLT 2.0 Michael Kay pointed out in a post or two
before the link I just sent you a MUCH easier way to do this kind of
thing...

http://www.stylusstudio.com/xsllist/200405/post00270.html


On Wed, 29 Dec 2004 19:39:58 -0700, M. David Peterson
<m....@gmail.com> wrote:
> The folowing post from a while back showcases how to do this kind of
> thing to build a yahoo-style directory based on a parameter passed in
> that contains the current path location within your site...
> 
> http://www.stylusstudio.com/xsllist/200405/post80280.html
> 
> Hope this helps!
> 
> <M:D/>
> 
> 
> On Thu, 30 Dec 2004 10:33:53 +0800, Lincoln Mitchell
> <li...@linc.net.au> wrote:
> > I have a path like www.domain.com/company/about/staff.htm and match
> > "company/about/staff" in the sitemap.
> > However, I cannot use this path directly in my xpath expression as the xml
> > looks like:
> >
> > ...
> > <wx:sub-section>
> >  <w:p>
> >    <w:r>
> >      <w:t>company</w:t>
> >    </w:r>
> >  </w:p>
> >  ...
> >  <wx:sub-section>
> >    <w:p>
> >      <w:r>
> >        <w:t>about</w:t>
> >      </w:r>
> >    </w:p>
> >    ...
> >    <wx:sub-section>
> >      <w:p>
> >        <w:r>
> >          <w:t>staff</w:t>
> >        </w:r>
> >      </w:p>
> >      ...
> > ...
> >
> > So, somehow I need to create a xpath from the path "company/about/staff"
> > that looks like:
> > "wx:sub-section[w:p/w:r/w:t='company']/wx:sub-section[w:p/w:r/w:t='about']/w
> > x:sub-section[w:p/w:r/w:t='company']"
> >
> > But how?
> > Any help greatly appreciated.
> >
> > Linc
> >
> > --~------------------------------------------------------------------
> > XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> > To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> > or e-mail: <ma...@lists.mulberrytech.com>
> > --~--
> >
> >
> 
> 
> --
> :: M. David Peterson ::
> XML & XML Transformations, C#, .NET, and Functional Languages Specialist
> 


-- 
:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org