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

Re: The XSL-List Digest V3 #86

Subject: Re: The XSL-List Digest V3 #86
From: "Sebastian Rahtz" <sebastian.rahtz@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 27 Jun 2000 21:55:46 +0100 (BST)
xsl force self terminating
Perry Roland writes:
 > I'm attempting to transform one XML file into another.  The only
 > modification I want to make is to add IDs to div elements.  That part
 > works correctly; however, I'm having trouble processing comments.  I'm
 > probably missing something very elementary and that's probably why I'm
 > having such a hard time seeing what's wrong.  I'm using saxon.
 > 
 > As you can see, I'm not getting comments in the output.

um. When I run your file, I *do* get comments. what XML parser
are you using with Saxon? is it possibly one which does not pass on
comments to the XSL processor?

 > If this proves too easy, I have another question, too.  Elements without
 > content, given in the XML source file as "<head></head>", show up in the
 > output as self-terminating, e.g. "<head/>".  Is there a way to force
 > saxon to output both start and end tags?

I believe not, without writing a new output handler. Why do you want
to, exactly?

actually, one way to force it is this:

<xsl:template match="head">
 <head>
    <xsl:if test=". =''"><xsl:comment>no head content</xsl:comment></xsl:if>
    <xsl:apply-templates/>
</head>
</xsl:template>

which may be useful?

sebastian

PS I don't think the generate-id() ID looks very nice; I think I'd use
xsl:number and the element name to generate something like "div2-34"


 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.