RE: [xsl] Re: xsl-list Digest 16 Jan 2007 06:10:00 -0000 Issue 1019

Subject: RE: [xsl] Re: xsl-list Digest 16 Jan 2007 06:10:00 -0000 Issue 1019
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 16 Jan 2007 09:21:05 -0000
Sorry if my code was wrong - it does happen! But I can assure you the
principle was sound, it just needs debugging. If you need help debugging it,
it's best if you can post the code as it now stands, because few people are
likely to have the energy to go through the archives.

If you've got a path expression like current-group()/w:p/w:r/w:t that is't
returning anything, quite a good diagnostic technique is to do

<debug>
  <xsl:copy-of select="current-group()"/>
</debug>

which will often reveal where the misunderstanding arose.

Even better, of course, is to write a schema-aware stylesheet in which case
you'll often get an explanation at compile time when you've written a path
expression that can't select anything.

Michael Kay
http://www.saxonica.com/  

> -----Original Message-----
> From: Frank Hopper [mailto:frank.hopper@xxxxxx] 
> Sent: 16 January 2007 07:59
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Re: xsl-list Digest 16 Jan 2007 06:10:00 -0000 
> Issue 1019
> 
> I tried "<xsl:value-of 
> select="current-group()/w:p/w:r/w:t"/>", but now the 
> <pageContent> node is empty.
> 
> ----------------------------
>   RECEIVED_OUTPUT.XML
> ----------------------------
> <?xml version='1.0' encoding='utf-8' ?>
> <root
>   
> xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/20
> 06/main">
>    <pageData>
>      <pageTitle>1. Web Page Title</pageTitle>
>      <pageContent/>
>    </pageData>
>    <pageData>
>      <pageTitle>2. Web Page Title</pageTitle>
>      <pageContent/>
>    </pageData>
> </root>
> 
> To me it seems like the only information I can get to from 
> within the for-each-group instruction is the pageTitle.
> 
> Thanks,
> Frank
> 
>  > -----Original Message-----
>  > Date: Mon, 15 Jan 2007 11:55:30 -0000  > To: 
> <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>  > From: "Michael Kay" 
> <mike@xxxxxxxxxxxx>  > Subject: RE: [xsl] Grouping  Word 2007 
> content by customXml nodes  > Message-ID: 
> <00ec01c7389c$0e78cd40$6401a8c0@turtle>
>  >
>  > In this expression:
>  >
>  > <xsl:value-of select="//w:p/w:r/w:t"/>  >  > "//" selects 
> from the root of the document. You want to select relative to 
>  > what's selected by xsl:for-each-group, that is 
> current-group(). So try:
>  >
>  > <xsl:value-of select="current-group()/w:p/w:r/w:t"/>

Current Thread