[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Getting the name the input data document
base-uri is useful to locate graphics, xml and other resource referenced in the XML. Thanks Michael, your response is useful for me. Jingjun 2009/8/21 Michael Kay <mike@xxxxxxxxxxxx>: >> >> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|