match problem, saxon 8

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

match problem, saxon 8

Dave Pawson-2
Given

<gpx xmlns="http://www.topografix.com/GPX/1/1"
     >
  <metadata><!-- comment -->
    <name>Descriptive name of file</name><!-- name -->
    <desc>File description</desc><!-- desc -->

....

and

 <xsl:template
match="gpx:*[following-sibling::node()[1] instance of comment()]"
priority="10">
    <xsl:message>
      {<xsl:value-of select="namespace-uri()"/>}       <xsl:value-of
select="name()"/>
    </xsl:message>
    <xsl:next-match/>
  </xsl:template>

with the identity stylesheet imported,

I get

      {http://www.topografix.com/GPX/1/1}       name

      {http://www.topografix.com/GPX/1/1}       desc

on the terminal.

I.e. the metadata element is not being matched.
It appears to be an equally valid match for the template.

I can't see anything else that's wrong with it.
Is it wrong? A bug?

regards

--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

AW: match problem, saxon 8

Huditsch, Roman (LNG-VIE)
Hi Dave,

I don't think that the first comment node is a following sibling of <metadata>.
Therefore it isn't matched. Or am I wrong?

wbr,
Roman

_______________________________________

Roman Huditsch
IT and Electronic Publishing
LexisNexis ARD Orac
Marxergasse 25
1030 Vienna
Austria
ph: +43-1-534 52-1514
f: +43-1-534 52-140
e-mail [hidden email]
www.lexisnexis.at
 

> -----Urspr√ľngliche Nachricht-----
> Von: [hidden email]
> [mailto:[hidden email]] Im Auftrag
> von Dave Pawson
> Gesendet: Montag, 14. November 2005 13:08
> An: [hidden email]
> Betreff: [saxon] match problem, saxon 8
>
> Given
>
> <gpx xmlns="http://www.topografix.com/GPX/1/1"
>      >
>   <metadata><!-- comment -->
>     <name>Descriptive name of file</name><!-- name -->
>     <desc>File description</desc><!-- desc -->
>
> ....
>
> and
>
>  <xsl:template
> match="gpx:*[following-sibling::node()[1] instance of comment()]"
> priority="10">
>     <xsl:message>
>       {<xsl:value-of select="namespace-uri()"/>}       <xsl:value-of
> select="name()"/>
>     </xsl:message>
>     <xsl:next-match/>
>   </xsl:template>
>
> with the identity stylesheet imported,
>
> I get
>
>       {http://www.topografix.com/GPX/1/1}       name
>
>       {http://www.topografix.com/GPX/1/1}       desc
>
> on the terminal.
>
> I.e. the metadata element is not being matched.
> It appears to be an equally valid match for the template.
>
> I can't see anything else that's wrong with it.
> Is it wrong? A bug?
>
> regards
>
> --
> Dave Pawson
> XSLT XSL-FO FAQ.
> http://www.dpawson.co.uk
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App
> Server. Download it for free - -and be entered to win a 42"
> plasma tv or your very own Sony(tm)PSP.  Click here to play:
> http://sourceforge.net/geronimo.php
> _______________________________________________
> saxon-help mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: match problem, saxon 8

Dave Pawson-2
On 14/11/05, Huditsch Roman <[hidden email]> wrote:
> Hi Dave,
>
> I don't think that the first comment node is a following sibling of <metadata>.
> Therefore it isn't matched. Or am I wrong?

> > <gpx xmlns="http://www.topografix.com/GPX/1/1"
> >      >
> >   <metadata><!-- comment -->
> >     <name>Descriptive name of file</name><!-- name -->
> >     <desc>File description</desc><!-- desc -->

mmmm. child::node()[1]

Yes. Thanks Roman.

Appreciated.




--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: match problem, saxon 8

Michael Kay
In reply to this post by Huditsch, Roman (LNG-VIE)
 
>
> I don't think that the first comment node is a following
> sibling of <metadata>.
> Therefore it isn't matched. Or am I wrong?

You are right. You want a condition such as

following-sibling::node()[1][self::comment()] or
child::node()[1][self::comment()]

Michael Kay


>
> wbr,
> Roman
>
> _______________________________________
>
> Roman Huditsch
> IT and Electronic Publishing
> LexisNexis ARD Orac
> Marxergasse 25
> 1030 Vienna
> Austria
> ph: +43-1-534 52-1514
> f: +43-1-534 52-140
> e-mail [hidden email]
> www.lexisnexis.at
>  
>
> > -----Urspr√ľngliche Nachricht-----
> > Von: [hidden email]
> > [mailto:[hidden email]] Im Auftrag
> > von Dave Pawson
> > Gesendet: Montag, 14. November 2005 13:08
> > An: [hidden email]
> > Betreff: [saxon] match problem, saxon 8
> >
> > Given
> >
> > <gpx xmlns="http://www.topografix.com/GPX/1/1"
> >      >
> >   <metadata><!-- comment -->
> >     <name>Descriptive name of file</name><!-- name -->
> >     <desc>File description</desc><!-- desc -->
> >
> > ....
> >
> > and
> >
> >  <xsl:template
> > match="gpx:*[following-sibling::node()[1] instance of comment()]"
> > priority="10">
> >     <xsl:message>
> >       {<xsl:value-of select="namespace-uri()"/>}       <xsl:value-of
> > select="name()"/>
> >     </xsl:message>
> >     <xsl:next-match/>
> >   </xsl:template>
> >
> > with the identity stylesheet imported,
> >
> > I get
> >
> >       {http://www.topografix.com/GPX/1/1}       name
> >
> >       {http://www.topografix.com/GPX/1/1}       desc
> >
> > on the terminal.
> >
> > I.e. the metadata element is not being matched.
> > It appears to be an equally valid match for the template.
> >
> > I can't see anything else that's wrong with it.
> > Is it wrong? A bug?
> >
> > regards
> >
> > --
> > Dave Pawson
> > XSLT XSL-FO FAQ.
> > http://www.dpawson.co.uk
> >
> >
> > -------------------------------------------------------
> > SF.Net email is sponsored by:
> > Tame your development challenges with Apache's Geronimo App
> > Server. Download it for free - -and be entered to win a 42"
> > plasma tv or your very own Sony(tm)PSP.  Click here to play:
> > http://sourceforge.net/geronimo.php
> > _______________________________________________
> > saxon-help mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/saxon-help
> >
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App
> Server. Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> saxon-help mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
<a href="http://ads.osdn.com/?ad_idv28&alloc_id845&op=click">http://ads.osdn.com/?ad_idv28&alloc_id845&op=click
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: match problem, saxon 8

Dave Pawson-2
On 14/11/05, Michael Kay <[hidden email]> wrote:

> You are right. You want a condition such as
>
> following-sibling::node()[1][self::comment()] or
> child::node()[1][self::comment()]

Yes, thanks.
Stupidly I used the visual presentation
rather than the logical one.


Thanks Mike.



--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
<a href="http://ads.osdn.com/?ad_idv28&alloc_id845&op=click">http://ads.osdn.com/?ad_idv28&alloc_id845&op=click
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help