[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xsl:apply-tempaltes with select matching

Subject: xsl:apply-tempaltes with select matching
From: "Brett McLaughlin" <bmclaugh@xxxxxxxx>
Date: Wed, 8 Dec 1999 11:35:37 -0600
tempaltes
I have the following XML document:

<?xml version="1.0"?>
<?xml-stylesheet href="xsl/portal-html.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>

<Portal:Page xmlns:Portal="http://url.com">
  <!-- User Specific Information -->
  <Portal:User>
  </Portal:User>

  <!-- Global Preferences Information -->
  <Portal:Preferences>
   <Portal:widgetColor></Portal:widgetColor>
   <Portal:widgetHighlightColor></Portal:widgetHighlightColor>
   <Portal:trimColor>#006699</Portal:trimColor>
   <Portal:trimFontColor>Silver</Portal:trimFontColor>
   <Portal:fontFace>Arial</Portal:fontFace>
  </Portal:Prefereces>

  <!-- Screen preferences information -->
  <Portal:ScreenPreferences>
   <Portal:Screen>
    <Portal:screenTitle>Portal</Portal:screenTitle>
    <Portal:screenColor>#FFCC66</Portal:screenColor>
   </Portal:Screen>
  </Portal:ScreenPreferences>

  <!-- Now deal with the actual outputted content -->
  <Portal:Content>
   <Portal:Header>
    Header
   </Portal:Header>
   <Portal:Body>
     Body
   </Portal:Body>
   <Portal:Footer>
     Footer
   </Portal:Footer>
  </Portal:Content>

</Portal:Page>

I want to process the Portal:Content tag only, and use the rest of the
information as variables.  I has thought to have a stylesheet like so:

<?xml version="1.0"?>

<!-- Written by Brett McLaughlin "bmclaugh@xxxxxxxx" -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">

  <xsl:template match="Portal:Page">
   <xsl:processing-instruction
name="cocoon-format">type="text/html"</xsl:processing-instruction>
   <html>
    <head>
     <title>
      Allegiance Portal -
     </title>
    </head>
    <body bgcolor="#ffffff" marginwidth="5" marginheight="5" topmargin="5"
leftmargin="5">
     <xsl:apply-templates select="Portal:Content"/>
    </body>
   </html>
  </xsl:template>

  <xsl:template match="Portal:Content">
   <xsl:apply-templates/>
  </xsl:template>

And then go on an handle each child element of Portal:Content.  However,
this doesn't work; the Portal:Content match never occurs.  If I take off the
select="Portal:Content" portion of <xsl:apply-templates> in the Portal:Page
section, it then does match Portal:Content, but nothing else.  If someone
could let me know what I'm doing wrong, I'd appreciate it.  I'm also not
sure this is the best way to accomplish this particular task, so any
suggestions are welcome - the other XML data is used throughout the
document, so I don't want to localize it within sections of the XML content.

Thanks,
Brett


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.