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

RE: FW: transformation fails with Xalan, works in XMLs

Subject: RE: FW: transformation fails with Xalan, works in XMLspy
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 5 Aug 2009 10:53:51 +0100
RE:  FW: transformation fails with Xalan
> I am using XSLT 1.0 with Xalan Java-version 2.7.1.
>
> What I am trying to do is to exchange the text nodes of the
> processed XML with text nodes with the same id from a second
> XML document.
>
> My XSL:
>
> <xsl:template match="*[not(parent::*/text())]">

That's matching elements that don't have any text node siblings. It's
working in XMLSpy because the XMLSpy processor (incorrectly) strips
whitespace text nodes from the source. To get the same behaviour in Xalan
use <xsl:strip-space elements="*"/>.

(Though I haven't tried to understand your logic: it's a very strange
condition to be testing).

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay



>         <xsl:variable name="hid" select="@hid"/>
>         <xsl:element name="{name()}">
>             <xsl:copy-of select="@*"/>
>             <xsl:for-each
> select="document('out/_EL_task_installation.xml')/TRANSLATION/
> *[@hid=$hid]">
>                 <xsl:copy-of select="*| text()"/>
>             </xsl:for-each>
>             <xsl:apply-templates select="*[not(parent::*/text())]"/>
>         </xsl:element>
>     </xsl:template>
> </xsl:stylesheet>
>
> The transformation works fine in XMLSpy, however when using a
> batch file to transform with Xalan, the transformation
> results in nearly empty document like this:
>
> <?xml version="1.0" encoding="UTF-8"?><task hid="d0e2"/>
>
> There is no error message. I guess this line is the problem:
>             <xsl:for-each
> select="document('out/_EL_task_installation.xml')/TRANSLATION/
> *[@hid=$hid]">
>
> Any ideas?
> Thanks
>
>
> ______________________________________________________
> GRATIS f|r alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://movieflat.web.de

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.