xsl-list
[Top] [All Lists]

Re: xpath problem

2004-10-25 01:52:51
Hi there,

1. add the namespace to your stylesheet
   xmlns:myns="http://limpens.com/site"; 
2. add the namespace to all elements in your XPath-query
    e.q. //myns:Document/...
3. change your XPath query to
   //myns:Document[(_at_)href='Publications.aspx']/myns:Information[(_at_)lang
='de']/myns:Title

HTH

--mv



On Fri, 22 Oct 2004 23:39:48 -0200, Jan Limpens 
<jan(_dot_)limpens(_at_)gmail(_dot_)com> wrote:
hi folks,

can anypne tell me why this query
//Document[(_at_)href='Publications.aspx']/Information[lang('de')]/Title

yields no results on this document

<?xml version="1.0" encoding="utf-8"?>
<Site xmlns="http://limpens.com/site";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://limpens.com/site Schemas/Site.xsd">
       <RootDocument href="Default.aspx">
               <Information lang="de">
                       <Title>Startseite</Title>
                       <Description>Limpens.com Homepage</Description>
               </Information>
               <Information lang="pt">
                       <Title>Inicial</Title>
                       <Description>Limpens.com Homepage</Description>
               </Information>
               <Information lang="en">
                       <Title>Home</Title>
                       <Description>Limpens.com Homepage</Description>
               </Information>
               <Document href="Illustrations.aspx">
                       <Information lang="de">
                               <Title>Illustrationen</Title>
                               <Description>Portfolio kommerzieller 
Arbeiten</Description>
                       </Information>
                       <Information lang="pt">
                               <Title>Ilustrações</Title>
                               <Description>Portfolio de trabalhos 
comerciais</Description>
                       </Information>
                       <Information lang="en">
                               <Title>Illustrations</Title>
                               <Description>Portfolio illustrations and 
grafic design</Description>
                       </Information>
               </Document>
               <Document href="Publications.aspx">
                       <Information lang="de">
                               <Title>Veröffentlichungen</Title>
                               <Description>Otakoo Saloon Cartoon und 
mehr...</Description>
                       </Information>
                       <Information lang="pt">
                               <Title>Publicações</Title>
                               <Description>Otakoo Saloon Cartoon e 
mais</Description>
                       </Information>
                       <Information lang="en">
                               <Title>Publications</Title>
                               <Description>Otakoo Saloon Cartoon Comic Strip 
and related
stuff</Description>
                       </Information>
                       <Document href="OtakooSaloonCartoon.aspx">
                               <Information lang="de">
                                       <Title>Otakoo Saloon Cartoon</Title>
                                       <Description>Über den beliebten 
Comicstrip</Description>
                               </Information>
                               <Information lang="pt">
                                       <Title>Otakoo Saloon Cartoon</Title>
                                       <Description>A tira 
famosa</Description>
                               </Information>
                               <Information lang="en">
                                       <Title>Otakoo Saloon Cartoon</Title>
                                       <Description>The famous comic 
strip</Description>
                               </Information>
                               <Document href="SecretOSC.aspx">
                                       <Information lang="de">
                                               <Title>Otakoo Saloon Cartoon 
Preview (Password)</Title>
                                               <Description>Vorschau und 
Archiv</Description>
                                       </Information>
                                       <Information lang="pt">
                                               <Title>Otakoo Saloon Cartoon 
Pre-Estreia</Title>
                                               <Description>Pre Estreia 
(requer senha)</Description>
                                       </Information>
                               </Document>
                       </Document>
               </Document>
               <Document href="Development.aspx">
                       <Information lang="de">
                               <Title>Entwicklung</Title>
                               <Description>Diverse Projekte in c#, xml, xsd, 
xslt und anderen
Abkürzungen</Description>
                       </Information>
                       <Information lang="pt">
                               <Title>Desenvolvimento</Title>
                               <Description>Diversos aventuras em c#, xml, 
xsd, xslt e outras
abreviações</Description>
                       </Information>
                       <Information lang="en">
                               <Title>Development</Title>
                               <Description>Diverse adventures in c#, xml, 
xsd, xslt und other
fancy abreviations</Description>
                       </Information>
               </Document>
               <Document href="Contact.aspx">
                       <Information lang="de">
                               <Title>Kontakt</Title>
                               <Description>Wie man mich am besten 
erreicht</Description>
                       </Information>
                       <Information lang="pt">
                               <Title>Contato</Title>
                               <Description>Oi</Description>
                       </Information>
                       <Information lang="en">
                               <Title>Contact</Title>
                               <Description>Reach me here</Description>
                       </Information>
               </Document>
       </RootDocument>
</Site>

and what I should make different...?

thanks for the help!

--
Jan
http://www.limpens.com

Otakoo Saloon Cartoon - newest episode at http://limpens.com/oscredirect

--+------------------------------------------------------------------
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: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--




<Prev in Thread] Current Thread [Next in Thread>