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

Re: removing nesting in data structure

Subject: Re: removing nesting in data structure
From: Mike Brown <mike@xxxxxxxx>
Date: Mon, 20 May 2002 14:01:24 -0600 (MDT)
Re:  removing nesting in data structure
Andrew Welch wrote:
> Ive found a problem already... for some reason it applies subpara3
> twice.  Why is this?

<xsl:apply-templates
 select="*[not(subpara1)][not(subpara2)][not(subpara3)]"/>

In English, you're saying "Of all the element node children of
the current node, I want just those that do not have subpara1
children..." and so on.

You wanted something more like

*[not(local-name()='subpara1' or local-name()='subpara2')]

or

*[not(starts-with(local-name(),'subpara')]

I posted a better example where you just go ahead and select all
children for processing, and have templates matching the ones you
expect to encounter.

Also, I question the wisdom of having distinct element types 'subpara1',
'subpara2', 'subpara3', when you could just have nested 'subpara' elements,
eliminating the need for numbering. Even then, if the content model of subpara
is (para,subpara?), then I'd be inclined to change the names to something like
paragroup & paracontent or something less confusing. ;)

   - Mike
____________________________________________________________________________
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/

 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.