Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Wed, 12 Mar 2008 03:50:48 -0700 (PDT),    group: microsoft.public.xsl        back       


XSLT and function document()   
Hi folks,

I have a question about the xslt function document().
What I want to do is :
   1) access to an external xml document
   2) read some data from the external xml document
   3) access to the input xml document.


Let's say we have the documents :
 - input.xml  : input document
 - style.xslt  : XSLT file
 - external.xml : external xml document

I will run the command line :

java org.apache.xalan.xslt.Process -IN input.xml -XSL style.xslt -OUT
out.xml

about 1) and 2) I know how to access to external.xml using the
function document('external.xml')
About 3) I need your help guys . I want to access to the input.xml
document but I do NOT want to call the function
document('input.xml'). Do you know if exists a parameter for the
function document() that let me know to access to the input document
avoiding an explicit call document('input.xml') ?
I hope is is enough clear my question.
Thanks,

Giovanni Leonetti
date: Wed, 12 Mar 2008 03:50:48 -0700 (PDT)   author:   Giovanni Leonetti

Re: XSLT and function document()   
Giovanni Leonetti wrote:

> I will run the command line :
> 
> java org.apache.xalan.xslt.Process -IN input.xml -XSL style.xslt -OUT
> out.xml
> 
> about 1) and 2) I know how to access to external.xml using the
> function document('external.xml')
> About 3) I need your help guys . I want to access to the input.xml
> document but I do NOT want to call the function
> document('input.xml'). Do you know if exists a parameter for the
> function document() that let me know to access to the input document
> avoiding an explicit call document('input.xml') ?

You do not need the document function to access input.xml as it is the 
primary source document so you can access it with your XPath expressions 
e.g.
   <xsl:variable name="main-root" select="/"/>
Then you can always use that variable $main-root if your context node is 
part of a different document (e.g. external.xml).
-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
date: Wed, 12 Mar 2008 13:46:10 +0100   author:   Martin Honnen

Re: XSLT and function document()   
Thanks Martin.
Now I can switch to the primary source document easily.

Giovanni Leonetti
date: Wed, 12 Mar 2008 08:05:59 -0700 (PDT)   author:   Giovanni Leonetti

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us