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: The document() function....again !!


I'm not sure this is your problem, but I have also been struggling
with document() in MSXML3. The problem I ran into is how MSXML3 
is actually 'reading' the current document and how the document()
function arguments are actually used. 

document() treats the first argument, if it has a relative path,
as relative to the stylesheet (not relative to the current 
document you are transforming). Seems straight forward. 

If, however, you are using the MSXML load() function, the 
stylesheet and XML document are being put into memory -- and then
loaded from memory into MSXML (or at least that's my limited
understanding of this). So...MSXML doesn't know where 
the stylesheet actually is as a URL and therefore doesn't know
where to look for your file in the document() call. What is the
path relative to? 

Put simply, MSXML couldn't find any XML file that I used in
document() if the path I used for the first argument was relative. 
As soon as I put in an absolute path, MSXML found the file. 
I'm still having other problems with this function and MSXML3, 
so I won't say I've been successful -- and this may not be your
problem. But it sounds really similar.

Sara

> -----Original Message-----
> From: Melvyn Rosengarden [mailto:melrose@rochester.rr.com]
> Sent: Friday, October 13, 2000 1:40 PM
> To: xsl-list@mulberrytech.com
> Subject: The document() function....again !!
> 
> 
> While I am an eager to get help from anyone, I want to direct 
> this question
> to "our teachers" in the group (Alan Kay, Jeni Tennison, and others).
> Could someone please explain what goes on in the the XSLT call to
> document(). I have hit a brick wall using MSXML3.DLL and have 
> been only
> marginally more successful with SAXON.
> 
> First let me say ALL files are in in the exact same directory....
> 
> I am using a string literal as my  URI parameter
>              <xsl:apply-templates
> select="document(somefile.xml)/some_element[@aval='true']"
> " Open the somefile.xml file and return the <some_elemement> 
> node collection
> whose aval attribute is true. "
> 
> followed by..
> 
> <xsl:template match=some_element />
>        <H1> FOUND IT </H1>
> 
> I never invoke the template above yet I am sure the XML data 
> should produce
> the desired result.
> 
> 1.)   Is there any way to verify that the secondary XML has 
> indeed been read
> and parsed ?
> 2.)   In Alan Kay's Wrox text on XSLT he goes to great length 
> to draw the
> schematics of the XML input tree, XSLT transform and output trees.
>        How is that structure impacted by a call to document() 
> ? Is a second
> Input tree created ?  If so what mechanism is used to
>       alternate between those data structures.
> 
> If anyone can offer  ANY suggestion or insight into this 
> process it would be
> MOST greatlfully appreciated.
> 
> Thanks so very much to this whole list for their invaluable 
> contributions.
> 
> 
> "You already have zero privacy -- get over it !!
> Melvyn Rosengarden
> melrose@rochester.rr.com
> 
> 
>  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]