This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: how to realize document()


at first glance u may be having troubles with the

http:// of the document() call

i would first try including the documents as a local file ( ie.place your
xml and xsl file in same directory) and call simply document('source.xml')

if this works ( once again havent looked through your xsl code ) then u need
to have a valid uri/url for the document.,

cheers, jim fuller

----- Original Message -----
From: "Kumar, Yaswanth" <yaswanth.kumar@eds.com>
To: <XSL-List@lists.mulberrytech.com>
Sent: Wednesday, September 19, 2001 8:04 AM
Subject: [xsl] how to realize document()


> Hi All,
>
>     I am unable to get the values of the nodes that are in external xml
> document.
>
>     I am a beginner in using XML and XSLT, just learning its features by
> examples.
>
>     The XML source of the example I tried is as follows:
>
> test1.xml:
> ==========
>
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="test1.xsl"?>
> <document>
>   <p>The relevant excerpt is:</p>
> </document>
>
> source.xml:
> ===========
> <chapter>
>   <p>
> <i>Sentence 1.</i>
> <b>Sentence 2.</b>
>   </p>
>   <p>
> <i>Sentence 3.  Sentence 4.</i>
> <b>Sentence 5.</b>
>   </p>
> </chapter>
>
> test1.xsl:
> ==========
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
> version="1.0">
> <xsl:variable name="vartest"
> select="document('http://intpw2131/pms_local/source.xml')" />
> <xsl:template match="/">
> <html>
> <head>
> <title>Test for XInclude</title>
> </head>
> <body>
> <p>Hello</p>
> <p>Test Data<BR />
> <xsl:for-each select="$vartest/chapter/p">
> Value of i is: <x:value-of select="i" /><br />
> value of b is: <x:value-of select="b" /><br />
> </xsl:for-each></p>
> </body>
> </html>
> </xsl:template>
> </xsl:stylesheet>
>
>
>     I found many pointers in the archives, but they just didn't work for
> me..  I was trying to realize the examples in the internet explorer.
>
>     Please help me in this regard!
>
>     Thanks in advance!
>
> Yash
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]