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

Re: Move elements to preceding parent

Subject: Re: Move elements to preceding parent
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Mon, 15 Jun 2009 15:23:48 +0200
Re:  Move elements to preceding parent
Israel Viente wrote:

Can you please explain the idea of the line:
 <xsl:template match="p[preceding-sibling::p[1][span[@class ne 'chapter']
and not(matches(span[@class ne 'chapter'][last()], '[.?&quot;!]$'))]]"/>

Does it remove the p that has preceding sibling with no ending character at the end of the last span?

Yes, that template matches p elements where the immediately preceding p element is one with a span child where class is not 'chapter' and where the last such span element does not end with one of those characters you listed. As the template is empty it ensure that any such p elements are not copied.



How can I remove the following:
1. extra xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" and
version="-//W3C//DTD XHTML 1.1//EN" inside html element.
2. extra profile="" in head element
3. extra xml:space="preserve" in p, span and br elements.

Unfortunately any attempts to transform a document referencing a DTD on www.w3.org currently fail here with 503 HTTP errors so I can't test myself. I would assume that the referenced DTD you have defines default values for those attributes that the XML parser expands and that the identity transformation copies. According to
http://www.saxonica.com/documentation/using-xsl/commandline.html
Saxon 9 has a command line option
-expand:off
to prevent that from happening so try that if you use Saxon.




--

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

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-2011 All Rights Reserved.