This basically means that the application (EditiX) is supplying the XML to Saxon without saying where it came from. This will typically happen if

(a) you supply the input in the form of an InputStream. Saxon just sees the bytes of the InputStream, it doesn't know where they originate from;

(b) you supply the input in the form of a DOM. A DOM tree has no useful base URI or document URI that Saxon can use.

The problem can only be fixed at application level.

Michael Kay
Saxonica

On 28/03/2012 10:06, David Rudel wrote:
Hello all,

I'm trying to retrieve the URI of the base document. This should be easily done with either:

base-uri()

or

document-uri(/)

And, indeed, when I run Saxon from the command line, this works.

Unfortunately, when using EditiX, which uses the same .jar file, it appears to have no clue what I'm asking. I realize this is not a problem with SAXON, but I am hoping Michael has some insight into what is going wrong or things I might try to fix it.

<xsl:value-of select="base-uri()"/>  returns an empty string.
<xsl:value-of select="base-uri(document(''))"/> returns the URI of the stylesheet (which is as expected but not useful to me)
<xsl:value-of select="document-uri(/)"/> returns an empty string.

<xsl:value-of select="document-uri(document('dummy.xml',.))"/>  (where "dummy.xml" is the name of the source document) returns an error, saying that "dummy.xml" could not be found in the STYLESHEET's directory. That is to say, when I invoke document('file', .), it is not using the second argument correctly to determine where to look for the file and incorrectly looks in the directory of the stylesheet.

I have sent a note to EditiX support, but if you have any insight as to what might be going wrong or have another way for me to procure the source files, URI, I would appreciate it.

The consul shows no errors when I do a "base-uri()," so I have nothing to go on. I can only assume that EditiX is not using the same URI resolver that saxon does from the command line.

Thanks,
David





--

"A false conclusion, once arrived at and widely accepted is not dislodged easily, and the less it is understood, the more tenaciously it is held." - Cantor's Law of Preservation of Ignorance.


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help