When you say "path to file name on networked drive", does that mean you are using a UNC filename? There's a history of problems in successfully mapping these to URIs, largely because there are no standards.

Otherwise, my two suggestions would be:

(a) use URIs, not Windows filenames (which implies forwards slashes, not backslashes)

(b) ensure that a Base URI is always known for every document, even if it's a dummy URI that doesn't refer to any real location.

Michael Kay

On 31/01/2013 17:10, Andrew G C Cheung wrote:
Using vb.net and I have referenced the two saxon dll's etc. Inside windows 7 x64.

I have a source xml file which contains absolute paths as attributes.

        <history path="G:/path to file name on networked drive which includes spaces.xml"/>
        <history path="G:/path to file name on networked drive which includes spaces2.xml"/>
        <history path="file:///G:/Projects/projname/Version4.0/MetaData/ProjName_MD.xml"/>

Transformation includes document(@path) (within a for-each)

This works in oXygen, inside ANT script and using the "Transform.exe" tool bundled with the saxon for .net download (9.4HE). 

However from .net I can't seem to get it to work, just doesn't load using the document function

I have tried different slashes, multiple slashes, prepending with "file://", setting base uri for compiler etc. searched the mailing lists/documentation. It's probably something simple but i can't work it out!

vb.net code:

            Dim proc As New Saxon.Api.Processor()
            Dim compiler As XsltCompiler = proc.NewXsltCompiler()
            compiler.BaseUri = New Uri(filepath of source doc - loads fine.)
            Dim transformer As XsltTransformer
            Dim XmlReader As XmlReader = New XmlNodeReader(xdoc)
            Dim input As XdmNode = proc.NewDocumentBuilder().Build(XmlReader)

            '// Create a transformer for the stylesheet.
            transformer = compiler.Compile(New System.Uri("G:\Projects\cta_createVersionHistory.xsl")).Load()

            transformer.InputXmlResolver = Nothing
            transformer.InitialContextNode = input

            Dim serializer As Serializer = New Serializer()

Any ideas?

Thank you!!!


Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:

saxon-help mailing list archived at http://saxon.markmail.org/