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

Problem mixing path and document()

Subject: Problem mixing path and document()
From: "Evan Easton" <evan@xxxxxxxxxxx>
Date: Thu, 23 Sep 1999 15:21:16 -0500
mixing path
I'm having trouble using a built-up external document reference using a
path.  Here's contrived example to demonstrate the problem.  For each
matched ReferencedNode in the source document, the style sheet is to use the
docName and path attributes to copy the node in the referenced file
(foo.xml).  (text continued below)

------ source document ------
<?xml version="1.0"?>
<References>
    <ReferencedNode docName="foo.xml" path="/*[1]/*[1]"/>
</References>

------ stylesheet ------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
    <xsl:template match="/">
        <xsl:apply-templates/>
     </xsl:template>

    <xsl:template match="ReferencedNode">
        <xsl:copy-of select="document(@docName)@path"/>
    </xsl:template>
</xsl:stylesheet>

------ referenced document: foo.xml ------
<?xml version="1.0"?>
<foo>
    <bar1/>
    <bar2/>
    <bar3/>
</foo>


So I expect, in this case to see:

------ expected output ------
<bar1/>

But using using LotusXSL 0.18.2 I receive this output:

--- observed output ---
<foo>
    <bar1/>
    <bar2/>
    <bar3/>
</foo>

I tried  <xsl:copy-of select="document(@docName)/*[1]/*[1]"/> and I get the
expected output.

So, is my stylesheet syntax correct and the styler not working correctly, or
is there a better/correct way to do what I want?

Thanks,
Evan






 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.