xsl-list
[Top] [All Lists]

RE: [xsl] Getting the name the input data document

2009-08-21 04:01:44

I tried to use base-uri to get XML path and static-base-uri 
to get XSL path. This works find when I run the 
transformation from XML file and XSL file locate on the hard disk.

When I run the transformation against XML which generate on 
the fly by a program. The base-uri function return empty. 
From the implementation point of view there is no base-uri 
for a XML which generated on the fly.


More precisely, when you generate XML it's your responsibility to define a
base URI for it. If you don't define a base URI for it, then relative URIs
contained within the document cannot be resolved. 

You can define a base URI by creating an xml:base attribute within the
document, or from the API: for example, if the document is generated as the
result of an XSLT transformation controlled using JAXP, you can use
setSystemId() on the Result object passed to the transform() method.

Regards,

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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>