xsl-list
[Top] [All Lists]

[xsl] Inverse of apply-template select

2011-01-13 12:51:28

I have an unprofiled docbook xml file i am trying to convert to my companys xml 
format, that is similar to docbook.

The xml file i have is of the following:

<book>
<title>...</title> 
<title>...</title> 
<title>...</title> 
.
.
.
<bookinfo>...</bookinfo>
<bookinfo>...</bookinfo>
<bookinfo>...</bookinfo>
...
<article>...</article>
...
</book>

I have templates to handle all the elements in the docbook file, and convert to 
our formats. One of the unique things about our xml, is that the bookinfo 
element, is renamed to userdocinfo, and MUST come before the title element. The 
rest of the elemtents are effectively renamed in situ.

So, for my book template i have the following:

<xsl:template match="book">
   <UserDoc>
      <xsl:apply-templates select="./bookinfo"/>
      <xsl:apply-templates select="./title"/>
         <GenSection>   

<!-- This line doesn't work. -->

            <xsl:apply-templates select="*[not(./bookinfo) or not(./title)]"/>

         </GenSection>
   </UserDoc>
</xsl:template>

I use the select attribute of the xsl:apply-templates to reorder and process 
bookinfo and title elements.

I want to then apply templates to the rest of the elements, EXCEPT the ones i 
just processed. I know this is just a matter of finding the right xpath for the 
select attribute, but i can't seem to find it.

Can anyone give me a little help or hint on this?

Thanks again for all your help!


Russ

--~------------------------------------------------------------------
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>